]> granicus.if.org Git - json-c/log
json-c
7 years agoMerge pull request #384 from ssrlive/patch-1
Eric Haszlakiewicz [Mon, 4 Dec 2017 23:11:09 +0000 (18:11 -0500)]
Merge pull request #384 from ssrlive/patch-1

Fix a VS 2015 compiler warning.

7 years agoUpdate json_object.c
ssrlive [Mon, 4 Dec 2017 06:46:41 +0000 (14:46 +0800)]
Update json_object.c

7 years agoFix a VS 2015 compiler warning.
ssrlive [Mon, 4 Dec 2017 06:43:25 +0000 (14:43 +0800)]
Fix a VS 2015 compiler warning.

In VS 2015, the warning text is "warning C4550: expression evaluates to a function which is missing an argument list".

7 years agoAdd a change log entry for the upcoming 0.13 release.
Eric Haszlakiewicz [Sun, 3 Dec 2017 03:13:22 +0000 (22:13 -0500)]
Add a change log entry for the upcoming 0.13 release.

7 years agoClean up *.vg.out files too to "make distcheck" works.
Eric Haszlakiewicz [Thu, 30 Nov 2017 23:10:25 +0000 (18:10 -0500)]
Clean up *.vg.out files too to "make distcheck" works.

7 years agoIn json_object_deep_copy(), copy over _userdata, at least for json_type_string's...
Eric Haszlakiewicz [Thu, 30 Nov 2017 04:35:38 +0000 (23:35 -0500)]
In json_object_deep_copy(), copy over _userdata, at least for 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.

7 years agoAlways build the json_object_deep_copy() code, but conditionalize running it on a...
Eric Haszlakiewicz [Wed, 29 Nov 2017 22:57:51 +0000 (17:57 -0500)]
Always build the json_object_deep_copy() code, but conditionalize running it on a --benchmark command line option.

7 years agoRename _set_last_err() to _json_c_set_last_err().
Eric Haszlakiewicz [Wed, 29 Nov 2017 14:25:11 +0000 (09:25 -0500)]
Rename _set_last_err() to _json_c_set_last_err().

7 years agoMerge branch 'commodo-json_deep_copy'
Eric Haszlakiewicz [Wed, 29 Nov 2017 14:13:32 +0000 (09:13 -0500)]
Merge branch 'commodo-json_deep_copy'

7 years agoMerge branch 'json_deep_copy' of https://github.com/commodo/json-c into commodo-json_...
Eric Haszlakiewicz [Wed, 29 Nov 2017 14:12:59 +0000 (09:12 -0500)]
Merge branch 'json_deep_copy' of https://github.com/commodo/json-c into commodo-json_deep_copy

7 years agoRename json_object_add_int() to json_object_int_inc() and eliminate the "int64" varia...
Eric Haszlakiewicz [Mon, 27 Nov 2017 22:57:36 +0000 (17:57 -0500)]
Rename json_object_add_int() to json_object_int_inc() and eliminate the "int64" variant since we store 64-bit values internally anyway.

7 years agotests: add test_deep_copy test
Alexandru Ardelean [Fri, 16 Jun 2017 07:50:49 +0000 (10:50 +0300)]
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>
7 years agojson_object: implement json_object_deep_copy()
Alexandru Ardelean [Fri, 16 Jun 2017 07:05:32 +0000 (10:05 +0300)]
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>
7 years agoMerge pull request #363 from jvijtiuk/integer_addition
Eric Haszlakiewicz [Mon, 27 Nov 2017 14:06:39 +0000 (09:06 -0500)]
Merge pull request #363 from jvijtiuk/integer_addition

Issue #338, add json_object_add_int functions

7 years agoUpdate test_parse.expected to match the code.
Eric Haszlakiewicz [Mon, 27 Nov 2017 13:48:08 +0000 (08:48 -0500)]
Update test_parse.expected to match the code.

7 years agoRewrite the json_tokener_state_inf handling in json_tokener to be simpler, and avoid...
Eric Haszlakiewicz [Mon, 27 Nov 2017 05:20:11 +0000 (00:20 -0500)]
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 agoAdd a few more tests to the partial parse to cover bytes after "Infinity".
Eric Haszlakiewicz [Mon, 27 Nov 2017 05:18:55 +0000 (00:18 -0500)]
Add a few more tests to the partial parse to cover bytes after "Infinity".

