Hans Johnson
31d65711d6
ENH: Remove conditionals for unsupported VS compilers
...
Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported
compiler with sufficient C++11 capabilities
See:
https://blogs.msdn.microsoft.com/vcblog/2013/12/02/c1114-core-language-features-in-vs-2013-and-the-nov-2013-ctp/
for details related to language features supported.
2019-01-14 16:27:52 -06:00
Hans Johnson
2853b1cdac
COMP: Use C++11 override directly
...
The override support in C++11 is required so avoid aliasing
this feature. Compilers that do not support the override keyword
are no longer supported.
2019-01-14 16:14:12 -06:00
terrycz126
8b31c6f0fd
Fix redefined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES) warning
2019-01-14 16:13:21 -06:00
fangguo
7d16e10113
fiexd “Cannot take the address of a bit field.”
...
```c++
#include <iostream>
class TestBool
{
public:
TestBool():addChildValues_(){}
TestBool(int):addChildValues_(false){}
bool addChildValues_ : 1;
bool indented_ : 1;
};
int main()
{
std::cout << "\n TestBool () addChildValues_ = " << TestBool().addChildValues_;
std::cout << "\n TestBool false addChildValues_ = " << TestBool(3).addChildValues_;
return 0;
}
```
```text
root@osssvr-1 # /opt/SUNWspro/prod/bin/CC testbool.cpp -o testbool
Error: Cannot take the address of a bit field.
1 Error(s) detected.
```
2018-12-31 07:39:04 +07:00
Hans Johnson
e50bfefef1
COMP: Prefer the C++ headers over the C99 headers
...
Using the C++11 headers keeps the library cleaner and more
rigorously scoped use of namespaces.
2018-12-30 15:29:22 -06:00
Hans Johnson
5c8e539af4
ENH: MSVS 2013 snprintf compatible substitute
...
Simplify the backwards compatible snprintf configuration for pre
1900 version of MSVC. Otherwise prefer C++11 syntax using std::snprintf.
2018-12-30 15:29:22 -06:00
Radoslav Atanasov
ccd077ffce
Fix MSVC 15.9 (2017) warning C4866
...
by changing operator[] param type from JSONCPP_STRING to const JSONCPP_STRING& for CharReaderBuilder and StreamWriterBuilder (as it is already in Value).
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c4866?view=vs-2017
2018-12-30 15:28:09 -06:00
Hans Johnson
f64244ed3f
COMP: Use nullptr instead of 0 or NULL
...
The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.
SRCDIR=/Users/johnsonhj/src/jsoncpp #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD
cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-nullptr -header-filter=.* -fix
2018-12-12 13:41:06 -06:00
manang
b955e0f699
Update json_writer.cpp
2018-12-03 10:26:27 +01:00
pavel.pimenov
745287275c
"\n" -> '\n'
2018-06-24 18:51:10 -05:00
Marian Klymov
fc20134c92
Fix different names for parameters in declaration and definition
2018-06-02 20:15:26 +03:00
Marian Klymov
c8bb600d27
Pass string as a const reference.
2018-06-02 19:41:57 +03:00
Billy Donahue
b5e1fe89aa
Apply the formatting specified in .clang-format file.
...
$ clang-format --version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)
$ clang-format -i --style=file $(find . -name '*.cpp' -o -name '*.h')
2018-05-20 18:38:42 -04:00
Billy Donahue
aa1b383666
fix string construction
2018-05-13 18:28:05 -04:00
Billy Donahue
0ba5c435f4
Improvements in writing precision and json_tool.h helpers
2018-05-11 14:31:12 -04:00
fo40225
cf73619e28
refactoring cross compiler macro
2018-05-09 02:06:19 -05:00
fo40225
6e5e9be736
corss compiler isnan
2018-05-08 12:35:08 +08:00
fo40225
3f0d91f08a
fix ValueTest/specialFloats test failure when fp:fast on msvc
2018-05-05 14:38:53 +08:00
Mike R
a07fc53287
Add setting precision for json writers and also add decimal places precision type. ( #752 )
...
* Added setting precision for writers.
* Added special case for precise precision and global precision.
* Added good setting of type of precision and also added this type to BuiltStreamWriter and for its settings.
* Added some tests.
2018-03-13 15:35:31 -05:00
Christopher Dunn
3e2b8ea9cc
Minor changes for static analysis ( #749 )
...
re: #747
2018-03-03 12:51:17 -06:00
Thomas Jandecka
592d942b3b
fix: byte shift when interpreting 32-bit utf-8 codepoints
2018-02-14 14:23:58 +01:00
Christopher Dunn
63ab03ca28
replace code point in range(0xD800, 0xDFFF) to replacement mark ( #714 )
...
closes #712
2017-12-20 14:43:55 -06:00
Remy Jette
42ca02b833
Fix sign mismatch in valueToString
...
`valueToString` takes an argument `unsigned int precision`, but it is used with `%d` rather than `%u` in the `snprintf` format string. Make the format string look for an unsigned value instead.
2017-12-04 17:49:36 -08:00
Josh Soref
e6a588a246
Spelling ( #703 )
2017-12-03 10:54:29 -06:00
Paweł Kierski
42a161fc80
Serialize UTF-8 string with Unicode escapes ( #687 )
...
Squashed and merged.
2017-10-03 18:19:20 -07:00
Christopher Dunn
d830c0ab94
Fix writeCommentBeforeValue() iter deref
...
fixes #649
2017-08-28 08:43:05 -05:00
Devin Jeanpierre
59e4d35339
Restore BL's authorship attribution, and add "The Jsoncpp Authors" where it was missing.
...
Requested/noticed in https://github.com/open-source-parsers/jsoncpp/pull/610 , and a
followup to https://github.com/open-source-parsers/jsoncpp/pull/607 .
2017-07-21 03:44:36 -07:00
pavel.pimenov
ea9f0cec30
strstr -> strchr
...
https://www.viva64.com/en/w/V817/print/
2017-07-13 14:21:53 +03:00
Bernhard Hartleb
4a9d77bcf7
Fix issue #567 in writing real values in different locales
...
The output of snprintf might produce ',' separators for decimal places if
certain locales are set. This commit moves the converversion from ',' to '.'
to correct place. Otherwise an additional ".0" might be appended.
2017-06-22 22:46:16 +02:00
Sylvestre Ledru
7f9cc2705c
Allocate the proper memory for formatString. Fix a warning with gcc 7.1
...
/root/firefox-gcc-last/toolkit/components/jsoncpp/src/lib_json/json_writer.cpp:139:16: note: using the range [-2147483648, 2147483647] for directive argument
/root/firefox-gcc-last/toolkit/components/jsoncpp/src/lib_json/json_writer.cpp:146:10: note: 'sprintf' output between 5 and 15 bytes into a destination of size 6
sprintf(formatString, "%%.%dg", precision);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-06-09 22:41:48 +02:00
Anton Indrawan
2e319850d1
Fix QNX build: QNX defines sprintf under the std namespace. Use snprintf instead
2017-05-01 23:14:23 +02:00
pavel.pimenov
6ca374371e
Fix V815:Decreased performance
2017-04-07 15:41:07 +03:00
Brendan Drew
89ab7eca7f
Ensure that the fact that a float was provided on input is preserved when writing output; update tests to reflect this fact
2016-10-27 04:49:11 -07:00
Christopher Dunn
80a82ea269
Optional space after comma
...
resolves #513
2016-08-21 16:35:19 -05:00
Christopher Dunn
7e0571b444
Avoid null for stringValue
...
fixes #517
2016-08-21 16:25:29 -05:00
Christopher Dunn
e0f9aab0bf
Make internal func anon
...
fixes #489
2016-06-26 17:54:15 -05:00
Christopher Dunn
98e981dff9
Use macro for override
...
b/c MS VS2010 is supposed to be C++11 but does not fulfull
the entire standard.
Resolves #410 .
Re: #430 .
2016-03-21 21:00:24 -05:00
Christopher Dawes
75570d7068
Fixing up for #define instead of typedef in secure allocators
2016-03-14 19:15:17 -05:00
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
Techwolf
7e46bf76e8
std::snprintf fix for Cygwin
2016-02-10 17:09:32 -08:00
Christopher Dunn
2713f4f456
Fix a sign-compare
2016-02-07 11:17:28 -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
fef4b75796
More conversion fixes for gcc
2016-02-06 10:10:49 -06:00
Christopher Dunn
d4513fcf45
Fix conversion warnings/errors
...
See #411 .
http://paste.debian.net/378673/
2016-02-06 09:25:20 -06:00
Jacco
bc9b445fee
std::snprintf fix for MinGW32 c++11
2016-01-25 11:39:36 +01: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
Anton Indrawan
e375b8c89e
Compiles jsoncpp with QNX 6.6
2015-10-03 11:48:19 +02: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