Skip to content

Commit 334ce08

Browse files
committed
fix: Visual Studio warnings for narrowing conversion
1 parent 992d9c4 commit 334ce08

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/yaml-cpp/emitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
189189
}
190190

191191
if (!special) {
192-
auto value_as_str = FpToString(value, stream.precision());
192+
auto value_as_str = FpToString(value, static_cast<size_t>(stream.precision()));
193193
if (GetShowTrailingZero()) {
194194
bool isInScientificNotation = (value_as_str.find('e') != std::string::npos);
195195
bool hasDot = (value_as_str.find('.') != std::string::npos);

include/yaml-cpp/node/convert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ inner_encode(const T& rhs, std::stringstream& stream){
130130
stream << ".inf";
131131
}
132132
} else {
133-
stream << FpToString(rhs, stream.precision());
133+
stream << FpToString(rhs, static_cast<size_t>(stream.precision()));
134134
}
135135
}
136136

0 commit comments

Comments
 (0)