7 years agoSave proper expected output for test_parse from the previous commit.
Eric Haszlakiewicz [Mon, 27 Nov 2017 05:08:59 +0000 (00:08 -0500)]
Save proper expected output for test_parse from the previous commit.

7 years agoFix parsing of "-Infinity" when the "-" and "Infinity" are split across multiple...
Eric Haszlakiewicz [Mon, 27 Nov 2017 05:04:33 +0000 (00:04 -0500)]
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 agoIssue #371: fix parsing of "-Infinity" (although in a somewhat different location...
Eric Haszlakiewicz [Mon, 27 Nov 2017 03:42:40 +0000 (22:42 -0500)]
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 agoAdd a few extra cases to test_parse to show how trailing bytes are handled, especiall...
Eric Haszlakiewicz [Mon, 27 Nov 2017 03:34:43 +0000 (22:34 -0500)]
Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity".

7 years agoRewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of...
Eric Haszlakiewicz [Mon, 27 Nov 2017 03:31:48 +0000 (22:31 -0500)]
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 agoOn VS 2013 and newer, actually use strtoll instead of redefining it to _strtoi64.
Eric Haszlakiewicz [Sun, 26 Nov 2017 19:17:17 +0000 (14:17 -0500)]
On VS 2013 and newer, actually use strtoll instead of redefining it to _strtoi64.

7 years agoMerge pull request #373 from commodo/fix-appveyor-build
Eric Haszlakiewicz [Sun, 26 Nov 2017 19:08:53 +0000 (14:08 -0500)]
Merge pull request #373 from commodo/fix-appveyor-build

build: fix build on appveyor CI

7 years agoMerge pull request #381 from busterb/fix-makedist
Eric Haszlakiewicz [Sun, 26 Nov 2017 18:57:54 +0000 (13:57 -0500)]
Merge pull request #381 from busterb/fix-makedist

Fix makedist

7 years agoadd/remove missing distribution files
Brent Cook [Sun, 26 Nov 2017 14:29:45 +0000 (08:29 -0600)]
add/remove missing distribution files

7 years agoignore more autoconf goo
Brent Cook [Sun, 26 Nov 2017 14:26:18 +0000 (08:26 -0600)]
ignore more autoconf goo

7 years agojson_util: define `strtoll` as _strtoi64 for MSVC
Alexandru Ardelean [Tue, 7 Nov 2017 14:50:58 +0000 (16:50 +0200)]
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>
7 years agostrerror_override: re-organize strerror_override.h
Alexandru Ardelean [Tue, 7 Nov 2017 14:21:52 +0000 (16:21 +0200)]
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>
7 years agoRemove out of date win32 build information, and mention the need to use cmake there.
Eric Haszlakiewicz [Mon, 23 Oct 2017 02:46:05 +0000 (22:46 -0400)]
Remove out of date win32 build information, and mention the need to use cmake there.

7 years agoFix definition of NELEM in the tests.
Eric Haszlakiewicz [Mon, 23 Oct 2017 02:28:35 +0000 (22:28 -0400)]
Fix definition of NELEM in the tests.

7 years agoIssue #370: work around Clang-on-windows oddities by rearranging ifdefs.
Eric Haszlakiewicz [Mon, 23 Oct 2017 02:19:41 +0000 (22:19 -0400)]
Issue #370: work around Clang-on-windows oddities by rearranging ifdefs.

7 years agoIssue #369: note some useful settings when building for Android.
Eric Haszlakiewicz [Fri, 20 Oct 2017 03:30:51 +0000 (23:30 -0400)]
Issue #369: note some useful settings when building for Android.

7 years agoUse cmake to create the json-c.pc file, as suggested by PR#362.
Eric Haszlakiewicz [Mon, 9 Oct 2017 17:16:00 +0000 (13:16 -0400)]
Use cmake to create the json-c.pc file, as suggested by PR#362.

7 years agoIssue #173, follow up to using strtoll to allow this to work on older Windows environ...
Eric Haszlakiewicz [Wed, 4 Oct 2017 02:50:29 +0000 (22:50 -0400)]
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.

7 years agoThe new cmake-generated VS builds now generate a dynamic .dll instead of a .lib
Eric Haszlakiewicz [Mon, 18 Sep 2017 01:44:04 +0000 (21:44 -0400)]
The new cmake-generated VS builds now generate a dynamic .dll instead of a .lib

