Alexandru Ardelean
1eab22f0da
tests: add test_deep_copy test
Seems to perform better than outputting to string
and re-parsing it.
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 20 seconds
BENCHMARK - 1000000 iterations of 'dst2 = json_tokener_parse(json_object_get_string(src2))' took 7 seconds
It should make a difference on embedded systems.
The test was performed on a i5 desktop CPU [~3.5 years of age].
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Alexandru Ardelean
bf80d5ad0e
json_object: implement json_object_deep_copy()
Because doing `json_tokener_parse(json_object_get_string(src))`
feels sloppy, dirty, and makes me want to cry at night
sometimes.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Eric Haszlakiewicz
91662a5b69
Merge pull request #363 from jvijtiuk/integer_addition
Issue #338 , add json_object_add_int functions
7 years ago
Eric Haszlakiewicz
9c9529f798
Update test_parse.expected to match the code.
7 years ago
Eric Haszlakiewicz
f81da5e57a
Rewrite the json_tokener_state_inf handling in json_tokener to be simpler, and avoid needless copying of the input into a temporary buffer.
7 years ago
Eric Haszlakiewicz
31a6c2fac8
Add a few more tests to the partial parse to cover bytes after "Infinity".
7 years ago
Eric Haszlakiewicz
ba11d334db
Save proper expected output for test_parse from the previous commit.
7 years ago
Eric Haszlakiewicz
48f7e389fb
Fix parsing of "-Infinity" when the "-" and "Infinity" are split across multiple calls.
Add several additional test cases for partial parsing of infinity values.
7 years ago
Eric Haszlakiewicz
4d1e0b4409
Issue #371 : fix parsing of "-Infinity" (although in a somewhat different location than PR#372 used), and add a case to test_parse to check for this.
7 years ago
Eric Haszlakiewicz
2a22858fe7
Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity".
7 years ago
Eric Haszlakiewicz
b8738dd623
Rewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of duplicate boiler plate code.
Also, emit the input string in the output so it's easier to see what's going on.
7 years ago
Eric Haszlakiewicz
05c85ddc21
On VS 2013 and newer, actually use strtoll instead of redefining it to _strtoi64.
7 years ago
Eric Haszlakiewicz
04788421fe
Merge pull request #373 from commodo/fix-appveyor-build
build: fix build on appveyor CI
7 years ago
Eric Haszlakiewicz
49003242d1
Merge pull request #381 from busterb/fix-makedist
Fix makedist
7 years ago
Brent Cook
185f43afef
add/remove missing distribution files
7 years ago
Brent Cook
6727b46454
ignore more autoconf goo
7 years ago
Alexandru Ardelean
03f3b95248
json_util: define `strtoll` as _strtoi64 for MSVC
Got the idea from this blog post:
http://www.enchantedage.com/node/231
Simple & concise stuff :)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Alexandru Ardelean
5641227c9b
strerror_override: re-organize strerror_override.h
Always include <string.h> before _json_c_strerror() definition.
Should fix linker issues on MSVC.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Eric Haszlakiewicz
fabb84a785
Remove out of date win32 build information, and mention the need to use cmake there.
8 years ago
Eric Haszlakiewicz
e424af32b7
Fix definition of NELEM in the tests.
8 years ago
Eric Haszlakiewicz
ac09581cc2
Issue #370 : work around Clang-on-windows oddities by rearranging ifdefs.
8 years ago
Eric Haszlakiewicz
c9c84ca7ee
Issue #369 : note some useful settings when building for Android.
8 years ago
Eric Haszlakiewicz
cf913621f1
Use cmake to create the json-c.pc file, as suggested by PR#362.
8 years ago
Eric Haszlakiewicz
579f0746f0
Issue #173 , follow up to using strtoll to allow this to work on older Windows environments: Use cmake to generate config.h from config.h.win32, including checking for strtoll with cmake, or fall back to _strtoi64 for older MSVC's.
Also, add a few missing files to the list of sources to build.
8 years ago
Eric Haszlakiewicz
cfbdf7757b
The new cmake-generated VS builds now generate a dynamic .dll instead of a .lib
8 years ago
Eric Haszlakiewicz
139eb64b43
For appveyor builds, json_config.h is actually generated in the "include" directory.
8 years ago
Eric Haszlakiewicz
66a77d129a
Split the list of cmake headers into public and private ones, and only install the public ones.
8 years ago
Eric Haszlakiewicz
8899f3fbfb
Add a "cmake ." line to the appveyor build file to try to get it working again.
8 years ago
Juraj Vijtiuk
1110e84cce
Add json_object_add_int functions
8 years ago
Eric Haszlakiewicz
dc79d94c38
Merge pull request #361 from schwehr/int64
Fix double to int cast overflow in json_object_get_int64.
8 years ago
Kurt Schwehr
d9879c2533
Fix double to int cast overflow in json_object_get_int64.
Found with autofuzz in GDAL
8 years ago
Eric Haszlakiewicz
5454c4eaa3
Merge pull request #360 from jasonbking/master
Use strtoll() to parse ints
8 years ago
Eric Haszlakiewicz
4ac47a0219
Issue#353: attempt to fix or ignore a few -Wdocumentation messages from Clang.
8 years ago
Eric Haszlakiewicz
edde8eff9f
Issue#353: mark lh_abort as actually deprecated, not just in the docs.
8 years ago
Jason King
e3fabe9a44
Add long long 64-bit check
8 years ago
Jason King
5355d387e9
Use strtoll to parse ints
8 years ago
Eric Haszlakiewicz
e1561ed1df
Remove the Visual Studio project files as they were out of date, and should now be generated by using cmake.
8 years ago
Eric Haszlakiewicz
7e608c5728
Issue #359 : Use consistent spacing in CMakeLists.txt
8 years ago
Eric Haszlakiewicz
32f503f738
Issue #359 : Don't duplicate lh_get_hash, just omit the "inline" for VS2010.
8 years ago
Eric Haszlakiewicz
d58693b0f0
Merge pull request #359 from Haffon/api-0.12
update CMakeLists.txt for compile with visual studio at least 2010
8 years ago
Haffon
837a249f01
set JSON_C_HEADERS full file name
8 years ago
Haffon
e9f9f14f22
if compile with vs2015, enable the "static inline" declare.
8 years ago
Haffon
b301f4ea01
rollback api to 0.12
8 years ago
Haffon
86a3a6475f
Merge pull request #2 from json-c/master
merge upstream
8 years ago
Eric Haszlakiewicz
548d000891
Undo a bit of 2d1da5ab: handle per-thread formats for double serialization, even if --enable-threading wasn't specified.
8 years ago
Eric Haszlakiewicz
b2afca4560
Issue #173 : since some sscanf implementations return 0 for non-zero inputs, directly check for "0" in the input.
8 years ago
Eric Haszlakiewicz
2d1da5ab13
Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified.
8 years ago
Eric Haszlakiewicz
8777c9477a
Use AC_CONFIG_MACRO_DIRS to specify path to the ax macros instead of passing -I to autoreconf in autogen.sh.
8 years ago
Eric Haszlakiewicz
5b11e9adff
Explicitly check for GCC's atomic functions instead of depending on the __GNUC__ define.
Add a comment mentioning the limitation even though the _ref_count value is hanled atomically.
8 years ago
Eric Haszlakiewicz
ab0d4dbc69
Merge branch 'pull-211'
This is EmielBruijntes' "Atomic updates for the refcount"
8 years ago