Skip to content

Made minor edit to build instructions #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 5 additions & 13 deletions src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down