7 years agoFor appveyor builds, json_config.h is actually generated in the "include" directory.
Eric Haszlakiewicz [Mon, 18 Sep 2017 01:35:53 +0000 (21:35 -0400)]
For appveyor builds, json_config.h is actually generated in the "include" directory.

7 years agoSplit the list of cmake headers into public and private ones, and only install the...
Eric Haszlakiewicz [Mon, 18 Sep 2017 01:27:07 +0000 (21:27 -0400)]
Split the list of cmake headers into public and private ones, and only install the public ones.

7 years agoAdd a "cmake ." line to the appveyor build file to try to get it working again.
Eric Haszlakiewicz [Mon, 18 Sep 2017 01:25:49 +0000 (21:25 -0400)]
Add a "cmake ." line to the appveyor build file to try to get it working again.

7 years agoAdd json_object_add_int functions
Juraj Vijtiuk [Thu, 14 Sep 2017 12:05:33 +0000 (08:05 -0400)]
Add json_object_add_int functions

7 years agoMerge pull request #361 from schwehr/int64
Eric Haszlakiewicz [Tue, 12 Sep 2017 01:25:27 +0000 (21:25 -0400)]
Merge pull request #361 from schwehr/int64

Fix double to int cast overflow in json_object_get_int64.

7 years agoFix double to int cast overflow in json_object_get_int64.
Kurt Schwehr [Mon, 11 Sep 2017 14:23:00 +0000 (07:23 -0700)]
Fix double to int cast overflow in json_object_get_int64.

Found with autofuzz in GDAL

7 years agoMerge pull request #360 from jasonbking/master
Eric Haszlakiewicz [Fri, 8 Sep 2017 02:45:48 +0000 (22:45 -0400)]
Merge pull request #360 from jasonbking/master

Use strtoll() to parse ints

7 years agoIssue#353: attempt to fix or ignore a few -Wdocumentation messages from Clang.
Eric Haszlakiewicz [Fri, 8 Sep 2017 02:22:25 +0000 (22:22 -0400)]
Issue#353: attempt to fix or ignore a few -Wdocumentation messages from Clang.

7 years agoIssue#353: mark lh_abort as actually deprecated, not just in the docs.
Eric Haszlakiewicz [Fri, 8 Sep 2017 02:21:29 +0000 (22:21 -0400)]
Issue#353: mark lh_abort as actually deprecated, not just in the docs.

7 years agoAdd long long 64-bit check
Jason King [Fri, 8 Sep 2017 01:46:06 +0000 (01:46 +0000)]
Add long long 64-bit check

7 years agoUse strtoll to parse ints
Jason King [Thu, 7 Sep 2017 17:21:14 +0000 (17:21 +0000)]
Use strtoll to parse ints

7 years agoRemove the Visual Studio project files as they were out of date, and should now be...
Eric Haszlakiewicz [Thu, 7 Sep 2017 03:50:03 +0000 (23:50 -0400)]
Remove the Visual Studio project files as they were out of date, and should now be generated by using cmake.

7 years agoIssue #359: Use consistent spacing in CMakeLists.txt
Eric Haszlakiewicz [Thu, 7 Sep 2017 03:40:20 +0000 (23:40 -0400)]
Issue #359: Use consistent spacing in CMakeLists.txt

7 years agoIssue #359: Don't duplicate lh_get_hash, just omit the "inline" for VS2010.
Eric Haszlakiewicz [Thu, 7 Sep 2017 03:39:23 +0000 (23:39 -0400)]
Issue #359: Don't duplicate lh_get_hash, just omit the "inline" for VS2010.

7 years agoMerge pull request #359 from Haffon/api-0.12
Eric Haszlakiewicz [Thu, 7 Sep 2017 03:20:36 +0000 (23:20 -0400)]
Merge pull request #359 from Haffon/api-0.12

update CMakeLists.txt for compile with visual studio at least 2010

7 years agoset JSON_C_HEADERS full file name
Haffon [Thu, 7 Sep 2017 02:39:14 +0000 (10:39 +0800)]
set JSON_C_HEADERS full file name

7 years agoif compile with vs2015, enable the "static inline" declare.
Haffon [Thu, 7 Sep 2017 02:28:26 +0000 (10:28 +0800)]
if compile with vs2015, enable the "static inline" declare.

