]>
granicus.if.org Git - json-c/log
Eric Haszlakiewicz [Sat, 4 Feb 2017 16:13:14 +0000 (11:13 -0500)]
Merge pull request #299 from qlyoung/perf-improvements
Improve json_object -> string performance
Quentin Young [Fri, 3 Feb 2017 21:43:59 +0000 (21:43 +0000)]
Restore sprintbuf(), add macro for string literals
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%.
Eric Haszlakiewicz [Fri, 3 Feb 2017 17:10:27 +0000 (17:10 +0000)]
Use strdup instead of strndup in test1.c, there's no need for the latter because json_object_to_json_string_length() will always return a properly sized string.
Quentin Young [Thu, 2 Feb 2017 17:16:26 +0000 (17:16 +0000)]
Improve json_object -> string performance
Removes variadic prints for ~3x performance improvement.
Eric Haszlakiewicz [Sun, 8 Jan 2017 03:55:31 +0000 (22:55 -0500)]
Issue #295: also check if size_t is the size of long long, to help support 64-bit Windows platforms.
Eric Haszlakiewicz [Sun, 18 Dec 2016 19:35:06 +0000 (14:35 -0500)]
Ignore tests/test_float
Eric Haszlakiewicz [Sun, 18 Dec 2016 19:33:41 +0000 (14:33 -0500)]
Change a memcpy that should be a memmove within json_pointer_get, and fix memory leaks in of one the json_pointer tests.
Eric Haszlakiewicz [Tue, 13 Dec 2016 04:01:20 +0000 (23:01 -0500)]
Note some minimum versions needed for autoconf, etc...
Eric Haszlakiewicz [Mon, 12 Dec 2016 03:18:33 +0000 (19:18 -0800)]
Issue#292: bump the required version of configure listed in configure.ac so a more useful error message is generated, rather than failing later because the extra macros from ./autoconf-archive/m4/ didn't get loaded.
Eric Haszlakiewicz [Mon, 5 Dec 2016 01:52:33 +0000 (20:52 -0500)]
Merge pull request #289 from jgerhards/i-278
bugfix: floating point representaion without fractional part
Jan Gerhards [Sun, 27 Nov 2016 10:50:48 +0000 (11:50 +0100)]
testbench: add test for floating point representation
Jan Gerhards [Sun, 27 Nov 2016 10:47:00 +0000 (11:47 +0100)]
bugfix: floating point representaion without fractional part
closes https://github.com/json-c/json-c/issues/278
Eric Haszlakiewicz [Thu, 24 Nov 2016 20:03:50 +0000 (15:03 -0500)]
Merge pull request #287 from commodo/json_pointer_va_args
json_pointer: extend setter & getter with printf() style arguments
Alexandru Ardelean [Wed, 16 Nov 2016 15:04:41 +0000 (17:04 +0200)]
vasprintf_compat.h: spin-off this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Wed, 16 Nov 2016 15:00:45 +0000 (17:00 +0200)]
strdup_compat.h: re-spin this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Wed, 16 Nov 2016 14:22:13 +0000 (16:22 +0200)]
test_json_pointer: update test with a few printf variants
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Wed, 16 Nov 2016 09:55:41 +0000 (11:55 +0200)]
json_pointer: add json_pointer_getf/setf() function variants
These include support for printf() style args for path.
Adds support for calling with 'json_pointer_getf(obj, &res, "/foo/%d/%s", 0, bar)'
style args.
Makes it easier for doing more dynamic stuff/magic, without
needing to use vasprintf() externally.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Wed, 16 Nov 2016 09:34:29 +0000 (11:34 +0200)]
json_pointer.c: fix whitespace
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Eric Haszlakiewicz [Wed, 9 Nov 2016 14:56:58 +0000 (09:56 -0500)]
Merge pull request #285 from ebassi/revert-strdup-compat
Revert "compat/strdup.h: move common compat check for strdup() to own…
Emmanuele Bassi [Mon, 7 Nov 2016 20:51:11 +0000 (20:51 +0000)]
Revert "compat/strdup.h: move common compat check for strdup() to own file"
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.
Eric Haszlakiewicz [Fri, 4 Nov 2016 15:48:30 +0000 (11:48 -0400)]
Merge pull request #283 from commodo/json_pointer
json_pointer: add first revision based on RFC 6901
Alexandru Ardelean [Tue, 1 Nov 2016 16:07:03 +0000 (18:07 +0200)]
tests: add test_json_pointer test
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Tue, 1 Nov 2016 15:49:28 +0000 (17:49 +0200)]
tests/strerror_override.c: fix compilation error
I got this on Mac OS X at least.
Not sure if it shows up in other envs
error:
```
strerror_override.c:53:13: error: incompatible redeclaration of library function 'strerror' [-Werror,-Wincompatible-library-redeclaration]
const char *strerror(int errno_in)
```
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Tue, 25 Oct 2016 14:39:16 +0000 (17:39 +0300)]
json_pointer: add first revision
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean [Wed, 26 Oct 2016 07:37:50 +0000 (10:37 +0300)]
compat/strdup.h: move common compat check for strdup() to own file
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Eric Haszlakiewicz [Sat, 29 Oct 2016 19:42:36 +0000 (15:42 -0400)]
Handle NULL objects in json_object_get_userdata() by returning NULL, but abort in json_object_set_userdata() since we can't actually do anything with the userdata.
Eric Haszlakiewicz [Sat, 29 Oct 2016 19:31:31 +0000 (15:31 -0400)]
Issue #280: add a few assert() calls to ensure objects are of the appropriate type.
Eric Haszlakiewicz [Sat, 29 Oct 2016 19:13:16 +0000 (15:13 -0400)]
Use json_visit() to clear the serializer data set when parsing so the output from test_parse reflects the actual values parsed.
Eric Haszlakiewicz [Sat, 29 Oct 2016 19:01:20 +0000 (15:01 -0400)]
Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects.
Eric Haszlakiewicz [Mon, 10 Oct 2016 04:13:39 +0000 (00:13 -0400)]
Fix broken key-order test in test_compare.
Eric Haszlakiewicz [Sat, 8 Oct 2016 17:13:33 +0000 (13:13 -0400)]
Merge pull request #272 from sgerbino/master
Allows for compilation with CMake on macOS
Eric Haszlakiewicz [Sat, 8 Oct 2016 16:08:53 +0000 (12:08 -0400)]
Merge pull request #277 from ALLTERCO/json_object_set_xxx
Json object set xxx
Stoian Ivanov [Fri, 7 Oct 2016 19:54:06 +0000 (22:54 +0300)]
try restore windows automated builds
Stoian Ivanov [Thu, 6 Oct 2016 22:07:34 +0000 (01:07 +0300)]
fix compiler warning for int sizes
Stoian Ivanov [Thu, 6 Oct 2016 21:51:24 +0000 (00:51 +0300)]
string set and tests
Stoian Ivanov [Thu, 6 Oct 2016 20:32:19 +0000 (23:32 +0300)]
gitignore test; add double value set checks in test
Stoian Ivanov [Thu, 6 Oct 2016 20:16:29 +0000 (23:16 +0300)]
some simple tests
Eric Haszlakiewicz [Thu, 6 Oct 2016 03:15:51 +0000 (23:15 -0400)]
Issue #275: fix out of bounds read when handling unicode surrogate pairs.
Stoian Ivanov [Wed, 5 Oct 2016 20:55:46 +0000 (23:55 +0300)]
some basic set
Eric Haszlakiewicz [Wed, 28 Sep 2016 12:08:01 +0000 (08:08 -0400)]
Merge pull request #273 from konoal/master
fixed wrong object name in json_object_all_values_equal
Eric Haszlakiewicz [Wed, 28 Sep 2016 12:05:50 +0000 (08:05 -0400)]
Merge pull request #274 from pepevel/master
Support for 64 bit pointers on Windows
pepevel [Tue, 27 Sep 2016 19:12:03 +0000 (20:12 +0100)]
Support for 64 bit pointers on Windows
Alexey Konovalov [Tue, 27 Sep 2016 08:20:49 +0000 (11:20 +0300)]
fixed wrong object name in json_object_all_values_equal
Steve Gerbino [Mon, 26 Sep 2016 04:19:46 +0000 (00:19 -0400)]
Changed CMake variables and adding output for debugging
Steve Gerbino [Mon, 26 Sep 2016 04:09:55 +0000 (00:09 -0400)]
Target C99 standards to get rid of warnings
Steve Gerbino [Mon, 26 Sep 2016 03:08:39 +0000 (23:08 -0400)]
Modified the execute_process commands
Steve Gerbino [Mon, 26 Sep 2016 02:32:35 +0000 (22:32 -0400)]
Changed PROJECT_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR to fix building when used as external project
Steve Gerbino [Mon, 26 Sep 2016 02:03:56 +0000 (22:03 -0400)]
Modified CMakeLists.txt to use autotools to generate configuration for Unix systems
Steve Gerbino [Sun, 25 Sep 2016 22:49:34 +0000 (18:49 -0400)]
Lowered CMake required version so that Travis CI is able to build, moved include folder to include/json-c to match the behavior of autotools
Steve Gerbino [Sun, 25 Sep 2016 19:04:05 +0000 (15:04 -0400)]
Trailing slash seems necessary in the install command to get contents
Steve Gerbino [Sun, 25 Sep 2016 18:59:38 +0000 (14:59 -0400)]
Forget DESTINATION in CMake install command
Steve Gerbino [Sun, 25 Sep 2016 18:57:15 +0000 (14:57 -0400)]
We need to also install the generated configuration files
Steve Gerbino [Sun, 25 Sep 2016 18:46:33 +0000 (14:46 -0400)]
Fixed typo in CMakeList.txt FILES_MATCHING
Steve Gerbino [Sun, 25 Sep 2016 18:42:14 +0000 (14:42 -0400)]
Added install instructions for CMake
Steve Gerbino [Sun, 25 Sep 2016 06:14:57 +0000 (02:14 -0400)]
Resolves json-c/json-c#271 by adding MacOS configuration files and modifies CMakeLists.txt to use them
Stoian Ivanov [Tue, 20 Sep 2016 22:31:00 +0000 (01:31 +0300)]
json_object_set_boolean for upstream style check
Eric Haszlakiewicz [Mon, 12 Sep 2016 22:19:26 +0000 (18:19 -0400)]
Merge pull request #267 from sixlettervariables/patch-1
Removes me as Win32 maintainer, because I'm not.
Christopher Watford [Mon, 12 Sep 2016 18:18:21 +0000 (14:18 -0400)]
Removes me as a maintainer, because I'm not.
Updates README-WIN32.html to remove my status as a maintainer (I'm not). Also removes ancient porting notes and adds a reference to json_config.h.win32 which is where most folks should go to start with Windows issues.
Eric Haszlakiewicz [Thu, 25 Aug 2016 03:41:22 +0000 (23:41 -0400)]
Issue #263: add const so the prototype for json_object_object_add_ex() matches the definition.
Randy Armstrong [Wed, 24 Aug 2016 07:16:13 +0000 (00:16 -0700)]
Add Cmakefile
Eric Haszlakiewicz [Sun, 21 Aug 2016 03:06:22 +0000 (23:06 -0400)]
Fix memory leak and inconsistent output (due to varying fd numbers) in test_util_file.
Eric Haszlakiewicz [Sun, 21 Aug 2016 02:41:49 +0000 (22:41 -0400)]
Issue #260: add a check to prevent trivial loops in the object tree, even though it is up to the callers to avoid doing so in more complex cases.
Eric Haszlakiewicz [Sun, 21 Aug 2016 02:35:29 +0000 (22:35 -0400)]
json_object_object_add_ex() should have shared code with json_object_object_add(), and been changed to return int at the same time the latter was. Do that now.
Also correct a couple of calls to _to_json_string to check the return value.
Eric Haszlakiewicz [Sat, 13 Aug 2016 13:17:25 +0000 (09:17 -0400)]
Merge branch 'RyDroid-tests'
Eric Haszlakiewicz [Sat, 13 Aug 2016 13:17:01 +0000 (09:17 -0400)]
Merge branch 'tests' of https://github.com/RyDroid/json-c into RyDroid-tests
Conflicts:
tests/test_util_file.c
Eric Haszlakiewicz [Sat, 13 Aug 2016 12:31:57 +0000 (08:31 -0400)]
Merge pull request #251 from RyDroid/editorconfig
Adding a file for EditorConfig
Nicola Spanti (RyDroid) [Mon, 8 Aug 2016 13:11:19 +0000 (15:11 +0200)]
Very minor changes to some tests
Nicola Spanti (RyDroid) [Sun, 7 Aug 2016 16:20:59 +0000 (18:20 +0200)]
Adding a file for EditorConfig
Eric Haszlakiewicz [Thu, 11 Aug 2016 21:03:16 +0000 (17:03 -0400)]
Revert bogus change to json_object_get() made in
f40b08d8 that caused it to always return NULL. (Issue #259)
Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi
try to set flags on a NULL pointer, and doing so should not be silently
ignored.
Eric Haszlakiewicz [Wed, 10 Aug 2016 19:06:30 +0000 (15:06 -0400)]
Merge pull request #255 from RyDroid/minor-c2
Minor changes in C source code
Eric Haszlakiewicz [Tue, 9 Aug 2016 11:39:27 +0000 (07:39 -0400)]
Merge pull request #252 from RyDroid/minor-no-c
Very minor changes not related to C source code
Eric Haszlakiewicz [Tue, 9 Aug 2016 11:38:18 +0000 (07:38 -0400)]
Merge branch 'jobol-issue-165'
Eric Haszlakiewicz [Tue, 9 Aug 2016 11:36:54 +0000 (07:36 -0400)]
Merge branch 'issue-165' of https://github.com/jobol/json-c into jobol-issue-165
Conflicts:
tests/test_util_file.c
Eric Haszlakiewicz [Tue, 9 Aug 2016 02:57:56 +0000 (22:57 -0400)]
Merge pull request #253 from RyDroid/cppcheck-travis
Adding a test with cppcheck for Travis CI
Eric Haszlakiewicz [Tue, 9 Aug 2016 02:53:33 +0000 (22:53 -0400)]
Merge pull request #249 from RyDroid/readme
Improving README
Eric Haszlakiewicz [Tue, 9 Aug 2016 02:50:23 +0000 (22:50 -0400)]
Add a brief style guide. Address Issue #257.
Eric Haszlakiewicz [Mon, 8 Aug 2016 18:42:01 +0000 (18:42 +0000)]
Merge pull request #250 from RyDroid/gitignore
Improving .gitignore
Nicola Spanti (RyDroid) [Sun, 7 Aug 2016 16:24:53 +0000 (18:24 +0200)]
Improving .gitignore
Nicola Spanti (RyDroid) [Sun, 7 Aug 2016 16:29:11 +0000 (18:29 +0200)]
Improving README
Nicola Spanti (RyDroid) [Mon, 8 Aug 2016 13:23:27 +0000 (15:23 +0200)]
Adding a test with cppcheck for Travis CI
Nicola Spanti (RyDroid) [Mon, 8 Aug 2016 13:20:41 +0000 (15:20 +0200)]
Minor changes in C source code
Nicola Spanti (RyDroid) [Mon, 8 Aug 2016 13:12:44 +0000 (15:12 +0200)]
Very minor changes not related to C source code
Eric Haszlakiewicz [Wed, 3 Aug 2016 02:25:05 +0000 (22:25 -0400)]
Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h
José Bollo [Mon, 1 Aug 2016 13:04:54 +0000 (15:04 +0200)]
test: add test of 'json_object_to_json_string_length'
The test is implied in test1.
The idea is to check that the returned lengths and strings
are identical to what is expected to return the already
tested function 'json_object_to_json_string_ext'.
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Eric Haszlakiewicz [Sun, 31 Jul 2016 18:39:56 +0000 (14:39 -0400)]
Issue #195: Actually call uselocale() in the new locale handling code in json_tokener.
Also, be sure the right locale_t is freed if we fail on the second uselocale.
Finally, fix test_locale so it *doesn't* use json_object_to_json_string as
that will simple re-emit the original parsed string values.
Eric Haszlakiewicz [Sun, 31 Jul 2016 01:34:58 +0000 (21:34 -0400)]
Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments.
Eric Haszlakiewicz [Sat, 30 Jul 2016 19:09:51 +0000 (15:09 -0400)]
Linux's %p format doesn't return "0x0" for NULL pointers, so switch to using %lx for consistency.
Eric Haszlakiewicz [Sat, 30 Jul 2016 18:27:53 +0000 (18:27 +0000)]
Issue #240: add arbitrary use of val's in foreach loops to squash warnings about unused variables.
jobol [Tue, 26 Jul 2016 17:22:25 +0000 (19:22 +0200)]
Add method 'json_object_to_json_string_length'
This new method allows to also
get the length of the generated string.
Fix #165
Change-Id: Iea91404027f143ca3d29a4c58d7c07ae53556110
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
José Bollo [Wed, 27 Jul 2016 12:42:25 +0000 (14:42 +0200)]
Fix a compiling error
The function fstat isn't declared without this include
on debian strect/sid and Fedora-23
Change-Id: I660a32ff173dcba04674aed51ed855b4fa55ac67
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Eric Haszlakiewicz [Sat, 16 Jul 2016 17:49:08 +0000 (13:49 -0400)]
Merge pull request #239 from ploxiln/printbuf_empty
initialize null terminator of new printbuf
Pierce Lopez [Sat, 16 Jul 2016 04:30:31 +0000 (00:30 -0400)]
initialize null terminator of new printbuf
It's possible (e.g. by using json_object_from_file() on an empty file)
to get json-c to try to use a printbuf that has never had anything
written to it. Before this change, it could access a string that
should be length zero, but was never initialized, and could
theoretically have an unexpected string.
Eric Haszlakiewicz [Mon, 27 Jun 2016 04:29:07 +0000 (04:29 +0000)]
Fix absolute paths in test_util_file that vary depending on where it is run.
Eric Haszlakiewicz [Mon, 27 Jun 2016 04:28:34 +0000 (04:28 +0000)]
Issue #113: Add more files to EXTRA_DIST and a dist-hook to get distcheck to at least not fail.
Eric Haszlakiewicz [Mon, 27 Jun 2016 03:46:38 +0000 (03:46 +0000)]
Issue #113: add "new" files to appropriate variables in Makefile, and note the need to run "make distcheck" as part of the release process.
Fix issues with the test script so it works under distcheck too.
Eric Haszlakiewicz [Mon, 27 Jun 2016 03:09:42 +0000 (23:09 -0400)]
Merge pull request #238 from nagamalli9999/master
linkhash.c: optimised the table_free path
Eric Haszlakiewicz [Sun, 26 Jun 2016 02:20:05 +0000 (02:20 +0000)]
Issue #189: Eliminate use of MC_ERROR from json_util.c, and add a json_util_get_last_err() function to retrieve the error for those callers that care about it.
Add tests and descriptions for the functions in json_util.c
Eswar Yaganti [Sat, 25 Jun 2016 17:35:41 +0000 (23:05 +0530)]
linkhash.h: removed redundant params from comments
Eswar Yaganti [Sat, 25 Jun 2016 17:20:36 +0000 (22:50 +0530)]
linkhash.c: optimised the table_free path
Eric Haszlakiewicz [Sat, 11 Jun 2016 18:18:46 +0000 (18:18 +0000)]
Issue #236: Add -Wcast-qual and fix casts to retain constness.
To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.