From e900f5b91249fdce24493fe731c2f6d15dbed4b5 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Wed, 3 Sep 2014 14:11:33 -0700 Subject: [PATCH 1/2] fix README; ws --- README.md | 2 +- src/lib_json/json_writer.cpp | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6af343fa0..e981c2777 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Alternatively, from the command-line on Unix in the source directory: mkdir -p ../build/debug cd ../build/debug - cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../../jsoncpp/src + cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../../jsoncpp make Running `cmake -`" will display the list of available generators (passed using diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index e52fe4a6b..3a9994eea 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -81,23 +81,15 @@ std::string valueToString(double value) { len = sprintf_s(buffer, sizeof(buffer), "%.16g", value); #endif #else - if ( isfinite( value )) - { + if (isfinite( value )) { len = snprintf(buffer, sizeof(buffer), "%.16g", value); - } - else - { + } else { // IEEE standard states that NaN values will not compare to themselves - if ( value != value) - { + if ( value != value) { len = snprintf(buffer, sizeof(buffer), "null"); - } - else if ( value < 0) - { + } else if ( value < 0) { len = snprintf(buffer, sizeof(buffer), "-1e+9999"); - } - else - { + } else { len = snprintf(buffer, sizeof(buffer), "1e+9999"); } // For those, we do not need to call fixNumLoc, but it is fast. From c8f82451f4cc1a8907d6c26e928c0b221a64a36c Mon Sep 17 00:00:00 2001 From: Finbarr Timbers Date: Sat, 6 Sep 2014 17:14:52 +0100 Subject: [PATCH 2/2] Made minor edit to build instructions If $PWD is (e.g.) `/Users/finblarr/jsoncpp/build/debug`, `../../jsoncpp` is `/Users/finblarr/jsoncpp/jsoncpp`. The proper directory is `../../../jsoncpp`, which is the directory containing the source files. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e981c2777..a10e3586d 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Alternatively, from the command-line on Unix in the source directory: mkdir -p ../build/debug cd ../build/debug - cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../../jsoncpp + cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../../../jsoncpp make Running `cmake -`" will display the list of available generators (passed using