7 years agorollback api to 0.12
Haffon [Thu, 7 Sep 2017 02:02:21 +0000 (10:02 +0800)]
rollback api to 0.12

7 years agoMerge pull request #2 from json-c/master
Haffon [Thu, 7 Sep 2017 01:33:07 +0000 (09:33 +0800)]
Merge pull request #2 from json-c/master

merge upstream

7 years agoUndo a bit of 2d1da5ab: handle per-thread formats for double serialization, even...
Eric Haszlakiewicz [Tue, 5 Sep 2017 05:56:42 +0000 (01:56 -0400)]
Undo a bit of 2d1da5ab: handle per-thread formats for double serialization, even if --enable-threading wasn't specified.

7 years agoIssue #173: since some sscanf implementations return 0 for non-zero inputs, directly...
Eric Haszlakiewicz [Tue, 5 Sep 2017 05:53:13 +0000 (01:53 -0400)]
Issue #173: since some sscanf implementations return 0 for non-zero inputs, directly check for "0" in the input.

7 years agoAdd a --enable-threading configure option, and only use the (slower) __sync_add_and_f...
Eric Haszlakiewicz [Mon, 4 Sep 2017 03:37:12 +0000 (23:37 -0400)]
Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified.

7 years agoUse AC_CONFIG_MACRO_DIRS to specify path to the ax macros instead of passing -I to...
Eric Haszlakiewicz [Mon, 4 Sep 2017 02:35:58 +0000 (22:35 -0400)]
Use AC_CONFIG_MACRO_DIRS to specify path to the ax macros instead of passing -I to autoreconf in autogen.sh.

7 years agoExplicitly check for GCC's atomic functions instead of depending on the __GNUC__...
Eric Haszlakiewicz [Sat, 2 Sep 2017 18:48:17 +0000 (14:48 -0400)]
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.

7 years agoMerge branch 'pull-211'
Eric Haszlakiewicz [Sat, 2 Sep 2017 17:54:15 +0000 (13:54 -0400)]
Merge branch 'pull-211'
This is EmielBruijntes' "Atomic updates for the refcount"

7 years agoIssue #351: don't redefine SIZE_T_MAX if it's already defined.
Eric Haszlakiewicz [Thu, 31 Aug 2017 03:35:56 +0000 (23:35 -0400)]
Issue #351: don't redefine SIZE_T_MAX if it's already defined.

7 years agoIssue #349: none of automake's clean targets are suite for really cleaning up everyth...
Eric Haszlakiewicz [Thu, 31 Aug 2017 03:17:24 +0000 (23:17 -0400)]
Issue #349: none of automake's clean targets are suite for really cleaning up everything, so add a local "really-clean" target that does so.

7 years agoMerge pull request #1 from json-c/master
Haffon [Tue, 29 Aug 2017 16:02:59 +0000 (00:02 +0800)]
Merge pull request #1 from json-c/master

want to merge the original repository

7 years agoPR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string...
Eric Haszlakiewicz [Fri, 25 Aug 2017 05:15:39 +0000 (01:15 -0400)]
PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated.

7 years ago1.make it can been compiled with Visual Studio 2010
Haffon [Tue, 22 Aug 2017 05:53:47 +0000 (13:53 +0800)]
1.make it can been compiled with Visual Studio 2010
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.

7 years agoMerge pull request #346 from schwehr/get_int
Eric Haszlakiewicz [Tue, 22 Aug 2017 01:50:58 +0000 (20:50 -0500)]
Merge pull request #346 from schwehr/get_int

Clamp double to int32 when narrowing in json_object_get_int.

7 years agoMerge pull request #345 from MrAnno/fix-make-dist
Eric Haszlakiewicz [Tue, 22 Aug 2017 01:50:20 +0000 (20:50 -0500)]
Merge pull request #345 from MrAnno/fix-make-dist

Fix make dist and make distcheck

7 years agoMerge pull request #344 from fastogt/master
Eric Haszlakiewicz [Tue, 22 Aug 2017 01:39:11 +0000 (20:39 -0500)]
Merge pull request #344 from fastogt/master

Fix Mingw build

7 years agoClamp double to int32 when narrowing in json_object_get_int.
Kurt Schwehr [Tue, 8 Aug 2017 14:54:38 +0000 (07:54 -0700)]
Clamp double to int32 when narrowing in json_object_get_int.

Avoids undefined behavior.  Found by autofuzz.

