mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-28 20:15:24 +08:00
Fix #296: Explicitly cast size_t results to unsigned when needed
This is rebased from #297, where AppVeyor had been failing, and which was not properly based on the master branch.
This commit is contained in:
parent
81cb7e5c5b
commit
702a539762
@ -125,7 +125,7 @@ inline static void decodePrefixedString(
|
|||||||
unsigned* length, char const** value)
|
unsigned* length, char const** value)
|
||||||
{
|
{
|
||||||
if (!isPrefixed) {
|
if (!isPrefixed) {
|
||||||
*length = strlen(prefixed);
|
*length = static_cast<unsigned>(strlen(prefixed));
|
||||||
*value = prefixed;
|
*value = prefixed;
|
||||||
} else {
|
} else {
|
||||||
*length = *reinterpret_cast<unsigned const*>(prefixed);
|
*length = *reinterpret_cast<unsigned const*>(prefixed);
|
||||||
|
@ -354,7 +354,7 @@ void FastWriter::writeValue(const Value& value) {
|
|||||||
const std::string& name = *it;
|
const std::string& name = *it;
|
||||||
if (it != members.begin())
|
if (it != members.begin())
|
||||||
document_ += ',';
|
document_ += ',';
|
||||||
document_ += valueToQuotedStringN(name.data(), name.length());
|
document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
|
||||||
document_ += yamlCompatiblityEnabled_ ? ": " : ":";
|
document_ += yamlCompatiblityEnabled_ ? ": " : ":";
|
||||||
writeValue(value[name]);
|
writeValue(value[name]);
|
||||||
}
|
}
|
||||||
@ -914,7 +914,7 @@ void BuiltStyledStreamWriter::writeValue(Value const& value) {
|
|||||||
std::string const& name = *it;
|
std::string const& name = *it;
|
||||||
Value const& childValue = value[name];
|
Value const& childValue = value[name];
|
||||||
writeCommentBeforeValue(childValue);
|
writeCommentBeforeValue(childValue);
|
||||||
writeWithIndent(valueToQuotedStringN(name.data(), name.length()));
|
writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
|
||||||
*sout_ << colonSymbol_;
|
*sout_ << colonSymbol_;
|
||||||
writeValue(childValue);
|
writeValue(childValue);
|
||||||
if (++it == members.end()) {
|
if (++it == members.end()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user