pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/json-c json-c: updated to 0.13.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0978e174ab9f
branches:  trunk
changeset: 311169:0978e174ab9f
user:      adam <adam%pkgsrc.org@localhost>
date:      Sat Aug 04 09:53:05 2018 +0000

description:
json-c: updated to 0.13.1

0.13.1:
* Bump the major version of the .so library generated up to 4.0 to avoid
  conflicts because some downstream packagers of json-c had already done
  their own bump to ".so.3" for a much older 0.12 release.
* Add const size_t json_c_object_sizeof()
* Avoid invalid free (and thus a segfault) when ref_count gets < 0
* fix handling of custom double formats that include a ".0"
* Avoid uninitialized variable warnings in json_object_object_foreach
* Issue 396: fix build for certain uClibc based systems.
* Add a top level fuzz directory for fuzzers run by OSS-Fuzz


0.13:
This release, being three and a half years after the 0.12 branch (f84d9c),
   has quite a number of changes included.  The following is a sampling of
   the most significant ones.

Since the 0.12 release, 250 issues and pull requests have been closed.
See issues_closed_for_0.13.md for a complete list.


Deprecated and removed features:
--------------------------------
* All internal use of bits.h has been eliminated.  The file will be removed.
        Do not use: hexdigit(), error_ptr(), error_descrition() and it_error()
* lh_abort() is deprecated.  It will be removed.

Behavior changes:
-----------------
* Tighten the number parsing algorithm to raise errors instead of truncating
     the results.  For example 12.3.4 or 2015-01-15, which now return null.
         See commit 99d8fc

* Use size_t for array length and size.  Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
        See commits 45c56b, 92e9a5 and others.

* Check for failue when allocating memory, returning NULL and errno=ENOMEM.
         See commit 2149a04.

* Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change)

New features:
-------------
* We're aiming to follow RFC 7159 now.

* Add a couple of additional option to json_object_to_json_string_ext:
        JSON_C_TO_STRING_PRETTY_TAB
        JSON_C_TO_STRING_NOSLASHESCAPE

* Add a json_object_object_add_ex() function to allow for performance
        improvements when certain constraints are known to be true.

* Make serialization format of doubles configurable, in two different ways:
        Call json_object_set_serializer with json_object_double_to_json_string and a custom
         format on each double object, or
        Call json_c_set_serialization_double_format() to set a global or thread-wide format.

* Add utility function for comparing json_objects - json_object_equal()

* Add a way to copy entire object trees: json_object_deep_copy()
* Add json_object_set_<type> function to modify the value of existing json_object's
 without the need to recreate them.  Also add a json_object_int_inc function to
 adjust an int's value.
* Add support for JSON pointer, RFC 6901.  See json_pointer.h
* Add a json_util_get_last_err() function to retrieve the string describing the
 cause of errors, instead of printing to stderr.
* Add perllike hash function for strings, and json_global_set_string_hash() 8f8d03d
* Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects.

Notable bug fixes and other improvements:
-----------------------------------------
* Make reference increment and decrement atomic to allow passing json objects between threads.
* Fix json_object_object_foreach to avoid uninitialized variable warnings.
* Improve performance by removing unneeded data items from hashtable code and reducing duplicate hash computation.
* Improve performance by storing small strings inside json_object
* Improve performance of json_object_to_json_string by removing variadic printf. commit 9ff0f49
* Issue 371: fix parsing of "-Infinity", and avoid needlessly copying the input when doing so.
* Fix stack buffer overflow in json_object_double_to_json_string_format() - commit 2c2deb87
* Fix various potential null ptr deref and int32 overflows
* Issue 332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length.
* Issue 195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments.
* Issue 275: fix out of bounds read when handling unicode surrogate pairs.
* Ensure doubles that happen to be a whole number are emitted with ".0" - commit ca7a19
* for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated.
* Fix double to int cast overflow in json_object_get_int64.
* Clamp double to int32 when narrowing in json_object_get_int.
* Use strtoll() to parse ints - instead of sscanf
* Miscellaneous smaller changes, including removing unused variables, fixing warning
 about uninitialized variables adding const qualifiers, reformatting code, etc...

diffstat:

 textproc/json-c/Makefile                 |  19 ++++++-------------
 textproc/json-c/PLIST                    |   6 +++---
 textproc/json-c/distinfo                 |  11 +++++------
 textproc/json-c/patches/patch-linkhash.c |  17 -----------------
 4 files changed, 14 insertions(+), 39 deletions(-)

diffs (97 lines):

diff -r 1ea752e68bea -r 0978e174ab9f textproc/json-c/Makefile
--- a/textproc/json-c/Makefile  Sat Aug 04 09:29:59 2018 +0000
+++ b/textproc/json-c/Makefile  Sat Aug 04 09:53:05 2018 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.12 2018/05/14 10:08:00 jperkin Exp $
+# $NetBSD: Makefile,v 1.13 2018/08/04 09:53:05 adam Exp $
 