7 years agoFix 'make distcheck'
László Várady [Fri, 4 Aug 2017 10:26:54 +0000 (12:26 +0200)]
Fix 'make distcheck'

Signed-off-by: László Várady <laszlo.varady@balabit.com>
7 years agoFix 'make dist'
László Várady [Fri, 4 Aug 2017 09:59:14 +0000 (11:59 +0200)]
Fix 'make dist'

EXTRA_DIST copies the listed directories/files from the _source_ directory
into the distribution.

Since the doc directory does not exist after running autogen + configure
+ make dist, the distribution tarball generation fails.

Note that the dist-hook rule below operates on 'distdir', not on the source
directory where EXTRA_DIST expects the existence of the doc folder.

In summary, even if I removed 'doc' from EXTRA_DIST, the dist tarball will
always contain the documentation (due to the dist-hook rule).

Signed-off-by: László Várady <laszlo.varady@balabit.com>
7 years agoFix Mingw build
topilski [Sun, 30 Jul 2017 04:37:17 +0000 (07:37 +0300)]
Fix Mingw build

7 years agoFix parsing doubles for mingw
topilski [Sun, 30 Jul 2017 04:30:05 +0000 (07:30 +0300)]
Fix parsing doubles for mingw

7 years agoPR #336: fix to previous change, be sure to include string.h when we're using the...
Eric Haszlakiewicz [Fri, 28 Jul 2017 03:17:25 +0000 (20:17 -0700)]
PR #336: fix to previous change, be sure to include string.h when we're using the real strerror.

7 years agoPR #336: Fix typo in defining STRERROR_OVERRIDE_IMPL
Eric Haszlakiewicz [Fri, 28 Jul 2017 03:10:53 +0000 (20:10 -0700)]
PR #336: Fix typo in defining STRERROR_OVERRIDE_IMPL

7 years agoMerge pull request #340 from commodo/fix-appveyor-build
Eric Haszlakiewicz [Fri, 28 Jul 2017 03:09:12 +0000 (23:09 -0400)]
Merge pull request #340 from commodo/fix-appveyor-build

strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers

7 years agobuild,travis: drop `-enable-strerror-override` argument (no longer exists)
Alexandru Ardelean [Wed, 19 Jul 2017 12:22:36 +0000 (15:22 +0300)]
build,travis: drop `-enable-strerror-override` argument (no longer exists)

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agostrerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers
Alexandru Ardelean [Wed, 19 Jul 2017 12:10:10 +0000 (15:10 +0300)]
strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers

Fixes build on AppVeyor.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agoPR #336: since we can't use function overriding (due to problems with it on
Eric Haszlakiewicz [Sat, 15 Jul 2017 14:12:44 +0000 (07:12 -0700)]
PR #336: since we can't use function overriding (due to problems with it on
OSX) always include the _json_c_strerror function but only enable it with a flag
 during tests.

7 years agoPR #336: since we can't use function overriding (due to problems with it on OSX)...
Eric Haszlakiewicz [Sat, 15 Jul 2017 14:07:28 +0000 (07:07 -0700)]
PR #336: since we can't use function overriding (due to problems with it on OSX) always include the _json_c_strerror function but only enable it with a flag during tests.

7 years agoAllow USE_VALGRIND to be set to anything starting with 0, N or n to disable valgrind...
Eric Haszlakiewicz [Sat, 15 Jul 2017 14:03:18 +0000 (07:03 -0700)]
Allow USE_VALGRIND to be set to anything starting with 0, N or n to disable valgrind during tests.

7 years agoMerge pull request #336 from commodo/fix-tests
Eric Haszlakiewicz [Fri, 14 Jul 2017 02:39:01 +0000 (22:39 -0400)]
Merge pull request #336 from commodo/fix-tests

tests: fix tests in travis-ci.org

7 years agobuild,travis: enable strerror override option in build
Alexandru Ardelean [Thu, 13 Jul 2017 07:24:27 +0000 (10:24 +0300)]
build,travis: enable strerror override option in build

To get consistent output between Linux & OS X.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agobuild: make `strerror()` override-able
Alexandru Ardelean [Thu, 13 Jul 2017 07:11:15 +0000 (10:11 +0300)]
build: make `strerror()` override-able

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>
7 years agoconfigure.ac: check for `uselocale` function only on Linux platforms
Alexandru Ardelean [Thu, 13 Jul 2017 06:33:39 +0000 (09:33 +0300)]
configure.ac: check for `uselocale` function only on Linux platforms

