Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Apply gcc's "const" attribute to the json_c_object_sizeof() function as an ↵ | Eric Haszlakiewicz | 2017-12-12 | 1 | -1/+1 | |
| | | | | optimizer hint. Also, rename that function from json_object_sizeof(). | |||||
* | json_object: Add size_t json_object_sizeof() | Björn Esser | 2017-12-11 | 1 | -0/+5 | |
| | ||||||
* | Make sure to include the "*" on function pointer arguments to avoid a ↵ | Eric Haszlakiewicz | 2017-12-04 | 1 | -1/+1 | |
| | | | | warnings from VS2015. See also PR#384. | |||||
* | Update json_object.c | ssrlive | 2017-12-04 | 1 | -2/+2 | |
| | ||||||
* | In json_object_deep_copy(), copy over _userdata, at least for ↵ | Eric Haszlakiewicz | 2017-11-29 | 1 | -59/+122 | |
| | | | | json_type_string's with the default serializer set, and provide a way for people using custom serializers to provide a custom shallow_copy method. | |||||
* | Rename _set_last_err() to _json_c_set_last_err(). | Eric Haszlakiewicz | 2017-11-29 | 1 | -2/+2 | |
| | ||||||
* | Merge branch 'json_deep_copy' of https://github.com/commodo/json-c into ↵ | Eric Haszlakiewicz | 2017-11-29 | 1 | -0/+103 | |
|\ | | | | | | | commodo-json_deep_copy | |||||
| * | json_object: implement json_object_deep_copy() | Alexandru Ardelean | 2017-11-27 | 1 | -0/+103 | |
| | | | | | | | | | | | | | | | | 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> | |||||
* | | Rename json_object_add_int() to json_object_int_inc() and eliminate the ↵ | Eric Haszlakiewicz | 2017-11-27 | 1 | -15/+1 | |
|/ | | | | "int64" variant since we store 64-bit values internally anyway. | |||||
* | Add json_object_add_int functions | Juraj Vijtiuk | 2017-09-14 | 1 | -0/+26 | |
| | ||||||
* | Fix double to int cast overflow in json_object_get_int64. | Kurt Schwehr | 2017-09-11 | 1 | -0/+4 | |
| | | | | Found with autofuzz in GDAL | |||||
* | Add long long 64-bit check | Jason King | 2017-09-08 | 1 | -0/+4 | |
| | ||||||
* | rollback api to 0.12 | Haffon | 2017-09-07 | 1 | -7/+7 | |
| | ||||||
* | Merge pull request #2 from json-c/master | Haffon | 2017-09-07 | 1 | -18/+30 | |
|\ | | | | | merge upstream | |||||
| * | Undo a bit of 2d1da5ab: handle per-thread formats for double serialization, ↵ | Eric Haszlakiewicz | 2017-09-05 | 1 | -4/+4 | |
| | | | | | | | | even if --enable-threading wasn't specified. | |||||
| * | Add a --enable-threading configure option, and only use the (slower) ↵ | Eric Haszlakiewicz | 2017-09-03 | 1 | -6/+6 | |
| | | | | | | | | __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified. | |||||
| * | Explicitly check for GCC's atomic functions instead of depending on the ↵ | Eric Haszlakiewicz | 2017-09-02 | 1 | -2/+8 | |
| | | | | | | | | | | | | __GNUC__ define. Add a comment mentioning the limitation even though the _ref_count value is hanled atomically. | |||||
| * | Merge branch 'pull-211' | Eric Haszlakiewicz | 2017-09-02 | 1 | -14/+20 | |
| |\ | | | | | | | | | | This is EmielBruijntes' "Atomic updates for the refcount" | |||||
| | * | subtract first, then retrieve value | Emiel Bruijntjes | 2015-11-28 | 1 | -1/+1 | |
| | | | ||||||
| | * | added tabs instead of spaces to be compatible with rest of code | Emiel Bruijntjes | 2015-11-27 | 1 | -8/+8 | |
| | | | ||||||
| | * | update indentation | Emiel Bruijntjes | 2015-11-27 | 1 | -0/+2 | |
| | | | ||||||
| | * | reference increment and decrement is now atomic (when using a GCC compatible ↵ | Emiel Bruijntjes | 2015-11-27 | 1 | -14/+18 | |
| | | | | | | | | | | | | compiler), which allows passing json objects between threads | |||||
* | | | Merge pull request #1 from json-c/master | Haffon | 2017-08-30 | 1 | -7/+5 | |
|\ \ \ | |/ / | | | | want to merge the original repository | |||||
| * | | PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the ↵ | Eric Haszlakiewicz | 2017-08-25 | 1 | -7/+1 | |
| | | | | | | | | | | | | string is terminated. | |||||
| * | | Clamp double to int32 when narrowing in json_object_get_int. | Kurt Schwehr | 2017-08-08 | 1 | -0/+4 | |
| | | | | | | | | | | | | Avoids undefined behavior. Found by autofuzz. | |||||
* | | | 1.make it can been compiled with Visual Studio 2010 | Haffon | 2017-08-22 | 1 | -12/+15 | |
|/ / | | | | | | | | | 2.replace json_object_get/put API with json_object_retain/release, as they operate the reference counter, and confused with array_list_get/put_idx. 3.replace array_list_get/put_idx API with array_list_get/insert to make them more clear to use. | |||||
* | | build: make `strerror()` override-able | Alexandru Ardelean | 2017-07-13 | 1 | -1/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to override `strerror()` in libjson-c to make tests consistent across platforms, we need to do it build-wide as configure/build option. Apple linkers make it really hard to override functions at link-time, and this seems to be locked down on travis-ci.org [ for security reasons I assume ]. While I got it to work locally, it did not work when running on travis. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> | |||||
* | | Move a variable declaration to the start of the block to work better with ↵ | Eric Haszlakiewicz | 2017-07-09 | 1 | -1/+1 | |
| | | | | | | | | older compilers. | |||||
* | | Add extra casts to void * to squash some warning on certain systems (e.g. ↵ | Eric Haszlakiewicz | 2017-07-09 | 1 | -3/+3 | |
| | | | | | | | | CentOS w/ gcc 4.1.2). | |||||
* | | Fix bad usage of strncat introduces in 1a94c70. Pointed out by @rouault in ↵ | Eric Haszlakiewicz | 2017-07-09 | 1 | -4/+3 | |
| | | | | | | | | PR #331. | |||||
* | | Eliminate static qualifiers on a couple local variables that were causing ↵ | Eric Haszlakiewicz | 2017-07-09 | 1 | -2/+2 | |
| | | | | | | | | thread safety issues. Suggested by @rouault in PR #331. | |||||
* | | Reformat json_object_double_to_json_string_format() to have consistent spacing. | Eric Haszlakiewicz | 2017-07-08 | 1 | -30/+34 | |
| | | ||||||
* | | Add a json_c_set_serialization_double_format() function to set the ↵ | Eric Haszlakiewicz | 2017-06-18 | 1 | -9/+76 | |
| | | | | | | | | *library-wide* format for how doubles are written to a serialized JSON output. | |||||
* | | Fix stack buffer overflow in json_object_double_to_json_string_format() | Even Rouault | 2017-05-18 | 1 | -0/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue originally found in the json-c 0.11 internal copy in GDAL but also found in latest git version. If doing things like json_object* obj = json_object_new_double(1e300); json_object_set_serializer(obj, json_object_double_to_json_string, "%f", NULL); json_object_to_json_string(obj) size = snprintf(buf, sizeof(buf), format ? format : (modf(jso->o.c_double, &dummy) == 0) ? "%.17g.0" : "%.17g", jso->o.c_double); will return a value greater than 128 since at least 300 characters are needed. This value is then passed to printbuf_memappend(pb, buf, size); that tries to read size bytes in buf. So we should clamp size to sizeof(buf). And on Windows, _snprintf() returns -1 in that situation, so deal also with this case. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1682 Credit to OSS-Fuzz | |||||
* | | Fix error C3688 when compiling on Visual Studio 2015: invalid literal suffix ↵ | Jason Li | 2017-03-24 | 1 | -1/+1 | |
| | | | | | | | | 'PRId64'; literal operator or literal operator template 'operator ""PRId64' not found | |||||
* | | Add FALLTHRU comment to handle GCC7 warnings. | marxin | 2017-03-21 | 1 | -0/+1 | |
| | | ||||||
* | | Restore sprintbuf(), add macro for string literals | Quentin Young | 2017-02-04 | 1 | -31/+30 | |
| | | | | | | | | | | | | | | | | | | | | Hawciz pointed out that the previous commit modifies the public interface of printbuf. Per his suggestion, sprintbuf() was restored and a new pair of macros was added that wraps printbuf_memappend(). Using a wrapper macro instead of modifying sprintbuf() also reduces function call overhead, bringing total performance gains to approximately 400%. | |||||
* | | Improve json_object -> string performance | Quentin Young | 2017-02-02 | 1 | -4/+11 | |
| | | | | | | | | Removes variadic prints for ~3x performance improvement. | |||||
* | | bugfix: floating point representaion without fractional part | Jan Gerhards | 2016-11-27 | 1 | -1/+4 | |
| | | | | | | | | closes https://github.com/json-c/json-c/issues/278 | |||||
* | | strdup_compat.h: re-spin this compat header ; use math_compat.h as template | Alexandru Ardelean | 2016-11-22 | 1 | -7/+1 | |
| | | | | | | | | Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> | |||||
* | | Revert "compat/strdup.h: move common compat check for strdup() to own file" | Emmanuele Bassi | 2016-11-07 | 1 | -1/+7 | |
| | | | | | | | | | | | | | | | | | | | | This reverts commit aaba8c1080533133329086e47f4f45981dfdd1ee. This commit breaks builddir != srcdir build, but, more importantly, it also adds a dependency on a header, "config.h", which is not installed and it's supposed to be private — since it's generated at configuration time and it's not meant to be used by projects compiling against a library. | |||||
* | | compat/strdup.h: move common compat check for strdup() to own file | Alexandru Ardelean | 2016-11-03 | 1 | -7/+1 | |
| | | | | | | | | Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> | |||||
* | | Handle NULL objects in json_object_get_userdata() by returning NULL, but ↵ | Eric Haszlakiewicz | 2016-10-29 | 1 | -1/+4 | |
| | | | | | | | | abort in json_object_set_userdata() since we can't actually do anything with the userdata. | |||||
* | | Issue #280: add a few assert() calls to ensure objects are of the ↵ | Eric Haszlakiewicz | 2016-10-29 | 1 | -4/+19 | |
| | | | | | | | | appropriate type. | |||||
* | | Merge pull request #277 from ALLTERCO/json_object_set_xxx | Eric Haszlakiewicz | 2016-10-08 | 1 | -1/+49 | |
|\ \ | | | | | | | Json object set xxx | |||||
| * | | try restore windows automated builds | Stoian Ivanov | 2016-10-07 | 1 | -1/+1 | |
| | | | ||||||
| * | | fix compiler warning for int sizes | Stoian Ivanov | 2016-10-07 | 1 | -1/+1 | |
| | | | ||||||
| * | | string set and tests | Stoian Ivanov | 2016-10-07 | 1 | -0/+21 | |
| | | | ||||||
| * | | some basic set | Stoian Ivanov | 2016-10-05 | 1 | -3/+23 | |
| | | | ||||||
| * | | json_object_set_boolean for upstream style check | Stoian Ivanov | 2016-09-21 | 1 | -0/+7 | |
| | | |