Skip to content

Commit b26804d

Browse files
committed
Merge pull request open-source-parsers#304 from cdunn2001/297
Same as open-source-parsers#297 (1c4f274), but properly rebased
2 parents d259f60 + 702a539 commit b26804d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ endif( MSVC )
9797

9898
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
9999
# using regular Clang or AppleClang
100-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
100+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshorten-64-to-32")
101101
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
102102
# using GCC
103103
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic")

src/lib_json/json_value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ inline static void decodePrefixedString(
125125
unsigned* length, char const** value)
126126
{
127127
if (!isPrefixed) {
128-
*length = strlen(prefixed);
128+
*length = static_cast<unsigned>(strlen(prefixed));
129129
*value = prefixed;
130130
} else {
131131
*length = *reinterpret_cast<unsigned const*>(prefixed);

src/lib_json/json_writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void FastWriter::writeValue(const Value& value) {
354354
const std::string& name = *it;
355355
if (it != members.begin())
356356
document_ += ',';
357-
document_ += valueToQuotedStringN(name.data(), name.length());
357+
document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
358358
document_ += yamlCompatiblityEnabled_ ? ": " : ":";
359359
writeValue(value[name]);
360360
}
@@ -914,7 +914,7 @@ void BuiltStyledStreamWriter::writeValue(Value const& value) {
914914
std::string const& name = *it;
915915
Value const& childValue = value[name];
916916
writeCommentBeforeValue(childValue);
917-
writeWithIndent(valueToQuotedStringN(name.data(), name.length()));
917+
writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
918918
*sout_ << colonSymbol_;
919919
writeValue(childValue);
920920
if (++it == members.end()) {

0 commit comments

Comments
 (0)