On Apple this seems to fail the `test_locale` test,
which would imply that the `uselocale` function
does not behave as expected.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agotests: fix leak in `test_util_file` ; found by cppcheck
Alexandru Ardelean [Mon, 10 Jul 2017 15:00:41 +0000 (18:00 +0300)]
tests: fix leak in `test_util_file` ; found by cppcheck

Which now seems to fail the build.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agotravis,tests: run cppcheck only if it exists
Alexandru Ardelean [Mon, 10 Jul 2017 14:47:00 +0000 (17:47 +0300)]
travis,tests: run cppcheck only if it exists

ugh... seems cppcheck is not packaged for OS X
And `set -e` exposes this.

And also `cppcheck` seems to exit with non-zero
exit codes by default [even if errs found].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agotests: compress test_utile_file with test_basic
Alexandru Ardelean [Mon, 10 Jul 2017 10:30:49 +0000 (13:30 +0300)]
tests: compress test_utile_file with test_basic

More code compression/de-duplication.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agotests: add `set -e` specifier to bail early on build run
Alexandru Ardelean [Mon, 10 Jul 2017 09:01:56 +0000 (12:01 +0300)]
tests: add `set -e` specifier to bail early on build run

Seems that test1 is failing, but travis is not catching it.
Likely, this is because the `cppcheck` returns success
and we need to bail on the `make check` step.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agoMerge pull request #335 from commodo/build_status_travis
Eric Haszlakiewicz [Tue, 11 Jul 2017 04:16:12 +0000 (00:16 -0400)]
Merge pull request #335 from commodo/build_status_travis

README.md: show build status tag from travis-ci.org

7 years agoREADME.md: show build status tag from travis & appveyor.
Alexandru Ardelean [Mon, 10 Jul 2017 08:28:10 +0000 (11:28 +0300)]
README.md: show build status tag from travis & appveyor.

Looks nice to see a `Build Passing` tag when you
scroll to the README.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years agoMove a variable declaration to the start of the block to work better with older compi...
Eric Haszlakiewicz [Sun, 9 Jul 2017 23:08:29 +0000 (16:08 -0700)]
Move a variable declaration to the start of the block to work better with older compilers.

7 years agoRemove a spurious comma in configure.ac
Eric Haszlakiewicz [Sun, 9 Jul 2017 23:00:32 +0000 (16:00 -0700)]
Remove a spurious comma in configure.ac

7 years agoUpdated expected test1 output which should have been included in commit fd9b3b2.
Eric Haszlakiewicz [Sun, 9 Jul 2017 22:22:53 +0000 (15:22 -0700)]
Updated expected test1 output which should have been included in commit fd9b3b2.

7 years agoComment out the warning about racy random seed initialization in lh_char_hash(),...
Eric Haszlakiewicz [Sun, 9 Jul 2017 22:13:02 +0000 (15:13 -0700)]
Comment out the warning about racy random seed initialization in lh_char_hash(), if you're on a platform where it'll be triggered it just makes it a pain to build.

7 years agoAdd extra casts to void * to squash some warning on certain systems (e.g. CentOS...
Eric Haszlakiewicz [Sun, 9 Jul 2017 22:08:21 +0000 (15:08 -0700)]
Add extra casts to void * to squash some warning on certain systems (e.g. CentOS w/ gcc 4.1.2).

7 years agoFix bad usage of strncat introduces in 1a94c70. Pointed out by @rouault in PR #331.
Eric Haszlakiewicz [Sun, 9 Jul 2017 22:04:18 +0000 (15:04 -0700)]
Fix bad usage of strncat introduces in 1a94c70.  Pointed out by @rouault in PR #331.

7 years agoEliminate static qualifiers on a couple local variables that were causing thread...
Eric Haszlakiewicz [Sun, 9 Jul 2017 21:56:18 +0000 (14:56 -0700)]
Eliminate static qualifiers on a couple local variables that were causing thread safety issues.  Suggested by @rouault in PR #331.

7 years agoReformat json_object_double_to_json_string_format() to have consistent spacing.
Eric Haszlakiewicz [Sun, 9 Jul 2017 03:33:28 +0000 (20:33 -0700)]
Reformat json_object_double_to_json_string_format() to have consistent spacing.