Merge pull request #575 from besser82/topic/besser82/cosmetics

Small cosmetics.
This commit is contained in:
Eric Haszlakiewicz
2020-04-11 14:18:37 -04:00
committed by GitHub
19 changed files with 454 additions and 462 deletions

2
.gitignore vendored
View File

@@ -42,6 +42,7 @@
/tests/*.trs /tests/*.trs
# Generated folders # Generated folders
/build
/Debug /Debug
/Release /Release
/*/Debug /*/Debug
@@ -86,4 +87,3 @@
/libjson-c.a /libjson-c.a
/libjson-c.so /libjson-c.so
/libjson-c.so.* /libjson-c.so.*

View File

@@ -1,154 +1,153 @@
language: cpp language: cpp
matrix: matrix:
include: include:
# gcc # gcc
# xenial # xenial
# gcc 5 is the default on xenial # gcc 5 is the default on xenial
- os: linux - os: linux
dist: xenial dist: xenial
compiler: gcc compiler: gcc
addons: addons:
apt: apt:
packages: packages:
- valgrind - valgrind
- cppcheck - cppcheck
- doxygen - doxygen
- cmake - cmake
env: CHECK="true" env: CHECK="true"
# bionic # bionic
- os: linux - os: linux
dist: bionic dist: bionic
compiler: gcc compiler: gcc
env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
# gcc 7 is the default on bionic # gcc 7 is the default on bionic
- os: linux - os: linux
dist: bionic dist: bionic
compiler: gcc compiler: gcc
env: CHECK="true" env: CHECK="true"
- os: linux - os: linux
dist: bionic dist: bionic
compiler: gcc compiler: gcc
env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
# clang # clang
# xenial # xenial
- os: linux - os: linux
dist: xenial dist: xenial
compiler: clang compiler: clang
addons: addons:
apt: apt:
sources: sources:
- llvm-toolchain-xenial-5.0 - llvm-toolchain-xenial-5.0
packages: packages:
- clang-5.0 - clang-5.0
- cmake - cmake
env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: linux - os: linux
dist: xenial dist: xenial
compiler: clang compiler: clang
addons: addons:
apt: apt:
sources: sources:
- llvm-toolchain-xenial-6.0 - llvm-toolchain-xenial-6.0
packages: packages:
- clang-6.0 - clang-6.0
- cmake - cmake
env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
# clang-7 is the default on xenial and bionic # clang-7 is the default on xenial and bionic
- os: linux - os: linux
dist: xenial dist: xenial
compiler: clang compiler: clang
addons: addons:
apt: apt:
packages: packages:
- valgrind - valgrind
- cppcheck - cppcheck
- doxygen - doxygen
- cmake - cmake
env: CHECK="true" env: CHECK="true"
# bionic # bionic
- os: linux - os: linux
dist: bionic dist: bionic
compiler: clang compiler: clang
env: CHECK="true" env: CHECK="true"
# osx # osx
- os: osx - os: osx
osx_image: xcode9.4 osx_image: xcode9.4
env: XCODE="true" env: XCODE="true"
- os: osx - os: osx
osx_image: xcode10.1 osx_image: xcode10.1
env: XCODE="true" CHECK="true" env: XCODE="true" CHECK="true"
# run coveralls # run coveralls
- os: linux - os: linux
dist: xenial dist: xenial
compiler: gcc compiler: gcc
addons: addons:
apt: apt:
packages: packages:
- lcov - lcov
env: CHECK="true" env: CHECK="true"
before_install: before_install:
- sudo gem install coveralls-lcov - sudo gem install coveralls-lcov
- echo $CC - echo $CC
- echo $LANG - echo $LANG
- echo $LC_ALL - echo $LC_ALL
- set -e - set -e
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
eval "${MATRIX_EVAL}"; eval "${MATRIX_EVAL}";
if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then
sudo apt-get install -y $CC; sudo apt-get install -y $CC;
fi; fi;
fi fi
before_script: before_script:
- export CFLAGS="-fprofile-arcs -ftest-coverage" - export CFLAGS="-fprofile-arcs -ftest-coverage"
- mkdir build && cd build && cmake .. - mkdir build && cd build && cmake ..
script: script:
- make - make
- make test - make test
after_success: after_success:
- cd .. - cd ..
- lcov -d build/ -b . -c -o build/all_coverage.info - lcov -d build/ -b . -c -o build/all_coverage.info
- lcov -r build/all_coverage.info '/usr/*' '*CMakeFiles*' '*fuzz*' '*test*' -o build/coverage.info - lcov -r build/all_coverage.info '/usr/*' '*CMakeFiles*' '*fuzz*' '*test*' -o build/coverage.info
- coveralls-lcov --verbose build/coverage.info - coveralls-lcov --verbose build/coverage.info
# allow_failures: # allow_failures:
# - os: osx # - os: osx
before_install: before_install:
- echo $CC - echo $CC
- echo $LANG - echo $LANG
- echo $LC_ALL - echo $LC_ALL
- set -e - set -e
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
eval "${MATRIX_EVAL}"; eval "${MATRIX_EVAL}";
if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then
sudo apt-get install -y $CC; sudo apt-get install -y $CC;
fi; fi;
fi fi
before_script: before_script:
# XXX osx on travis doesn't work w/ set -e, so turn it off :( # XXX osx on travis doesn't work w/ set -e, so turn it off :(
- set +e - set +e
- mkdir -p build || echo "Failed to mkdir build" - mkdir -p build || echo "Failed to mkdir build"
- cd build || echo "Failed to cd build" - cd build || echo "Failed to cd build"
- cmake .. || echo "Failed to run cmake" - cmake .. || echo "Failed to run cmake"
script: script:
- make - make
# when using bionic, Travis seems to ignore the "addons" section, so installing the packages with apt-get... # when using bionic, Travis seems to ignore the "addons" section, so installing the packages with apt-get...
- if [ -n "$CHECK" ]; then - if [ -n "$CHECK" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ]; then if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install doxygen; brew install doxygen;
else else
if [ "$TRAVIS_DIST" = "bionic" ]; then if [ "$TRAVIS_DIST" = "bionic" ]; then
sudo apt-get install -y valgrind cppcheck doxygen; sudo apt-get install -y valgrind cppcheck doxygen;
fi; fi;
fi; fi;
make distcheck; make distcheck;
if type cppcheck &> /dev/null ; then cppcheck --error-exitcode=1 --quiet *.h *.c tests/ ; fi; if type cppcheck &> /dev/null ; then cppcheck --error-exitcode=1 --quiet *.h *.c tests/ ; fi;
fi fi

View File

@@ -2,4 +2,3 @@ Michael Clark <michael@metaparadigm.com>
Jehiah Czebotar <jehiah@gmail.com> Jehiah Czebotar <jehiah@gmail.com>
Eric Haszlakiewicz <hawicz+json-c@gmail.com> Eric Haszlakiewicz <hawicz+json-c@gmail.com>
C. Watford (christopher.watford@gmail.com) C. Watford (christopher.watford@gmail.com)

View File

@@ -356,7 +356,7 @@ if (DOXYGEN_FOUND)
add_custom_target(doc add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Doxyfile COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Doxyfile
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
# request to configure the file # request to configure the file
configure_file(Doxyfile Doxyfile) configure_file(Doxyfile Doxyfile)

View File

@@ -753,7 +753,7 @@ WARN_LOGFILE =
# spaces. # spaces.
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = INPUT =
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@@ -1,3 +1,2 @@
See README.md for installation instructions. See README.md for installation instructions.

View File

@@ -143,9 +143,9 @@ cmake-configure can take a few options.
| options | Description| | options | Description|
| ---- | ---- | | ---- | ---- |
| prefix=PREFIX | install architecture-independent files in PREFIX | | prefix=PREFIX | install architecture-independent files in PREFIX |
| enable-threading | Enable code to support partly multi-threaded use | | enable-threading | Enable code to support partly multi-threaded use |
| enable-rdrand | Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms. | | enable-rdrand | Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms. |
| enable-shared | build shared libraries [default=yes] | | enable-shared | build shared libraries [default=yes] |
| enable-static | build static libraries [default=yes] | | enable-static | build static libraries [default=yes] |
| disable-Bsymbolic | Avoid linking with -Bsymbolic-function | | disable-Bsymbolic | Avoid linking with -Bsymbolic-function |
@@ -175,7 +175,7 @@ make test
make USE_VALGRIND=0 test # optionally skip using valgrind make USE_VALGRIND=0 test # optionally skip using valgrind
``` ```
If a test fails, check `Testing/Temporary/LastTest.log`, If a test fails, check `Testing/Temporary/LastTest.log`,
`tests/testSubDir/${testname}/${testname}.vg.out`, and other similar files. `tests/testSubDir/${testname}/${testname}.vg.out`, and other similar files.
If there is insufficient output try: If there is insufficient output try:
```sh ```sh
@@ -237,4 +237,3 @@ following more specific header files:
* json_util.h - Miscelleanous utility functions. * json_util.h - Miscelleanous utility functions.
For a full list of headers see [files.html](http://json-c.github.io/json-c/json-c-0.13.1/doc/html/files.html) For a full list of headers see [files.html](http://json-c.github.io/json-c/json-c-0.13.1/doc/html/files.html)

View File

@@ -147,4 +147,3 @@ Copy and paste this output into the wiki page at:
------------ ------------
Send an email to the mailing list. Send an email to the mailing list.

View File

@@ -1,32 +1,31 @@
In general: In general:
For minor changes to a function, copy the existing formatting. For minor changes to a function, copy the existing formatting.
When changing the style, commit that separately from other changes. When changing the style, commit that separately from other changes.
For new code and major changes to a function, switch to the official json-c style. For new code and major changes to a function, switch to the official json-c style.
Official json-c style: Official json-c style:
Aim for readability, not strict conformance to fixed style rules. Aim for readability, not strict conformance to fixed style rules.
Formatting is tab based; previous attempts at proper alignment with Formatting is tab based; previous attempts at proper alignment with
spaces for continuation lines have been abandoned in favor of the spaces for continuation lines have been abandoned in favor of the
convenience of using clang-format. convenience of using clang-format.
Refer to the .clang-format file for details, and run the tool before commit: Refer to the .clang-format file for details, and run the tool before commit:
clang-format -i somefile.c foo.h clang-format -i somefile.c foo.h
For sections of code that would be significantly negatively impacted, surround For sections of code that would be significantly negatively impacted, surround
them with magic comments to disable formatting: them with magic comments to disable formatting:
/* clang-format off */ /* clang-format off */
...code... ...code...
/* clang-format on */ /* clang-format on */
Naming: Naming:
Words within function and variable names are separated with underscores. Avoid camel case. Words within function and variable names are separated with underscores. Avoid camel case.
Prefer longer, more descriptive names, but not excessively so. No single letter variable names. Prefer longer, more descriptive names, but not excessively so. No single letter variable names.
Other: Other:
Variables should be defined for the smallest scope needed. Variables should be defined for the smallest scope needed.
Functions should be defined static when possible. Functions should be defined static when possible.
When possible, avoid exposing internals in the public API. When possible, avoid exposing internals in the public API.

