Rainer Gerhards
1ae4b50bde
remove unneeded data items from hashtable code
...
These items were used for statistics tracking, but no code at all
exists to consume them. By removing them we save
a) space
because they counters required space, and did so in each and every
json object
b) performance
because calloc() needs to write less data and the counters are
no longer maintained; cache performance can be better, load
on OS main memory is lighter
We could conditionally enable/disable these counters, but I have not
done this they were really nowhere used and it looked more like a
left-over from the import of hashtable code.
2015-09-23 12:40:57 +02:00
Rainer Gerhards
8f8d03df46
add perllike hash function for strings
...
This also adds a new API json_global_set_string_hash() which permits
to select the hash function. The default one is the only one that was
previously present. So there are no changes to existing apps, and the
new hash function needs to be explicitely be opted in. Especially for
smaller strings, the perllike functions seems to be around twice as
fast as the other one, with similarly good results in value distribution.
2015-09-23 12:23:09 +02:00
Rainer Gerhards
2d549662be
add json_object_object_add_ex() API
...
This provides more control over some detail aspects, many
of which are performance related.
2015-09-23 09:43:00 +02:00
Rainer Gerhards
d8e44dc685
reduce duplicate hash computation in json_object_object_add()
...
This can be a very considerable performance saver.
2015-09-22 19:07:30 +02:00
Eric Haszlakiewicz
1757a31750
Fix doc for json_object_new_boolean() to indicate the correct value for TRUE (1).
2015-08-23 00:08:14 -04:00
Eric Haszlakiewicz
d4f8f92eb0
Squash deprecated function warning by replacing json_object_object_get calls with json_object_object_get_ex in test_cast.
2015-08-23 00:06:36 -04:00
Eric Haszlakiewicz
93b1fe63e5
Add back in the __attribute__((__unused__)) that was lost in the previous commit.
...
It's needed to squash a "variable 'val' set but not used" warning.
2015-08-23 00:00:12 -04:00
Eric Haszlakiewicz
a8bbefbbb4
Merge pull request #183 from cryogen/master
...
Apply compile warning fix to master branch
2015-08-22 15:24:26 -04:00
Eric Haszlakiewicz
55530bfc0f
Merge pull request #186 from Virtual-Instruments/master
...
Syntax error
2015-08-05 23:19:19 -04:00
Jacob Alexander
e8a302017f
Syntax error
...
- ./configure would fail due to bad code generation
2015-06-02 14:34:51 -07:00
Eric Haszlakiewicz
b594c34f57
Merge pull request #174 from haata/master
...
Adding JSON_C_TO_STRING_PRETTY_TAB flag
2015-05-31 12:10:13 -07:00
Jacob Alexander
92d4cf15f0
Adding JSON_C_TO_STRING_PRETTY_TAB flag
...
- Tabs are easier to read for tired eyes and editor adjustable
2015-05-27 17:37:39 -07:00
Eric Haszlakiewicz
cd8bd7f617
Tell the compiler we're intentionally ignoring the return value from __sync_val_compare_and_swap().
2015-05-26 19:02:19 -07:00
Stuart Walsh
75d7409c4e
Fix uninitialised variable compile warning, and also fix unused-when-used warning
2015-05-10 09:21:28 +01:00
Eric Haszlakiewicz
cbedf2f7ca
Merge pull request #149 from cicku/patch-2
...
SONAME bump
2015-05-09 21:35:22 -04:00
Eric Haszlakiewicz
e4fce5d6ae
Merge pull request #171 from Nzbuu/vs2010_build
...
Update configuration for VS2010 and win64
2015-05-08 21:31:37 -04:00
Eric Haszlakiewicz
e1eb298de1
Merge pull request #182 from tpetazzoni/libm-fix
...
Link against libm when needed
2015-05-08 21:19:48 -04:00
Eric Haszlakiewicz
82a1316f76
Merge pull request #180 from yegorich/silent
...
Enable silent build by default
2015-05-08 21:19:05 -04:00
Thomas Petazzoni
93582ad85e
Link against libm when needed
...
In certain C libraries (e.g uClibc), isnan() and related functions are
implemented in libm, so json-c needs to link against it. This commit
therefore adds an AC_TRY_LINK() test to check whether a program
calling isnan() can be properly linked with no special flags. If not,
we assume linking against libm is needed.
The json-c.pc.in file is also adjusted so that in the case of static
linking against json-c, -lm is also used.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com >
2015-05-01 13:01:17 +02:00
Yegor Yefremov
36b0169ed6
Enable silent build by default
2015-04-25 22:11:44 +02:00
Mark Swoope
cdca9d3c8e
Added array_list_del_idx and json_object_array_del_idx
2015-04-02 14:05:27 -07:00
James Myatt
736f4b3581
Build random_seed.c as well
2015-03-04 10:45:40 +00:00
James Myatt
9d3d8d6fc0
Add x64 build configurations
2015-03-04 10:45:40 +00:00
James Myatt
e1a3f33a26
Set CompileAsCpp flag (Required for vs2010/winsdk71)
...
Revert some project settings to defaults
2015-03-04 10:45:39 +00:00
James Myatt
d5baa0381f
Update VS project to include current source files
2015-03-04 10:45:38 +00:00
James Myatt
18b3c49296
Use more appropriate casts
2015-03-04 10:45:37 +00:00
James Myatt
bf32650c83
Add missing include file to random_seed
2015-03-04 10:45:37 +00:00
James Myatt
720d566d03
Define macros from inttypes.h when not available
2015-03-04 10:45:36 +00:00
James Myatt
9be71700eb
json_tokener requires INF and NAN
2015-03-04 10:45:35 +00:00
James Myatt
72310c87a5
Define INFINITY and NAN when missing
2015-03-04 10:45:34 +00:00
James Myatt
0137103f4b
Include config.h in linkhash so that HAVE_ENDIAN_H is defined (if available)
2015-03-04 10:45:33 +00:00
James Myatt
a74f6b2867
Updated config for vs2010/winsdk71 as well as vs2013
...
Define JSON_C_HAVE_INTTYPES_H in json_config.h.win32 only
2015-03-04 10:45:33 +00:00
Eric Haszlakiewicz
68d856f618
Merge pull request #168 from bugness-chl/master
...
Tightening the number parsing algorithm
2015-03-03 22:41:31 -05:00
Eric Haszlakiewicz
7e3a6c6b9d
Merge pull request #163 from sixlettervariables/fix-win32-build-problems
...
Fix Win32 build problems
2015-03-03 22:35:36 -05:00
Eric Haszlakiewicz
da62fca305
Merge pull request #144 from mhei/master
...
Introduce json_object_from_fd
2015-03-03 22:12:49 -05:00
Eric Haszlakiewicz
484ca368f0
Slight style tweaks to the bsearch changest.
2015-03-04 03:10:10 +00:00
Eric Haszlakiewicz
a500c1f0b5
Merge pull request #155 from LeSpocky/bsearch
...
add bsearch for arrays
2015-03-03 22:00:08 -05:00
Eric Haszlakiewicz
9db3099572
Merge pull request #156 from jubalh/master
...
Remove trailing whitespaces
2015-03-03 21:37:02 -05:00
chl
99d8fc975e
Tightening the number parsing algorithm
...
Some badly formated "numbers" could get partly parsed,
resulting in truncated results instead of raising an
error.
Examples :
'1.2.3' -> (double)1.2
'2015-01-15' -> (int)2015
This patch is not perfect (ex: input can still end with a 'E', which
is forbidden by json.org doc) but should avoid non-sensically
formated input.
Tests added.
2015-02-05 01:50:37 +01:00
Christopher Watford
4d18d39d99
Adds json_config.h.win32 to project. Adds VS2k13 project.
2014-12-05 10:27:44 -05:00
Christopher Watford
0609a5729c
Fixes #160 'missing header file on windows'
2014-12-05 10:22:36 -05:00
Eric Haszlakiewicz
ec4879ac5b
Merge pull request #153 from LeSpocky/doc
...
improve doc for json_object_to_json_string()
2014-09-13 22:18:51 -04:00
Eric Haszlakiewicz
6ec6fdaf8c
Merge pull request #151 from mjchinn/json_type-comma
...
Remove json_type enum trailing comma
2014-09-13 22:18:14 -04:00
Eric Haszlakiewicz
2c722277ee
Merge pull request #150 from ams-cs/master
...
Fix build using MinGW.
2014-09-13 22:17:57 -04:00
Eric Haszlakiewicz
f88db708ac
Merge pull request #141 from AlexandruCostache/master
...
Removed duplicate check in random_seed test - bug #140
2014-09-13 22:14:44 -04:00
Michael Vetter
fcf5ad1bd6
Remove trailing whitespace
2014-08-26 14:48:59 +02:00
Alexander Dahl
2f5789bdef
add bsearch for arrays
...
Arrays can already be sorted with json_object_array_sort() which uses
qsort() of the standard C library. This adds a counterpart using the
bsearch() from C.
2014-08-21 15:42:50 +02:00
Alexander Dahl
37f5d8696d
improve doc for json_object_to_json_string()
2014-08-18 10:28:38 +02:00
Michael J. Chinn
048dcf288a
Remove json_type enum trailing comma
2014-08-10 00:46:25 -04:00
Andrew Stubbs
ca0ebe0f71
Fix build using MinGW.
...
MinGW requires wincrypt.h.
GCC does not support #pragma comment, which trips Werror.
2014-08-04 11:44:25 +01:00