Commit Graph

1309 Commits

Author SHA1 Message Date
Jordan Bayles
3e4c8f8f1d
Merge pull request #935 from abigailbunyan/forward-declarations
Add missing classes to forwards.h
2019-06-24 12:50:59 -07:00
Jordan Bayles
83cc92161b Fix JSON_USE_EXCEPTION=0 use case
This patch fixes the JSON_USE_EXCEPTION flag. Currently, due to the
throwRuntimeError and throwLogicError methods implemented in json_value,
even if JSON_USE_EXCEPTION is set to 0 jsoncpp will still throw. This
breaks integration into projects with -fno-exceptions set, such as
Chromium.
2019-06-21 18:16:52 -05:00
Olivier LIESS
85f5b1c8f9 fixed typos 2019-06-03 16:31:07 +02:00
Abigail Bunyan
1234f4227b Add missing classes to forwards.h
Fixes #904.
2019-06-03 15:04:01 +01:00
Olivier LIESS
8d2095af3c cmake fixes 2019-06-03 12:45:24 +02:00
Olivier LIESS
0155f38b5b added cmake config version file for proper cmake delivery 2019-06-03 12:39:50 +02:00
David Demelier
5b91551f39 Rename version.md to version.txt 2019-04-24 23:56:30 -05:00
David Demelier
27290cf81d Use version.md in dev.makefile 2019-04-24 23:56:30 -05:00
David Demelier
27b9501683 Fix build with libc++, closes #910 2019-04-24 23:56:30 -05:00
Frank Richter
b16abf8ce1 Explicitly set JSON_API to 'default' visibility on clang & gcc 2019-04-08 18:08:25 -05:00
Christopher Dunn
cd1121290a
Merge pull request #901 from res2k/demand
Implement Value::demand()
2019-03-30 09:39:32 -05:00
Frank Richter
69402d1fbb Bump minor version, SOVERSION 2019-03-23 21:03:30 +01:00
Christopher Dunn
3e2f8d3ea8
Merge pull request #902 from res2k/fix-888
Fix #888
2019-03-23 14:43:56 -05:00
Frank Richter
99a99d4032 Cast to unsigned char in Value::setType() to appease gcc (issue #888) 2019-03-23 15:04:30 +01:00
Frank Richter
9a629bc5e1 tests: Add a comment 2019-03-23 14:39:59 +01:00
Frank Richter
d76fe5687d Implement Value::demand() 2019-03-23 14:32:13 +01:00
Frank Richter
eb7bd9546e Value::find(): Fix assert message 2019-03-23 14:32:13 +01:00
Frank Richter
0adb053294 tests: Add small checks for find() 2019-03-23 14:16:13 +01:00
Willem
863aa36165 Update README.md
Update the link to the conan page, as https://conan.io/source/jsoncpp/1.8.0/theirix/ci returns a 404.
2019-03-20 00:12:33 -05:00
Billy Donahue
9a55d22d3d remove JSON_HAS_RVALUE_REFERENCES 2019-03-01 06:32:18 -06:00
Billy Donahue
00558b38db VS2013 doesn't allow move ops to be =default 2019-03-01 06:31:58 -06:00
Billy Donahue
433107f1d9 refactor comments_ into a class 2019-03-01 06:31:58 -06:00
Christopher Dunn
a732207060
Merge pull request #883 from hjmjohnson/remove-msvc2010
COMP: Remove build files for unsupported IDE's
2019-02-28 22:26:50 -06:00
Marcel Raad
36d8cfd768 Fix macro redefinition warning with clang-cl
clang-cl defines _MSC_VER by default, so JSONCPP_DEPRECATED was first
defined for MSVC and then redefined for clang. Integrate the MSVC
definition into the block with clang and GCC's JSONCPP_DEPRECATED
definitions to fix this.
2019-02-28 22:19:13 -06:00
Hans Johnson
2ab1d63480 COMP: Remove visual studio specialization in favor of meson or cmake
More robust build environments can be generated from meson
or cmake rather than including those files in every download.
2019-01-24 09:57:56 -06:00
Hans Johnson
b4ca2db5ff COMP: Remove build files for unsupported IDE's
The msvc2010 and vs71 IDE's do not support sufficient
C++11 feature sets for jsoncpp.

Remove these build environments.

resolves: #882
2019-01-24 09:00:55 -06:00
Billy Donahue
0c1cc6e1a3
pack the {type,allocated} bitfield (#876)
* pack the {type,allocated} bitfield (Issue#873)
This allows special functions to be implemented more easily.
2019-01-20 23:59:16 -05:00
Billy Donahue
d85d75045c Issue #872: add json/allocator.h in the amalgamated header.
I don't know why we didn't include this before.
It seems to work fine.
2019-01-20 22:13:38 -05:00
Billy Donahue
2b593a9da8 apply the C++11 style change in .clang-format 2019-01-18 07:02:16 -06:00
Billy Donahue
756a08fbbd switch .clang-format to C++11 2019-01-18 07:02:16 -06:00
Hans Johnson
2c257590a1 BUG: VERSION_LESS_EQUAL introduced in cmake 3.7
Older versions of cmake, according to documentation:
https://cmake.org/cmake/help/v3.5/command/if.html , do not know
VERSION_LESS_EQUAL, just VERSION_LESS.

This leads to errors:

CMake Error at somewhere/jsoncpp/CMakeLists.txt:18 (if):
  if given arguments:

    "3.5.1" "VERSION_LESS_EQUAL" "3.13.1"

  Unknown arguments specified

Resolves: #866
2019-01-18 07:00:39 -06:00
Hans Johnson
deb6cca214 STYLE: FATAL_ERROR ignored in cmake_required_minimum since 2.6.0 2019-01-18 07:00:39 -06:00
Billy Donahue
b9ed29a221
Jsoncpp aliases 2 (#868)
convert JSONCPP_STRING etc from macros to typedefs
2019-01-17 23:26:28 -05:00
Billy Donahue
1c2ed7a10f convert JSONCPP_STRING etc from macros to typedefs 2019-01-17 23:14:18 -05:00
Billy Donahue
6e7cbf8f54
Merge pull request #867 from BillyDonahue/apply_clang_format
Reapply clang-format.
2019-01-17 15:30:37 -05:00
Billy Donahue
dc4a7f9b61 Reapply clang-format.
$ clang-format -i -style=file \
        $(find  . | egrep '.*\.(h|cpp|inl)$')
2019-01-17 11:11:55 -05:00
Hans Johnson
21a4185634 STYLE: Avoid unnecessary conversions from size_t to unsigned int
Make the index values consistent with size_t.
2019-01-15 18:30:49 -06:00
Hans Johnson
d11732043a STYLE: Pefer = delete to explicitly trivial implementations
This check replaces undefined special member functions with
= delete;. The explicitly deleted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly delted functions as noops.

Additionally, the C++11 use of = delete more clearly expreses the
intent for the special member functions.

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-equals-delete  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
e3e05c7085 STYLE: Pefer = default to explicitly trivial implementations
This check replaces default bodies of special member functions with
= default;. The explicitly defaulted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly defaulted functions as trivial.

Additionally, the C++11 use of = default more clearly expreses the
intent for the special member functions.

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-equals-default  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
e817e4fc25 STYLE: Use default member initialization
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-default-member-init  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
b5093e8122 PERF: Allow compiler to choose best way to construct a copy
With move semantics added to the language and the standard library updated with
move constructors added for many types it is now interesting to take an
argument directly by value, instead of by const-reference, and then copy. This
check allows the compiler to take care of choosing the best way to construct
the copy.

The transformation is usually beneficial when the calling code passes an rvalue
and assumes the move construction is a cheap operation. This short example
illustrates how the construction of the value happens:

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-pass-by-value  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
1fc3de7ca1 STYLE: Use auto for variable type matches the type of the initializer expression
This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-auto -header-filter = .* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
cbeed7b076 STYLE: Use range-based loops from C++11
C++11 Range based for loops can be used in

Used as a more readable equivalent to the traditional for loop operating over a
range of values, such as all elements in a container, in the forward direction..

Range based loopes are more explicit for only computing the
end location once for containers.

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-loop-convert  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
Hans Johnson
3beadff472 PERF: readability container size empty
The emptiness of a container should be checked using the empty() method
instead of the size() method. It is not guaranteed that size() is a
constant-time function, and it is generally more efficient and also
shows clearer intent to use empty(). Furthermore some containers may
implement the empty() method but not implement the size() method. Using
empty() whenever possible makes it easier to switch to another container
in the future.

SRCDIR=/Users/johnsonhj/src/jsoncpp/ #My local SRC
BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD

cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,readability-container-size-empty  -header-filter=.* -fix
2019-01-15 18:30:49 -06:00
James Clarke
d3d2e17b64 Switch to the VCPP dll 2019-01-15 09:01:19 -06:00
James Clarke
908383abeb Fix bogus asm setting 2019-01-15 09:01:19 -06:00
James Clarke
fdc0824505 Add amd64 support 2019-01-15 09:01:19 -06:00
James Clarke
4e8b4e313f Add support for VS2017 2019-01-15 09:01:19 -06:00
Hans Johnson
31d65711d6 ENH: Remove conditionals for unsupported VS compilers
Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported
compiler with sufficient C++11 capabilities

See:
https://blogs.msdn.microsoft.com/vcblog/2013/12/02/c1114-core-language-features-in-vs-2013-and-the-nov-2013-ctp/
for details related to language features supported.
2019-01-14 16:27:52 -06:00
Hans Johnson
2853b1cdac COMP: Use C++11 override directly
The override support in C++11 is required so avoid aliasing
this feature.  Compilers that do not support the override keyword
are no longer supported.
2019-01-14 16:14:12 -06:00