View File

@@ -1,37 +1,37 @@
version: '{branch}.{build}' version: '{branch}.{build}'
os: Windows Server 2012 R2 os: Windows Server 2012 R2
platform: x64 platform: x64
# There should be a better way to set-up a build matrix. # There should be a better way to set-up a build matrix.
environment: environment:
matrix: matrix:
- b_toolset: Windows7.1SDK - b_toolset: Windows7.1SDK
b_config: Debug b_config: Debug
- b_toolset: Windows7.1SDK - b_toolset: Windows7.1SDK
b_config: Release b_config: Release
- b_toolset: v120 - b_toolset: v120
b_config: Debug b_config: Debug
- b_toolset: v120 - b_toolset: v120
b_config: Release b_config: Release
- b_toolset: v140 - b_toolset: v140
b_config: Debug b_config: Debug
- b_toolset: v140 - b_toolset: v140
b_config: Release b_config: Release
build_script: build_script:
- cmake -T %b_toolset% -DCMAKE_BUILD_TYPE=%b_config% -DCMAKE_INSTALL_PREFIX=t_install . - cmake -T %b_toolset% -DCMAKE_BUILD_TYPE=%b_config% -DCMAKE_INSTALL_PREFIX=t_install .
- cmake --build . --target install - cmake --build . --target install
after_build: after_build:
- cd t_install - cd t_install
- 7z a ../json-c.win32.%b_toolset%.%b_config%.zip * - 7z a ../json-c.win32.%b_toolset%.%b_config%.zip *
artifacts: artifacts:
- path: json-c.win32.%b_toolset%.%b_config%.zip - path: json-c.win32.%b_toolset%.%b_config%.zip
name: json-c.win32.%b_toolset%.%b_config%.zip name: json-c.win32.%b_toolset%.%b_config%.zip

