From 710260d07060e95bebad01fa6bc9c81531075fa8 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Mon, 29 Jun 2015 19:20:08 +0100 Subject: [PATCH 1/5] Allow an optional suffix on the debug library name in CMake. --- CMakeLists.txt | 1 + src/lib_json/CMakeLists.txt | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ab19e..e8f2156 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ IF(NOT WIN32) ENDIF(NOT CMAKE_BUILD_TYPE) ENDIF(NOT WIN32) +SET(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the library name for a debug build") SET(LIB_SUFFIX "" CACHE STRING "Optional arch-dependent suffix for the library installation directory") SET(RUNTIME_INSTALL_DIR bin diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index 97b7019..79ffa2e 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -2,7 +2,7 @@ if( CMAKE_COMPILER_IS_GNUCXX ) #Get compiler version. execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GNUCXX_VERSION ) - + #-Werror=* was introduced -after- GCC 4.1.2 if( GNUCXX_VERSION VERSION_GREATER 4.1.2 ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing") @@ -43,7 +43,8 @@ IF(BUILD_SHARED_LIBS) ADD_DEFINITIONS( -DJSON_DLL_BUILD ) ADD_LIBRARY(jsoncpp_lib SHARED ${PUBLIC_HEADERS} ${jsoncpp_sources}) SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR}) - SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp ) + SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp + DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} ) INSTALL( TARGETS jsoncpp_lib ${INSTALL_EXPORT} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} @@ -61,7 +62,8 @@ ENDIF() IF(BUILD_STATIC_LIBS) ADD_LIBRARY(jsoncpp_lib_static STATIC ${PUBLIC_HEADERS} ${jsoncpp_sources}) SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR}) - SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp ) + SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp + DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} ) INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} From bb5d0249ed8f592169e1fdb617531b4e5dfe84ad Mon Sep 17 00:00:00 2001 From: Stuart Eichert Date: Wed, 1 Jul 2015 14:05:54 -0700 Subject: [PATCH 2/5] Warn about implicit 64 to 32 bit conversions when using clang --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8f2156..3eeacf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ endif( MSVC ) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # using regular Clang or AppleClang - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshorten-64-to-32") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # using GCC set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long") From cb8259f545d940c1b87b9142e234f1b9a4568d3b Mon Sep 17 00:00:00 2001 From: Stuart Eichert Date: Wed, 1 Jul 2015 14:18:15 -0700 Subject: [PATCH 3/5] 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. --- src/lib_json/json_value.cpp | 2 +- src/lib_json/json_writer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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()) { From 2e185081b2d05123c69a77b1535a27e047632646 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Fri, 3 Jul 2015 15:47:00 -0700 Subject: [PATCH 4/5] Fix undefined name "sys" Same as #299 (bca0eff81a1c5ef160d9858b8e89b1c919b71c1f), but an earlier commit needed to be rebased. --- devtools/fixeol.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/fixeol.py b/devtools/fixeol.py index 054eb9b..b55e146 100644 --- a/devtools/fixeol.py +++ b/devtools/fixeol.py @@ -5,6 +5,7 @@ from __future__ import print_function import os.path +import sys def fix_source_eol(path, is_dry_run = True, verbose = True, eol = '\n'): """Makes sure that all sources have the specified eol sequence (default: unix).""" From 7670e5151b0dcf28362932e1abdb5a535c69bd17 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Sat, 11 Jul 2015 13:53:05 -0500 Subject: [PATCH 5/5] 0.10.3 --- CMakeLists.txt | 2 +- include/json/version.h | 4 ++-- version | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eeacf1..666f21f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ ENDMACRO(jsoncpp_parse_version) #SET( JSONCPP_VERSION_MAJOR X ) #SET( JSONCPP_VERSION_MINOR Y ) #SET( JSONCPP_VERSION_PATCH Z ) -SET( JSONCPP_VERSION 0.10.2 ) +SET( JSONCPP_VERSION 0.10.3 ) jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION ) #IF(NOT JSONCPP_VERSION_FOUND) # MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z") diff --git a/include/json/version.h b/include/json/version.h index 1c52a5c..19a346f 100644 --- a/include/json/version.h +++ b/include/json/version.h @@ -4,10 +4,10 @@ #ifndef JSON_VERSION_H_INCLUDED # define JSON_VERSION_H_INCLUDED -# define JSONCPP_VERSION_STRING "0.10.2" +# define JSONCPP_VERSION_STRING "0.10.3" # define JSONCPP_VERSION_MAJOR 0 # define JSONCPP_VERSION_MINOR 10 -# define JSONCPP_VERSION_PATCH 2 +# define JSONCPP_VERSION_PATCH 3 # define JSONCPP_VERSION_QUALIFIER # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) diff --git a/version b/version index 5eef0f1..a3f5a8e 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.10.2 +0.10.3