Commit Graph

815 Commits

Author SHA1 Message Date
Christopher Dunn
38bb491400 JSONCPP_OSTRINGSTREAM 2016-03-06 11:56:38 -06:00
Christopher Dunn
724ba29bd3 JSONCPP_OSTREAM 2016-03-06 11:56:38 -06:00
Christopher Dunn
de5b792168 JSONCPP_STRING 2016-03-06 11:56:38 -06:00
Christopher Dunn
1b8e3b7f4d Merge pull request #432 from ya1gaurav/patch-33
Avoid passing Null to memcmp

hopefully resolves #404
2016-03-02 14:27:03 -06:00
Gaurav
4878913143 Avoid passing Null to memcmp
As per discussion in - https://github.com/open-source-parsers/jsoncpp/issues/404
Null should not be pass to memcmp, it may show undesired behaviour, so avoid doing that using assertion.
Also, changed one direct "assert" to JSON_ASSERT - it will be decided if exceptions are used or not.
2016-03-01 14:13:28 +05:30
Christopher Dunn
d179e24c14 Merge pull request #429 from tmaciejewski/remove_c_style_casting
remove C-style casting
2016-02-29 23:20:07 -06:00
Tomasz Maciejewski
ccd70540e3 remove C-style casting 2016-02-28 12:56:04 +01:00
Christopher Dunn
b4d2b65841 Merge pull request #418 from Techwolfy/master
std::snprintf fix for Cygwin
2016-02-10 21:17:31 -06:00
Techwolf
7e46bf76e8 std::snprintf fix for Cygwin 2016-02-10 17:09:32 -08:00
Christopher Dunn
da0c50f7b2 Merge pull request #416 from cdunn2001/fix-gcc6-errors
Fix gcc6 errors
2016-02-07 11:40:50 -06:00
Christopher Dunn
02bc3d77de This *might* fix the last gcc-6 error.
See https://github.com/open-source-parsers/jsoncpp/issues/411#issuecomment-180974558

