diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 5a7a548..8e9af94 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -126,7 +126,7 @@ inline static void decodePrefixedString( unsigned* length, char const** value) { if (!isPrefixed) { - *length = strlen(prefixed); + *length = static_cast(strlen(prefixed)); *value = prefixed; } else { *length = *reinterpret_cast(prefixed); diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 0a48f95..b2f5583 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -343,7 +343,7 @@ void FastWriter::writeValue(const Value& value) { const std::string& name = *it; if (it != members.begin()) document_ += ','; - document_ += valueToQuotedStringN(name.data(), name.length()); + document_ += valueToQuotedStringN(name.data(), static_cast(name.length())); document_ += yamlCompatiblityEnabled_ ? ": " : ":"; writeValue(value[name]); } @@ -903,7 +903,7 @@ void BuiltStyledStreamWriter::writeValue(Value const& value) { std::string const& name = *it; Value const& childValue = value[name]; writeCommentBeforeValue(childValue); - writeWithIndent(valueToQuotedStringN(name.data(), name.length())); + writeWithIndent(valueToQuotedStringN(name.data(), static_cast(name.length()))); *sout_ << colonSymbol_; writeValue(childValue); if (++it == members.end()) {