1
0
mirror of https://github.com/nlohmann/json synced 2024-12-02 00:20:06 +00:00

Merge branch 'develop' into feature/iterator_range_parsing

This commit is contained in:
Niels 2016-08-20 18:51:11 +02:00
commit 6f3554f040
5 changed files with 24 additions and 7 deletions

View File

@ -41,6 +41,20 @@ matrix:
after_success:
- valgrind --error-exitcode=1 --leak-check=full test/json_unit
# cppcheck
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- SPECIAL=cppcheck
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-4.9, cppcheck]
after_success:
- make cppcheck
# Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/)
- os: linux

View File

@ -64,8 +64,7 @@ fuzz: test/src/fuzz.cpp src/json.hpp
# call cppcheck on the main header file
cppcheck:
cppcheck --enable=all --inconclusive --std=c++11 src/json.hpp
cppcheck --enable=warning --inconclusive --force --std=c++11 src/json.hpp --error-exitcode=1
##########################################################################
# maintainer targets

View File

@ -19,7 +19,7 @@ There are myriads of [JSON](http://json.org) libraries out there, and each may e
- **Trivial integration**. Our whole code consists of a single header file [`json.hpp`](https://github.com/nlohmann/json/blob/develop/src/json.hpp). That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings.
- **Serious testing**. Our class is heavily [unit-tested](https://github.com/nlohmann/json/blob/master/test/src/unit.cpp) and covers [100%](https://coveralls.io/r/nlohmann/json) of the code, including all exceptional behavior. Furthermore, we checked with [Valgrind](http://valgrind.org) that there are no memory leaks.
- **Serious testing**. Our class is heavily [unit-tested](https://github.com/nlohmann/json/blob/master/test/src/unit.cpp) and covers [100%](https://coveralls.io/r/nlohmann/json) of the code, including all exceptional behavior. Furthermore, we checked with [Valgrind](http://valgrind.org) that there are no memory leaks. To maintain high quality, the project is following the [Core Infrastructure Initiative (CII) best practices](https://bestpractices.coreinfrastructure.org/projects/289).
Other aspects were not so important to us:

View File

@ -9009,7 +9009,8 @@ basic_json_parser_63:
{
case lexer::token_type::begin_object:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::object_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
{
// explicitly set result to object to cope with {}
result.m_type = value_t::object;
@ -9087,7 +9088,8 @@ basic_json_parser_63:
case lexer::token_type::begin_array:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::array_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
{
// explicitly set result to object to cope with []
result.m_type = value_t::array;

View File

@ -8306,7 +8306,8 @@ class basic_json
{
case lexer::token_type::begin_object:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::object_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
{
// explicitly set result to object to cope with {}
result.m_type = value_t::object;
@ -8384,7 +8385,8 @@ class basic_json
case lexer::token_type::begin_array:
{
if (keep and (not callback or (keep = callback(depth++, parse_event_t::array_start, result))))
if (keep and (not callback
or ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
{
// explicitly set result to object to cope with []
result.m_type = value_t::array;