I was unable to produce a warning in Clang, so I am not certain. But based on a [SO answer](http://stackoverflow.com/questions/25480059/gcc-conversion-warning-when-assigning-to-a-bitfield), I think I've fixed the following:
```
/tmp/jsoncpp/src/lib_json/json_value.cpp: In copy constructor 'Json::Value::CZString::CZString(const Json::Value::CZString&)':
/tmp/jsoncpp/src/lib_json/json_value.cpp:235:18: error: conversion to 'unsigned char:2' from 'unsigned int' may alter its value [-Werror=conversion]
   storage_.policy_ = (other.cstr_
                      ~~~~~~~~~~~~
                  ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      ? noDuplication : duplicate)
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  : static_cast<DuplicationPolicy>(other.storage_.policy_));
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2016-02-07 11:28:50 -06:00
Christopher Dunn
6b562c850d Drop -Wno-sign-conversion suppression 2016-02-07 11:19:04 -06:00
Christopher Dunn
2713f4f456 Fix a sign-compare 2016-02-07 11:17:28 -06:00
Christopher Dunn
83bc9c7cf6 Errors for sign-compare, since gcc6 is stricter 2016-02-07 11:12:25 -06:00
Christopher Dunn
95f120f68e For gcc>=6 JSON_USE_INT64_DOUBLE_CONVERSION 2016-02-07 11:09:41 -06:00
Christopher Dunn
9a4b1e39bf 1.7.0 < 1.6.5 2016-02-06 10:27:39 -06:00
Christopher Dunn
2c872ec997 Merge pull request #406 from magnific0/master
std::snprintf not part of std for MinGW32 using c++11
2016-02-06 10:21:45 -06:00
Christopher Dunn
b860cc38e8 Merge pull request #414 from cdunn2001/conversion-errors
Fix conversion warnings/errors
2016-02-06 10:19:23 -06:00
Christopher Dunn
fef4b75796 More conversion fixes for gcc 2016-02-06 10:10:49 -06:00
Christopher Dunn
779d8a33fc Try to find ptrdiff_t for GNUC 4.9.2
https://travis-ci.org/open-source-parsers/jsoncpp/jobs/107452667
2016-02-06 09:49:29 -06:00
Christopher Dunn
d4513fcf45 Fix conversion warnings/errors
See #411.
  http://paste.debian.net/378673/
2016-02-06 09:25:20 -06:00
Christopher Dunn
baefec773c In case cmake is run in root-dir 2016-02-06 08:29:12 -06:00
Christopher Dunn
bc72070f43 Merge pull request #393 from ds283/cmake-binary-dir
Change ${CMAKE_BINARY_DIR} to ${CMAKE_CURRENT_BINARY_DIR}
2016-02-04 15:05:02 -06:00
Jacco
bc9b445fee std::snprintf fix for MinGW32 c++11 2016-01-25 11:39:36 +01:00
Jacco
2646ac5fa5 std::snprintf fix for MinGW32 c++11 2016-01-25 11:38:49 +01:00
ds283
2cca1cd239 Change ${CMAKE_BINARY_DIR} to ${CMAKE_CURRENT_BINARY_DIR}
- if building as a submodule of another repository, installation of pkg-config files can fail because they may not be in the top-level binary directory

- changing ${CMAKE_BINARY_DIR} to ${CMAKE_CURRENT_BINARY_DIR} allow CMake to find the files for installation
2015-12-05 12:18:12 +00:00
Christopher Dunn
9234cbbc90 Merge pull request #387 from joerg-krause/cmake-option-strict-iso
Disable -pedantic conditionally; add -pedantic-errors and -Werror conditionally
2015-10-30 01:16:49 -05:00
Jörg Krause
7c93031c9b Enable -Werror with JSONCPP_WITH_WARNING_AS_ERROR
Commit 912d55094d disabled '-Werror'. Enable it
if jsoncpp is build with JSONCPP_WITH_WARNING_AS_ERROR=ON.
2015-10-29 09:21:01 +01:00
Jörg Krause
48bfe91062 Add option JSONCPP_WITH_STRICT_ISO
'-pedantic' issues all warnings demanded by strict ISO C/C++; rejecting
extensions that do not follow ISO C/C++. Without this option, certain GNU
extensions and traditional C/C++ features are supported as well.

With this option enabled building jsoncpp fails with the musl toolchain on
x86 because of an incompatible posix_memalign declaration [1]. Without
'-pedantic' there is no error anymore and jsoncpp builds fine.

Add an option JSONCPP_WITH_STRICT_ISO to disable compilation with '-pedantic'
with GCC. If jsoncpp is build with the JSONCPP_WITH_WARNING_AS_ERROR option
'-pedantic-errors' is used instead.

[1] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html
2015-10-29 09:16:21 +01:00
Christopher Dunn
0cce773019 Merge pull request #384 from EvinceMoi/master
json_reader throwRuntimeError return error details
2015-10-27 15:48:05 -05:00
Evince
6b10ce8c0d json_reader throwRuntimeError return error details instead of hard-coded message
Signed-off-by: Evince <baneyue@gmail.com>
2015-10-28 00:22:46 +08:00
Christopher Dunn
34bdbb58b4 Merge pull request #267 from cdunn2001/moveSemantics
move ctors
2015-10-21 01:13:59 -05:00
Christopher Dunn
527965cbde Minor
adjustments, based on comments in PR.
2015-10-19 23:49:07 -05:00
Motti
2b00891a86 move ctors
* Add move constructor to Value::CZString
* Add unit test for Value move constructor
* Allow includer to specify in advance the value for
JSON_HAS_RVALUE_REFERENCES
2015-10-19 23:42:52 -05:00
Christopher Dunn
a4ce2829dc Some indentation
in anticipation of another change.
2015-10-19 23:40:47 -05:00
Christopher Dunn
69e7f1c858 Merge pull request #382 from cdunn2001/ccache
Support ccache
2015-10-19 22:50:41 -05:00
Christopher Dunn
d1a2b94d5b Support ccache
http://stackoverflow.com/a/24305849/263998
2015-10-19 12:10:58 -05:00
Christopher Dunn
772f634548 Merge pull request #381 from bknecht/precision
Resolves #284
2015-10-15 16:15:15 -05:00
Benjamin Knecht
9fd1ca8d68 Add test code for precision 2015-10-15 18:32:24 +02:00
Benjamin Knecht
38022157b2 making precision unsigned int
adding precision as settings value for StreamBuilder
2015-10-15 18:00:42 +02:00
Benjamin Knecht
039a6e3b61 Create format string with sprintf.
For now use hardcoded precision '17' for now
2015-10-15 17:28:56 +02:00
Christopher Dunn
9c17e61bd0 Merge pull request #379 from cdunn2001/issue-377
Iterator conversions
2015-10-10 17:20:37 -05:00
ycqiu
c8a8cfcd4b fix
In value.h, ValueConstIterator can convert to ValueIterator, I think that is a bug. the correct way is ValueIterator can convert to ValueConstIterator.
2015-10-10 17:17:20 -05:00
ycqiu
4994c77d09 add test code
does not compile
2015-10-10 16:22:14 -05:00
Christopher Dunn
beae99924f Merge pull request #373 from antonindrawan/QNX_support
Compiles jsoncpp with QNX 6.6
2015-10-04 14:54:09 -05:00
Christopher Dunn
8b9940fd24 Merge pull request #375 from Dani-Hub/issue-374-remove-defaulted-ctor
Remove defaulted default constructor
2015-10-03 16:03:27 -05:00
drgler
b96d90efbd Remove defaulted default constructor 2015-10-03 19:40:23 +02:00
Anton Indrawan
e375b8c89e Compiles jsoncpp with QNX 6.6 2015-10-03 11:48:19 +02:00
Christopher Dunn
49393ead06 Merge pull request #371 from mathstuf/more-platform-support
json_writer: improve isfinite support on *nix
2015-10-03 03:58:20 -05:00
Ben Boeckel
8df11d518b json_writer: improve isfinite support on *nix
Based on a patches to CMake by:

Ådne Hovda <ahovda@openit.com>:

    commit 7b1cdb00279908cacabada92f8a53e4986465423

    jsoncpp: Provide 'isfinite' implementation on older AIX and HP-UX

    Newer AIX and HP-UX platforms provide 'isfinite' as a <math.h> macro.
    Older versions do not, so add the definition if it is not provided.

Michael Scott <michael.scott@gbgplc.com>:

    commit 9217b678b305d7df7471ba476a81bf28961fdfa3

    jsoncpp: Provide 'isfinite' impl on more HP-UX versions (#15576)

    Some versions of HP-UX do not define 'isfinite' or 'finite' in math.h
    for Itanium when preprocessing with C++, so we have to add the
    definition ourselves instead to map to the internal version.

Joerg Sonnenberger <joerg@bec.de>:

    commit 75644dafe54c21902f14cfe58cb8338b553b69d8

    jsoncpp: Fix compilation as C99 on Solaris

    In C99 mode, Solaris variants may already define isfinite, so check for
    the existence first.
2015-10-01 13:27:19 -04:00