View File

@@ -1,207 +1,207 @@
/* config.h.in. Generated from configure.ac by autoheader. */ /* config.h.in. Generated from configure.ac by autoheader. */
/* Enable RDRANR Hardware RNG Hash Seed */ /* Enable RDRANR Hardware RNG Hash Seed */
#undef ENABLE_RDRAND #undef ENABLE_RDRAND
/* Define if .gnu.warning accepts long strings. */ /* Define if .gnu.warning accepts long strings. */
#undef HAS_GNU_WARNING_LONG #undef HAS_GNU_WARNING_LONG
/* Define to 1 if you have the declaration of `INFINITY', and to 0 if you /* Define to 1 if you have the declaration of `INFINITY', and to 0 if you
don't. */ don't. */
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__) #if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__)
#define HAVE_DECL_INFINITY 1 #define HAVE_DECL_INFINITY 1
#endif #endif
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
*/ */
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__) #if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__)
#define HAVE_DECL_ISINF 1 #define HAVE_DECL_ISINF 1
#endif #endif
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. /* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
*/ */
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__) #if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__)
#define HAVE_DECL_ISNAN 1 #define HAVE_DECL_ISNAN 1
#endif #endif
/* Define to 1 if you have the declaration of `nan', and to 0 if you don't. */ /* Define to 1 if you have the declaration of `nan', and to 0 if you don't. */
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__) #if (defined(_MSC_VER) && _MSC_VER >= 1800) || defined(__MINGW32__)
#define HAVE_DECL_NAN 1 #define HAVE_DECL_NAN 1
#endif #endif
/* Define to 1 if you have the declaration of `_finite', and to 0 if you /* Define to 1 if you have the declaration of `_finite', and to 0 if you
don't. */ don't. */
#define HAVE_DECL__FINITE 1 #define HAVE_DECL__FINITE 1
/* Define to 1 if you have the declaration of `_isnan', and to 0 if you don't. /* Define to 1 if you have the declaration of `_isnan', and to 0 if you don't.
*/ */
#define HAVE_DECL__ISNAN 1 #define HAVE_DECL__ISNAN 1
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1 #define HAVE_DLFCN_H 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#define HAVE_DOPRNT 1 #define HAVE_DOPRNT 1
/* Define to 1 if you have the <endian.h> header file. */ /* Define to 1 if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H #undef HAVE_ENDIAN_H
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define to 1 if you have the <locale.h> header file. */ /* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1 #define HAVE_LOCALE_H 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */ to 0 otherwise. */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
/* Define to 1 if you have the `open' function. */ /* Define to 1 if you have the `open' function. */
#define HAVE_OPEN 1 #define HAVE_OPEN 1
/* Define to 1 if your system has a GNU libc compatible `realloc' function, /* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */ and to 0 otherwise. */
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
/* Define to 1 if you have the `setlocale' function. */ /* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1 #define HAVE_SETLOCALE 1
/* Define to 1 if you have the `snprintf' function. */ /* Define to 1 if you have the `snprintf' function. */
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
#else #else
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
#endif #endif
/* Define to 1 if you have the <stdarg.h> header file. */ /* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1 #define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */ /* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strdup' function. */ /* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 0 #define HAVE_STRDUP 0
/* Define to 1 if you have the `strerror' function. */ /* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1 #define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */ /* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H #undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */ /* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define to 1 if you have the `strncasecmp' function. */ /* Define to 1 if you have the `strncasecmp' function. */
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#else #else
#undef HAVE_STRNCASECMP #undef HAVE_STRNCASECMP
#endif #endif
#cmakedefine HAVE_STRTOLL #cmakedefine HAVE_STRTOLL
#cmakedefine strtoll @cmake_strtoll@ #cmakedefine strtoll @cmake_strtoll@
#cmakedefine HAVE_STRTOULL #cmakedefine HAVE_STRTOULL
#cmakedefine strtoull @cmake_strtoull@ #cmakedefine strtoull @cmake_strtoull@
/* Define to 1 if you have the <syslog.h> header file. */ /* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H #undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/cdefs.h> header file. */ /* Define to 1 if you have the <sys/cdefs.h> header file. */
#define HAVE_SYS_CDEFS_H 1 #define HAVE_SYS_CDEFS_H 1
/* Define to 1 if you have the <sys/param.h> header file. */ /* Define to 1 if you have the <sys/param.h> header file. */
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_PARAM_H 1
#else #else
#undef HAVE_SYS_PARAM_H #undef HAVE_SYS_PARAM_H
#endif #endif
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1 #define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#else #else
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
#endif #endif
/* Define to 1 if you have the `vasprintf' function. */ /* Define to 1 if you have the `vasprintf' function. */
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define HAVE_VASPRINTF 1 #define HAVE_VASPRINTF 1
#else #else
#undef HAVE_VASPRINTF #undef HAVE_VASPRINTF
#endif #endif
/* Define to 1 if you have the `vprintf' function. */ /* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1 #define HAVE_VPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */ /* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsyslog' function. */ /* Define to 1 if you have the `vsyslog' function. */
#undef HAVE_VSYSLOG #undef HAVE_VSYSLOG
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/ */
#undef LT_OBJDIR #undef LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */ /* #undef NO_MINUS_C_MINUS_O */
/* Name of package */ /* Name of package */
#define PACKAGE "json-c" #define PACKAGE "json-c"
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "json-c@googlegroups.com" #define PACKAGE_BUGREPORT "json-c@googlegroups.com"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "JSON C Library" #define PACKAGE_NAME "JSON C Library"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "JSON C Library 0.13.99" #define PACKAGE_STRING "JSON C Library 0.13.99"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "json-c" #define PACKAGE_TARNAME "json-c"
/* Define to the home page for this package. */ /* Define to the home page for this package. */
#define PACKAGE_URL "https://github.com/json-c/json-c" #define PACKAGE_URL "https://github.com/json-c/json-c"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "0.13.99" #define PACKAGE_VERSION "0.13.99"
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version number of package */ /* Version number of package */
#define VERSION "0.13.99" #define VERSION "0.13.99"
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */
/* Define to rpl_malloc if the replacement function should be used. */ /* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */ /* #undef malloc */
/* Define to rpl_realloc if the replacement function should be used. */ /* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */ /* #undef realloc */
/* Define to `unsigned int' if <sys/types.h> does not define. */ /* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */ /* #undef size_t */

