Eric Haszlakiewicz
c4cc673071
More fixes for old MSVC builds.
5 years ago
Eric Haszlakiewicz
0a16b23adf
Fix typo in previous commit to check for SSIZE_T on MSVC.
5 years ago
Eric Haszlakiewicz
eab1375123
Change CMakeLists.txt to look for SSIZE_T on MSVC too.
5 years ago
Eric Haszlakiewicz
b0466b626b
On MSVC, add a ssize_t typedef using SSIZE_T from BaseTsd.h
5 years ago
Eric Haszlakiewicz
0fc9d91277
Kick json_type_string out of struct json_object.
The default is now that string data is stored inline at the end of json_object, though to allow for json_object_set_string() to set a _longer_ string, we still need to allow for the possibility of a separate char * pointer.
All json types have been split out now, next step it cleanup.
5 years ago
Eric Haszlakiewicz
9ecb1222bd
Kick json_type_int and json_type_double out of struct json_object.
Clean up the code in json_object_new_* a bit by dropping unnecesary json_object_base variables.
5 years ago
Eric Haszlakiewicz
0351bb55c8
Declare variables earlier, to appease Visual Studio 2010.
5 years ago
Eric Haszlakiewicz
d1f83bf5ea
Kick json_type_boolean out of struct json_object.
5 years ago
Eric Haszlakiewicz
5d89fc8a9d
Add some backwards compat for Visual Studio 2013.
5 years ago
Eric Haszlakiewicz
02b687b9a6
Kick json_type_array out of struct json_object; re-enable the test_deep_copy test.
5 years ago
Eric Haszlakiewicz
853b4b5dee
Start splitting struct json_object into multiple sub-types, as descibed at https://github.com/json-c/json-c/wiki/Proposal:-struct-json_object-split
The current changes split out _only_ json_type_object, and thus have a number of hacks
to allow the code to continue to build and work.
Originally mentioned in issue #535 .
When complete, this will probably invalidate #552 .
This is likely to cause notable conflicts in any other significant un-merged
changes, such as PR#620.
5 years ago
Eric Haszlakiewicz
4a546e7b2f
In arraylist, use malloc instead of calloc, avoid clearing with memeset until we really need to, and micro-optimize array_list_add().
5 years ago
Eric Hawicz
fbe1543644
Merge pull request #622 from besser82/topic/besser82/doc_subdir
doc: Move Doxyfile into doc subdir.
5 years ago
Björn Esser
1e94da779a
CMake: Fix grammar: written -> wrote.
5 years ago
Björn Esser
61e2bae511
doc: Move Doxyfile into doc subdir
5 years ago
Eric Haszlakiewicz
fa6a7dccb9
With the change in cc80203, Doxyfile no longer needs to be updated for a release.
5 years ago
Eric Hawicz
cc802039a8
Merge pull request #619 from besser82/topic/besser82/doxygen_oot
CMake: Fix out-of-tree build for Doxygen documentation.
5 years ago
Eric Hawicz
12b2e1159d
Merge pull request #618 from besser82/topic/besser82/test_deep_copy
test_deep_copy: Fix assertion value.
5 years ago
Björn Esser
8f3592b3d5
CMake: Fix out-of-tree build for Doxygen documentation.
5 years ago
Björn Esser
3008401b2a
test_deep_copy: Fix assertion value.
5 years ago
Eric Hawicz
a8a0590921
Merge pull request #617 from besser82/topic/besser82/option_disable_tls
Add an option to disable the use of thread-local storage.
5 years ago
Björn Esser
a85d2395ff
README: Update configuration options for CMake.
5 years ago
Björn Esser
76dd99abb2
CMake: Re-format config-option block and re-order it alphabetically.
5 years ago
Björn Esser
78642dcb9b
CMake: Add an option to disable the use of thread-local storage.
Using thread-local storage may not be desired in all environments
and/or use-cases, thus there should be an option to disable its use
on purpose.
Fixes #451 .
5 years ago
Björn Esser
dd040ba446
tests: Fix test_double_serializer without thread-local storage.
5 years ago
Eric Hawicz
5b15c7567d
Merge pull request #614 from stoeckmann/format
Prevent truncation on custom double formatters.
5 years ago
Eric Hawicz
311c5e5b2b
Update issue templates
5 years ago
Tobias Stoeckmann
5385a566db
Prevent truncation on custom double formatters.
A custom double formatter can lead to truncation of the rest of the
JSON document.
If a custom formatter completely fills the buffer used by snprintf
with a trailing dot or comma and the formatting option
JSON_C_TO_STRING_NOZERO has been specified, then an iterator moves
past the ending '\0' (off-by-one buffer overflow) to set an
additional '\0' and adds the first '\0' into the printbuf.
Since '\0' will eventually be considered the terminating character
of the complete printbuf result, all trailing characters are lost.
This leads to an incomplete JSON string as can be seen with the
test case.
The off-by-one can be noticed if compiled with address sanitizer.
Since this is a very special case and a malformed formatter could
do way more harm and is the responsibility of the user of this
library, this is just a protective measure to keep json-c code as
robust as possible.
5 years ago
Eric Haszlakiewicz
0a3d22b9bb
Revert part of PR#606 and use isnan/isinf again, but provide macro implementations of those in math_compat.h is needed, as it seems to be on AIX and IBM i systems.
5 years ago
Eric Hawicz
1526c84a13
Merge pull request #606 from davidjmccann/master
Improved support for IBM operating systems
5 years ago
David McCann
add7b13a9a
Improved support for IBM operating systems
Fix compiler errors and warnings when building on IBM operating systems such as AIX and IBM i.
5 years ago
Eric Haszlakiewicz
d414d3eabc
Issue #604 : add check for __MINGW32__ in snprintf_compat.h
5 years ago
Eric Haszlakiewicz
2e71fe0963
Display a bit of info about what exactly we're benchmarking.
5 years ago
Eric Haszlakiewicz
199c52e2db
Ignore the bench/work and bench/data directories.
5 years ago
Eric Hawicz
3648c3ed2c
Merge pull request #602 from ploxiln/parse_uint64_errno
fix json_parse_uint64() usage of errno
5 years ago
Pierce Lopez
003b58782b
fix json_parse_uint64() usage of errno
introduced in #542
fixes #601
5 years ago
Eric Haszlakiewicz
26f080997d
Fix snprintf on windows problem for test4.
5 years ago
Eric Haszlakiewicz
06742d6277
Issue #600 : don't rename the static library on Windows, it _needs_ to have a different name because the dll build also creates a "json-c.lib" file.
5 years ago
Eric Haszlakiewicz
a59d5acfab
Re-format after recent change to fix linkhash.
5 years ago
Eric Haszlakiewicz
4f43a077a4
Issue #598 : avoid building static libraries twice.
5 years ago
Eric Haszlakiewicz
519dfe1591
Issue #599 : Fix the backwards check in lh_table_insert_w_hash() that was preventing adding more than 11 objects.
Add a test to check for this too.
5 years ago
Eric Hawicz
45b6416652
Merge branch 'master' of https://github.com/json-c/json-c
5 years ago
Eric Hawicz
abc9a0731b
Merge pull request #597 from ploxiln/json_parse_usage
json_parse demo: fix and use usage() function
5 years ago
Pierce Lopez
090ae4e4d4
json_parse demo: fix and use usage() function
5 years ago
Eric Hawicz
22870ac2bd
Merge pull request #595 from dota17/static_shared
Support to build both static and shared libraries
5 years ago
hofnarr
a100573eec
cmake-configure: fix enable-static option
5 years ago
hofnarr
558ef8609c
cmake: change variable name
5 years ago
hofnarr
929d74512a
cmake: add list for build targets
5 years ago
dota17
e97fc20bfd
update
5 years ago
Eric Hawicz
31243e4d12
Merge pull request #592 from stoeckmann/oob
Prevent out of boundary write on malicious input
5 years ago