-DISTNAME=      json-c-0.12.1
+DISTNAME=      json-c-0.13.1
 CATEGORIES=    textproc
 MASTER_SITES=  https://s3.amazonaws.com/json-c_releases/releases/
 
@@ -9,20 +9,13 @@
 COMMENT=       JSON library in C
 LICENSE=       mit
 
-MAKE_JOBS_SAFE=        no
-
-GNU_CONFIGURE= yes
-USE_LIBTOOL=   yes
-USE_TOOLS+=    pkg-config
-
+USE_LIBTOOL=           yes
+USE_TOOLS+=            pkg-config
+GNU_CONFIGURE=         yes
 PKGCONFIG_OVERRIDE+=   json-c.pc.in
-
-CONFIGURE_ARGS+=       --disable-oldname-compat
+TEST_TARGET=           check
 
 .include "../../mk/compiler.mk"
-.if !empty(PKGSRC_COMPILER:Mclang)
-CFLAGS+=       -Wno-tautological-compare -Wno-unused-value
-.endif
 
 # gcc < 4.2 does not have -Wno-error= option.
 .if !empty(CC_VERSION:Mgcc-3*) || !empty(CC_VERSION:Mgcc-4.[01]*)
diff -r 1ea752e68bea -r 0978e174ab9f textproc/json-c/PLIST
--- a/textproc/json-c/PLIST     Sat Aug 04 09:29:59 2018 +0000
+++ b/textproc/json-c/PLIST     Sat Aug 04 09:53:05 2018 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2014/04/20 00:09:04 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.5 2018/08/04 09:53:05 adam Exp $
 include/json-c/arraylist.h
 include/json-c/bits.h
 include/json-c/debug.h
@@ -8,11 +8,11 @@
 include/json-c/json_inttypes.h
 include/json-c/json_object.h
 include/json-c/json_object_iterator.h
-include/json-c/json_object_private.h
+include/json-c/json_pointer.h
 include/json-c/json_tokener.h
 include/json-c/json_util.h
+include/json-c/json_visit.h
 include/json-c/linkhash.h
 include/json-c/printbuf.h
-include/json-c/random_seed.h
 lib/libjson-c.la
 lib/pkgconfig/json-c.pc
diff -r 1ea752e68bea -r 0978e174ab9f textproc/json-c/distinfo
--- a/textproc/json-c/distinfo  Sat Aug 04 09:29:59 2018 +0000
+++ b/textproc/json-c/distinfo  Sat Aug 04 09:53:05 2018 +0000
@@ -1,7 +1,6 @@
-$NetBSD: distinfo,v 1.7 2016/06/12 14:37:37 wiz Exp $
+$NetBSD: distinfo,v 1.8 2018/08/04 09:53:05 adam Exp $
 
-SHA1 (json-c-0.12.1.tar.gz) = e7fcdbe41f1f3307c036f4e9e04b715de533896e
-RMD160 (json-c-0.12.1.tar.gz) = fe4c2a4cf45ab4a74e74512fe6c6ea365e46a66c
-SHA512 (json-c-0.12.1.tar.gz) = 038676a0ce815e5174161fbd4339524feadc294d517f732fb408ad6aa7c4906423451c13386107569d9f24746a1a101564ca511e92e8276c5bf5b8c022ca42ed
-Size (json-c-0.12.1.tar.gz) = 535086 bytes
-SHA1 (patch-linkhash.c) = cb56e1f6eaaa58170e26a9cfb4c87dfe73730c4c
+SHA1 (json-c-0.13.1.tar.gz) = 00e049ffc9878b9c2e3c3dcb6b58c4ce9e65024b
+RMD160 (json-c-0.13.1.tar.gz) = ed417820adcb4151c2fd804e08afbb874af9b3c4
+SHA512 (json-c-0.13.1.tar.gz) = e984db2a42b9c95b52c798b2e8dd1b79951a8dcba27370af30c43b9549fbb00008dbcf052a535c528209aaee38e6d1f760168b706905ae72f3e704ed20f8a1a1
+Size (json-c-0.13.1.tar.gz) = 639425 bytes
diff -r 1ea752e68bea -r 0978e174ab9f textproc/json-c/patches/patch-linkhash.c
--- a/textproc/json-c/patches/patch-linkhash.c  Sat Aug 04 09:29:59 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-$NetBSD: patch-linkhash.c,v 1.1 2014/05/10 04:09:41 pho Exp $
-
-GCC < 4.1 does not have atomic builtins.
-
-TODO: This check should really be moved to configure.ac.
-
---- linkhash.c.orig    2014-05-10 03:58:56.000000000 +0000
-+++ linkhash.c
-@@ -405,7 +405,7 @@ unsigned long lh_char_hash(const void *k
-               int seed;
-               /* we can't use -1 as it is the unitialized sentinel */
-               while ((seed = json_c_get_random_seed()) == -1);
--#if defined __GNUC__
-+#if defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1
-               __sync_val_compare_and_swap(&random_seed, -1, seed);
- #elif defined _MSC_VER
-               InterlockedCompareExchange(&random_seed, seed, -1);



Home | Main Index | Thread Index | Old Index