View File

@@ -264,4 +264,3 @@ Issues and Pull Requests closed for the 0.13 release
[Memory leak for json_tokener_parse_ex for version 0.12.1](https://api.github.com/repos/json-c/json-c/issues/382) [Memory leak for json_tokener_parse_ex for version 0.12.1](https://api.github.com/repos/json-c/json-c/issues/382)
[Fix a compiler warning.](https://api.github.com/repos/json-c/json-c/issues/383) [Fix a compiler warning.](https://api.github.com/repos/json-c/json-c/issues/383)
[Fix a VS 2015 compiler warnings.](https://api.github.com/repos/json-c/json-c/issues/384) [Fix a VS 2015 compiler warnings.](https://api.github.com/repos/json-c/json-c/issues/384)

View File

@@ -197,7 +197,7 @@ int json_object_put(struct json_object *jso)
#if defined(HAVE_ATOMIC_BUILTINS) && defined(ENABLE_THREADING) #if defined(HAVE_ATOMIC_BUILTINS) && defined(ENABLE_THREADING)
/* Note: this only allow the refcount to remain correct /* Note: this only allow the refcount to remain correct
* when multiple threads are adjusting it. It is still an error * when multiple threads are adjusting it. It is still an error
* for a thread to decrement the refcount if it doesn't "own" it, * for a thread to decrement the refcount if it doesn't "own" it,
* as that can result in the thread that loses the race to 0 * as that can result in the thread that loses the race to 0
* operating on an already-freed object. * operating on an already-freed object.

View File

@@ -377,7 +377,7 @@ JSON_EXPORT int json_object_object_add(struct json_object *obj, const char *key,
* @param obj the json_object instance * @param obj the json_object instance
* @param key the object field name (a private copy will be duplicated) * @param key the object field name (a private copy will be duplicated)
* @param val a json_object or NULL member to associate with the given field * @param val a json_object or NULL member to associate with the given field
* @param opts process-modifying options. To specify multiple options, use * @param opts process-modifying options. To specify multiple options, use
* arithmetic or (OPT1|OPT2) * arithmetic or (OPT1|OPT2)
*/ */
JSON_EXPORT int json_object_object_add_ex(struct json_object *obj, const char *const key, JSON_EXPORT int json_object_object_add_ex(struct json_object *obj, const char *const key,
@@ -585,7 +585,7 @@ JSON_EXPORT struct json_object *json_object_array_get_idx(const struct json_obje
/** Delete an elements from a specified index in an array (a json_object of type json_type_array) /** Delete an elements from a specified index in an array (a json_object of type json_type_array)
* *
* The reference count will be decremented for each of the deleted objects. If there * The reference count will be decremented for each of the deleted objects. If there
* are no more owners of an element that is being deleted, then the value is * are no more owners of an element that is being deleted, then the value is
* freed. Otherwise, the reference to the value will remain in memory. * freed. Otherwise, the reference to the value will remain in memory.
* *
* @param obj the json_object instance * @param obj the json_object instance
@@ -617,8 +617,8 @@ JSON_EXPORT struct json_object *json_object_new_boolean(json_bool b);
JSON_EXPORT json_bool json_object_get_boolean(const struct json_object *obj); JSON_EXPORT json_bool json_object_get_boolean(const struct json_object *obj);
/** Set the json_bool value of a json_object /** Set the json_bool value of a json_object
* *
* The type of obj is checked to be a json_type_boolean and 0 is returned * The type of obj is checked to be a json_type_boolean and 0 is returned
* if it is not without any further actions. If type of obj is json_type_boolean * if it is not without any further actions. If type of obj is json_type_boolean
* the object value is changed to new_value * the object value is changed to new_value
* *
@@ -667,8 +667,8 @@ JSON_EXPORT struct json_object *json_object_new_uint64(uint64_t i);
JSON_EXPORT int32_t json_object_get_int(const struct json_object *obj); JSON_EXPORT int32_t json_object_get_int(const struct json_object *obj);
/** Set the int value of a json_object /** Set the int value of a json_object
* *
* The type of obj is checked to be a json_type_int and 0 is returned * The type of obj is checked to be a json_type_int and 0 is returned
* if it is not without any further actions. If type of obj is json_type_int * if it is not without any further actions. If type of obj is json_type_int
* the object value is changed to new_value * the object value is changed to new_value
* *
@@ -725,8 +725,8 @@ JSON_EXPORT int64_t json_object_get_int64(const struct json_object *obj);
JSON_EXPORT uint64_t json_object_get_uint64(const struct json_object *obj); JSON_EXPORT uint64_t json_object_get_uint64(const struct json_object *obj);
/** Set the int64_t value of a json_object /** Set the int64_t value of a json_object
* *
* The type of obj is checked to be a json_type_int and 0 is returned * The type of obj is checked to be a json_type_int and 0 is returned
* if it is not without any further actions. If type of obj is json_type_int * if it is not without any further actions. If type of obj is json_type_int
* the object value is changed to new_value * the object value is changed to new_value
* *
@@ -851,8 +851,8 @@ JSON_EXPORT int json_object_double_to_json_string(struct json_object *jso, struc
JSON_EXPORT double json_object_get_double(const struct json_object *obj); JSON_EXPORT double json_object_get_double(const struct json_object *obj);
/** Set the double value of a json_object /** Set the double value of a json_object
* *
* The type of obj is checked to be a json_type_double and 0 is returned * The type of obj is checked to be a json_type_double and 0 is returned
* if it is not without any further actions. If type of obj is json_type_double * if it is not without any further actions. If type of obj is json_type_double
* the object value is changed to new_value * the object value is changed to new_value
* *
@@ -924,8 +924,8 @@ JSON_EXPORT int json_object_get_string_len(const struct json_object *obj);
JSON_EXPORT int json_object_set_string(json_object *obj, const char *new_value); JSON_EXPORT int json_object_set_string(json_object *obj, const char *new_value);
/** Set the string value of a json_object str /** Set the string value of a json_object str
* *
* The type of obj is checked to be a json_type_string and 0 is returned * The type of obj is checked to be a json_type_string and 0 is returned
* if it is not without any further actions. If type of obj is json_type_string * if it is not without any further actions. If type of obj is json_type_string
* the object value is changed to new_value * the object value is changed to new_value
* *
@@ -969,7 +969,7 @@ JSON_EXPORT int json_object_equal(struct json_object *obj1, struct json_object *
* When shallow_copy is called *dst will be NULL, and must be non-NULL when it returns. * When shallow_copy is called *dst will be NULL, and must be non-NULL when it returns.
* src will never be NULL. * src will never be NULL.
* *
* If shallow_copy sets the serializer on an object, return 2 to indicate to * If shallow_copy sets the serializer on an object, return 2 to indicate to
* json_object_deep_copy that it should not attempt to use the standard userdata * json_object_deep_copy that it should not attempt to use the standard userdata
* copy function. * copy function.
* *
@@ -980,7 +980,7 @@ typedef int(json_c_shallow_copy_fn)(json_object *src, json_object *parent, const
/** /**
* The default shallow copy implementation for use with json_object_deep_copy(). * The default shallow copy implementation for use with json_object_deep_copy().
* This simply calls the appropriate json_object_new_<type>() function and * This simply calls the appropriate json_object_new_<type>() function and
* copies over the serializer function (_to_json_string internal field of * copies over the serializer function (_to_json_string internal field of
* the json_object structure) but not any _userdata or _user_delete values. * the json_object structure) but not any _userdata or _user_delete values.
* *

View File

@@ -25,7 +25,7 @@ typedef int(json_c_visit_userfunc)(json_object *jso, int flags, json_object *par
* userfunc must return one of the defined return values, to indicate * userfunc must return one of the defined return values, to indicate
* whether and how to continue visiting nodes, or one of various ways to stop. * whether and how to continue visiting nodes, or one of various ways to stop.
* *
* Returns 0 if nodes were visited successfully, even if some were * Returns 0 if nodes were visited successfully, even if some were
* intentionally skipped due to what userfunc returned. * intentionally skipped due to what userfunc returned.
* Returns <0 if an error occurred during iteration, including if * Returns <0 if an error occurred during iteration, including if
* userfunc returned JSON_C_VISIT_RETURN_ERROR. * userfunc returned JSON_C_VISIT_RETURN_ERROR.
@@ -58,7 +58,7 @@ JSON_EXPORT int json_c_visit(json_object *jso, int future_flags, json_c_visit_us
* This json_c_visit_userfunc return value indicates that iteration * This json_c_visit_userfunc return value indicates that iteration
* of the fields/elements of the <b>containing</b> object should stop * of the fields/elements of the <b>containing</b> object should stop
* and continue "popped up" a level of the object hierarchy. * and continue "popped up" a level of the object hierarchy.
* For example, returning this when handling arg will result in * For example, returning this when handling arg will result in
* arg3 and any other fields being skipped. The next call to userfunc * arg3 and any other fields being skipped. The next call to userfunc
* will be the JSON_C_VISIT_SECOND call on "foo", followed by a userfunc * will be the JSON_C_VISIT_SECOND call on "foo", followed by a userfunc
* call on "bar". * call on "bar".

View File

@@ -15,7 +15,7 @@
/** /**
* @file * @file
* @brief Internal string buffer handing. Unless you're writing a * @brief Internal string buffer handing. Unless you're writing a
* json_object_to_json_string_fn implementation for use with * json_object_to_json_string_fn implementation for use with
* json_object_set_serializer() direct use of this is not * json_object_set_serializer() direct use of this is not
* recommended. * recommended.

View File

@@ -51,4 +51,3 @@ target_link_libraries(
) )
endforeach(TESTNAME) endforeach(TESTNAME)

View File

@@ -90,7 +90,7 @@ run_output_test()
fi fi
TEST_COMMAND="$1" TEST_COMMAND="$1"
shift shift
if [ -z "${TEST_OUTPUT}" ] ; then if [ -z "${TEST_OUTPUT}" ] ; then
TEST_OUTPUT=${TEST_COMMAND} TEST_OUTPUT=${TEST_COMMAND}
fi fi

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2016 by Rainer Gerhards /* Copyright (C) 2016 by Rainer Gerhards
* Released under ASL 2.0 */ * Released under ASL 2.0 */
#include "config.h" #include "config.h"
#include "json_object.h" #include "json_object.h"