Merge pull request #304 from cdunn2001/297

Same as #297 (1c4f274ab32594d717fc442a0f8a68d9e7633637), but properly rebased
This commit is contained in:
Christopher Dunn 2015-07-11 11:08:47 -05:00
commit b26804d1c2
3 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ endif( MSVC )
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang # using regular Clang or AppleClang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshorten-64-to-32")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC # using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic")

View File

@ -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);

View File

@ -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()) {