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: after_success:
- valgrind --error-exitcode=1 --leak-check=full test/json_unit - 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/) # Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/)
- os: linux - os: linux

View file

@ -64,8 +64,7 @@ fuzz: test/src/fuzz.cpp src/json.hpp
# call cppcheck on the main header file # call cppcheck on the main header file
cppcheck: 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 # 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. - **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: Other aspects were not so important to us:

View file

@ -9009,7 +9009,8 @@ basic_json_parser_63:
{ {
case lexer::token_type::begin_object: 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 {} // explicitly set result to object to cope with {}
result.m_type = value_t::object; result.m_type = value_t::object;
@ -9087,7 +9088,8 @@ basic_json_parser_63:
case lexer::token_type::begin_array: 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 [] // explicitly set result to object to cope with []
result.m_type = value_t::array; result.m_type = value_t::array;

View file

@ -8306,7 +8306,8 @@ class basic_json
{ {
case lexer::token_type::begin_object: 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 {} // explicitly set result to object to cope with {}
result.m_type = value_t::object; result.m_type = value_t::object;
@ -8384,7 +8385,8 @@ class basic_json
case lexer::token_type::begin_array: 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 [] // explicitly set result to object to cope with []
result.m_type = value_t::array; result.m_type = value_t::array;