rapidjson.git
4 days agoMerge pull request #1567 from AtnNn/master master
Milo Yip [Thu, 12 Sep 2019 09:40:00 +0000 (17:40 +0800)]
Merge pull request #1567 from AtnNn/master

Allow pointer tokens to have non-null-terminated strings

4 days agoadd test for non-null-terminated token 1567/head
Etienne Laurin [Thu, 12 Sep 2019 07:12:06 +0000 (08:12 +0100)]
add test for non-null-terminated token

4 days agofix template parameter
Etienne Laurin [Wed, 11 Sep 2019 16:23:15 +0000 (17:23 +0100)]
fix template parameter

4 days agoAllow pointer tokens to have non-null-terminated strings
Etienne Laurin [Wed, 11 Sep 2019 16:03:35 +0000 (17:03 +0100)]
Allow pointer tokens to have non-null-terminated strings

3 weeks agoMerge pull request #1557 from MBoldyrev/doc/fix-uint-case
Milo Yip [Fri, 23 Aug 2019 07:07:50 +0000 (15:07 +0800)]
Merge pull request #1557 from MBoldyrev/doc/fix-uint-case

Documentation: fixed Uint case

3 weeks agofixed Uint case in docs 1557/head
Mikhail Boldyrev [Thu, 22 Aug 2019 16:55:00 +0000 (19:55 +0300)]
fixed Uint case in docs

2 months agoChange all GenericMemberIterator from struct to class
Milo Yip [Fri, 28 Jun 2019 02:37:13 +0000 (10:37 +0800)]
Change all GenericMemberIterator from struct to class

4 months agoMerge pull request #1506 from ylavic/CreatePattern
Milo Yip [Fri, 17 May 2019 01:27:30 +0000 (09:27 +0800)]
Merge pull request #1506 from ylavic/CreatePattern

Add missing curly brackets in STDREGEX's CreatePattern().

4 months agoAdd missing curly brackets in STDREGEX's CreatePattern(). 1506/head
ylavic [Mon, 29 Apr 2019 13:06:52 +0000 (15:06 +0200)]
Add missing curly brackets in STDREGEX's CreatePattern().

5 months agoMerge pull request #1488 from somone23412/somone23412-fix-typo-1
Milo Yip [Mon, 15 Apr 2019 01:25:18 +0000 (09:25 +0800)]
Merge pull request #1488 from somone23412/somone23412-fix-typo-1

Update pointer.zh-cn.md : fix typo

5 months agofix typo 1488/head
quyan [Sun, 14 Apr 2019 16:43:37 +0000 (00:43 +0800)]
fix typo

5 months agoMerge pull request #1481 from liangdzou/patch-1
Milo Yip [Tue, 9 Apr 2019 05:21:59 +0000 (13:21 +0800)]
Merge pull request #1481 from liangdzou/patch-1

add missing header "ios"

5 months agoadd missing header "ios" 1481/head
Liang ZOU [Tue, 9 Apr 2019 02:55:57 +0000 (10:55 +0800)]
add missing header "ios"

add missing header "ios" for symbol "std:: streamsize"

5 months agoMerge pull request #1479 from MaxXSoft/patch-tutorial
Milo Yip [Tue, 9 Apr 2019 01:42:14 +0000 (09:42 +0800)]
Merge pull request #1479 from MaxXSoft/patch-tutorial

doc/tutorial.zh-cn: fixed some typos

5 months agodoc/tutorial.zh-cn: fixed some typos 1479/head
MaxXSoft [Mon, 8 Apr 2019 11:20:06 +0000 (19:20 +0800)]
doc/tutorial.zh-cn: fixed some typos

5 months agoMerge pull request #1477 from eisaev/patch-1
Milo Yip [Thu, 4 Apr 2019 06:50:21 +0000 (14:50 +0800)]
Merge pull request #1477 from eisaev/patch-1

Fixed typo in allocators.h

5 months agoUpdate allocators.h 1477/head
eisaev [Wed, 3 Apr 2019 17:10:30 +0000 (22:10 +0500)]
Update allocators.h

Fixed typo

6 months agoMerge pull request #1462 from ra1u/master
Milo Yip [Mon, 11 Mar 2019 02:35:27 +0000 (10:35 +0800)]
Merge pull request #1462 from ra1u/master

Allow user to define custom RAPIDJSON_NOEXCEPT_ASSERT macro

6 months agoAllow user to define custom RAPIDJSON_NOEXCEPT_ASSERT macro 1462/head
Luka Rahne [Sun, 10 Mar 2019 17:52:46 +0000 (18:52 +0100)]
Allow user to define custom RAPIDJSON_NOEXCEPT_ASSERT macro

6 months agoMerge pull request #727 from mapbox/silence-dereference-null-pointer
Milo Yip [Wed, 6 Mar 2019 01:33:13 +0000 (09:33 +0800)]
Merge pull request #727 from mapbox/silence-dereference-null-pointer

Silence false positive clang-tidy warning

7 months agoUpdate doxygen download URL
Milo Yip [Mon, 11 Feb 2019 07:17:59 +0000 (15:17 +0800)]
Update doxygen download URL

7 months agoWorkaround of sortkeys example
Milo Yip [Mon, 11 Feb 2019 06:14:35 +0000 (14:14 +0800)]
Workaround of sortkeys example

7 months agoAdding swap() for GenericMember
Milo Yip [Fri, 8 Feb 2019 03:39:25 +0000 (11:39 +0800)]
Adding swap() for GenericMember

7 months agoFix gcc compilation error in sortkeys
Milo Yip [Wed, 6 Feb 2019 12:35:20 +0000 (20:35 +0800)]
Fix gcc compilation error in sortkeys

7 months agoUpdate sortkeys.cpp
Milo Yip [Wed, 6 Feb 2019 11:59:09 +0000 (19:59 +0800)]
Update sortkeys.cpp

7 months agoMerge pull request #1421 from HomeControlAS/sort_by_name_example
Milo Yip [Wed, 6 Feb 2019 11:52:54 +0000 (19:52 +0800)]
Merge pull request #1421 from HomeControlAS/sort_by_name_example

added example for sorting keys

7 months agoMerge pull request #1439 from ylavic/schema_pointer_allocator
Milo Yip [Wed, 6 Feb 2019 11:31:03 +0000 (19:31 +0800)]
Merge pull request #1439 from ylavic/schema_pointer_allocator

Use the allocator of the Schema for its Pointer.

7 months agoMerge pull request #1442 from rbilovol/cmake-fixup
Milo Yip [Wed, 6 Feb 2019 11:30:43 +0000 (19:30 +0800)]
Merge pull request #1442 from rbilovol/cmake-fixup

CMake: remove hardcoded CMAKECONFIG_INSTALL_DIR path

7 months agoMerge pull request #1444 from leolchat/patch-1
Milo Yip [Wed, 6 Feb 2019 11:30:11 +0000 (19:30 +0800)]
Merge pull request #1444 from leolchat/patch-1

Correct complexity claim

7 months agoCorrect complexity claim 1444/head
Léonard Gérard [Fri, 1 Feb 2019 06:29:07 +0000 (22:29 -0800)]
Correct complexity claim

7 months agoCMake: remove hardcoded CMAKECONFIG_INSTALL_DIR path 1442/head
Ruslan Bilovol [Thu, 24 Jan 2019 16:11:39 +0000 (18:11 +0200)]
CMake: remove hardcoded CMAKECONFIG_INSTALL_DIR path

Currently this path is hardcoded to lib/cmake.
Some distributions have different library path (like lib64).
So reuse LIB_INSTALL_DIR for that to make CMAKECONFIG_INSTALL_DIR
configurable and usable in such distros.

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
8 months agoUse the allocator of the Schema for its Pointer. 1439/head
ylavic [Thu, 10 Jan 2019 17:42:16 +0000 (18:42 +0100)]
Use the allocator of the Schema for its Pointer.

The Pointer passed to construct the Schema can be from the stack or any
transient storage, so the copy stored in the Schema must have the same
lifetime/allocator as the Schema itself.

8 months agoMerge pull request #1426 from ylavic/pointer_less_than
Milo Yip [Wed, 19 Dec 2018 08:25:09 +0000 (16:25 +0800)]
Merge pull request #1426 from ylavic/pointer_less_than

Add "less than" operator to Pointer.

8 months agoMerge branch 'master' into pointer_less_than 1426/head
Milo Yip [Tue, 18 Dec 2018 01:32:09 +0000 (09:32 +0800)]
Merge branch 'master' into pointer_less_than

8 months agoMerge pull request #1431 from ylavic/pointer_swap
Milo Yip [Tue, 18 Dec 2018 01:31:05 +0000 (09:31 +0800)]
Merge pull request #1431 from ylavic/pointer_swap

Allow to (std::)Swap two pointers.

8 months agoPointer tests now need <algorithm> (for std::swap), but no tabs. 1431/head
ylavic [Mon, 17 Dec 2018 13:42:09 +0000 (14:42 +0100)]
Pointer tests now need <algorithm> (for std::swap), but no tabs.

8 months agoAllow to (std::)Swap two pointers.
ylavic [Mon, 17 Dec 2018 13:33:32 +0000 (14:33 +0100)]
Allow to (std::)Swap two pointers.

9 months agoSpeed up Pointer::operator<().
ylavic [Wed, 12 Dec 2018 21:32:56 +0000 (22:32 +0100)]
Speed up Pointer::operator<().

Speed is more important than alphabetical order (which makes few sense in
JSON in general, and with pointers especially). The use case is indexing
in std containers, i.e. O(log n) with rbtree, so the faster comparison
the better.

9 months agoRework Pointer::operator<() loop.
ylavic [Mon, 10 Dec 2018 23:40:05 +0000 (00:40 +0100)]
Rework Pointer::operator<() loop.

I must be too dumb to understand the mess MSVC (32bit only) did with the
previous loop, and to figure out how it might have make it never end.
Anyway, hopefully any compiler can grok this new loop...

9 months agoUnit test for Pointer::operator<().
ylavic [Mon, 10 Dec 2018 23:19:13 +0000 (00:19 +0100)]
Unit test for Pointer::operator<().

9 months agoAdd less than operator to Pointer.
ylavic [Mon, 10 Dec 2018 20:47:43 +0000 (21:47 +0100)]
Add less than operator to Pointer.

Allows to sort pointers in (std-)containers and/or index by them.

9 months agoMerge pull request #1425 from ylavic/filereadstream_peek4
Milo Yip [Thu, 6 Dec 2018 15:44:10 +0000 (23:44 +0800)]
Merge pull request #1425 from ylavic/filereadstream_peek4

Fix off by one in FileReadStream::Peek4()

9 months agoMerge pull request #1424 from ylavic/file_input_streams
Milo Yip [Thu, 6 Dec 2018 15:43:48 +0000 (23:43 +0800)]
Merge pull request #1424 from ylavic/file_input_streams

Optimize FileReadStream and BasicIStreamWrapper.

9 months agoMerge pull request #1416 from ylavic/regex_syntax_noassert
Milo Yip [Thu, 6 Dec 2018 15:41:45 +0000 (23:41 +0800)]
Merge pull request #1416 from ylavic/regex_syntax_noassert

GenericRegex: don't throw/abort on syntax error (unclosed parenthesis).

9 months agoFix FileReadStream::Peek4(). 1425/head
ylavic [Wed, 5 Dec 2018 23:48:47 +0000 (00:48 +0100)]
Fix FileReadStream::Peek4().

Until Read() reaches EOF, Peek4() must not take off by one in
bufferLast_ into account; otherwise a buffer of size exactly 4 always
returns NULL.

9 months agoBase buffered BasicIStreamWrapper on the original (better performing) FileReadStream... 1424/head
ylavic [Wed, 5 Dec 2018 23:21:05 +0000 (00:21 +0100)]
Base buffered BasicIStreamWrapper on the original (better performing) FileReadStream algorithm.

9 months agoPossibly std::ios::binary helps with streams on Windows
ylavic [Wed, 5 Dec 2018 17:35:45 +0000 (18:35 +0100)]
Possibly std::ios::binary helps with streams on Windows

9 months agoOptimize FileReadStream and BasicIStreamWrapper.
ylavic [Wed, 5 Dec 2018 15:06:12 +0000 (16:06 +0100)]
Optimize FileReadStream and BasicIStreamWrapper.

On (my) linux, perftest reports:
- ~40% gain for FileReadStream (Take() loop),
- ~10% gain for ReaderParse_DummyHandler_FileReadStream.

With the same logic applied to BasicIStreamWrapper, which thus can now
also be created with a user buffer, performances align with those of
FileReadStream (same buffer size).

The "unbuffered" versions (added for FileReadStream) work solely with
the internal peekBuffer (Ch[4]) and are measured in perftest.  When
performances don't matter much, they can avoid the use of large
stack/heap buffers.

9 months agoremoved std::string and receiving const Value in printIt 1421/head
seky [Wed, 5 Dec 2018 07:24:59 +0000 (08:24 +0100)]
removed std::string and receiving const Value in printIt

9 months agoadded example for sorting keys
seky [Tue, 4 Dec 2018 21:40:40 +0000 (22:40 +0100)]
added example for sorting keys

9 months agoUnit test for invalid GenericRegex (unclosed parenthesis). 1416/head
ylavic [Mon, 3 Dec 2018 10:49:34 +0000 (11:49 +0100)]
Unit test for invalid GenericRegex (unclosed parenthesis).

9 months agoGenericRegex: don't throw/abort on syntax error (unclosed parenthesis).
ylavic [Sun, 2 Dec 2018 22:26:58 +0000 (23:26 +0100)]
GenericRegex: don't throw/abort on syntax error (unclosed parenthesis).

9 months agoMerge pull request #1413 from ylavic/schema_regex_leak
Milo Yip [Mon, 3 Dec 2018 01:53:39 +0000 (09:53 +0800)]
Merge pull request #1413 from ylavic/schema_regex_leak

Fix a memory leak for invalid std::regex in Schema.

9 months agoMerge pull request #1414 from ylavic/regex_allocator
Milo Yip [Mon, 3 Dec 2018 01:51:50 +0000 (09:51 +0800)]
Merge pull request #1414 from ylavic/regex_allocator

Use passed in allocator for internal regex parser.

9 months agoFix a memory leak for invalid std::regex in Schema. 1413/head
ylavic [Sat, 1 Dec 2018 22:36:45 +0000 (23:36 +0100)]
Fix a memory leak for invalid std::regex in Schema.

9 months agoUse passed in allocator for internal regex parser. 1414/head
ylavic [Sat, 1 Dec 2018 18:32:23 +0000 (19:32 +0100)]
Use passed in allocator for internal regex parser.

9 months agoMerge pull request #1388 from yhager/yhager/clang-7
Milo Yip [Thu, 22 Nov 2018 04:30:02 +0000 (12:30 +0800)]
Merge pull request #1388 from yhager/yhager/clang-7

silence clang-7 self-assign-overloaded warning

9 months agoMerge pull request #1403 from jcmonnin/fix-warning
Milo Yip [Thu, 22 Nov 2018 04:22:41 +0000 (12:22 +0800)]
Merge pull request #1403 from jcmonnin/fix-warning

Fix warning when NDEBUG is defined [-Wunused-variable]

9 months agoFix warning when NDEBUG is defined [-Wunused-variable] 1403/head
Jean-Claude Monnin [Wed, 21 Nov 2018 12:24:06 +0000 (13:24 +0100)]
Fix warning when NDEBUG is defined [-Wunused-variable]

Because `isPeek()` is side effect free this should not change anything.

The reason this warning is not shown in the unit tests is because the asserts
are always evaluated in the unit test:

#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)

10 months agoUpdate test/unittest/pointertest.cpp 1388/head
Philipp A. Hartmann [Thu, 1 Nov 2018 03:31:04 +0000 (20:31 -0700)]
Update test/unittest/pointertest.cpp

Co-Authored-By: yhager <yhager@users.noreply.github.com>
10 months agosilence clang-7 self-assign-overloaded warning
Yuval Hager [Fri, 26 Oct 2018 21:58:57 +0000 (14:58 -0700)]
silence clang-7 self-assign-overloaded warning

11 months agoMerge pull request #1373 from lelit/issue1368
Milo Yip [Mon, 8 Oct 2018 16:20:35 +0000 (00:20 +0800)]
Merge pull request #1373 from lelit/issue1368

Add test case on kParseNumbersAsStringsFlag being able to load big ints

11 months agoAdd test case on kParseNumbersAsStringsFlag being able to load big ints 1373/head
Lele Gaifax [Mon, 8 Oct 2018 08:21:25 +0000 (10:21 +0200)]
Add test case on kParseNumbersAsStringsFlag being able to load big ints

See issue #1368.

11 months agoAvoid pointer arithmetic on null pointer to remove undefined behavior 727/head
Konstantin Käfer [Thu, 1 Sep 2016 10:10:03 +0000 (12:10 +0200)]
Avoid pointer arithmetic on null pointer to remove undefined behavior

The existing checks triggered undefined behavior when the stack was empty (null pointer). This change avoid this:
* If `stackTop_` and `stackEnd_` are null, it results in a `ptrdiff_t` of `0`
* If `stackTop_` and `stackEnd_` are valid pointers, they produce a `ptrdiff_t` with the remaining size on the stack

11 months agoMerge pull request #1362 from jiapengwen/master
Milo Yip [Wed, 19 Sep 2018 04:58:56 +0000 (12:58 +0800)]
Merge pull request #1362 from jiapengwen/master

fix tutorial error

11 months agoMerge pull request #1364 from jcourtat/fixfaq
Milo Yip [Wed, 19 Sep 2018 04:58:14 +0000 (12:58 +0800)]
Merge pull request #1364 from jcourtat/fixfaq

faq: fix document insertion example

11 months agofaq: fix document insertion example 1364/head
Julien Courtat [Tue, 18 Sep 2018 12:51:12 +0000 (14:51 +0200)]
faq: fix document insertion example

GenericDocument contructor requires a pointer to an Allocator, but GetAllocator() only
returns a reference.

Signed-off-by: Julien Courtat <julien.courtat@aqsacom.com>
11 months agofix tutorial error 1362/head
jiapeng.wen [Tue, 18 Sep 2018 02:51:16 +0000 (10:51 +0800)]
fix tutorial error

12 months agoMerge pull request #1329 from pah/fix-noexcept
Milo Yip [Tue, 11 Sep 2018 02:13:09 +0000 (10:13 +0800)]
Merge pull request #1329 from pah/fix-noexcept

Add RAPIDJSON_NOEXCEPT_ASSERT

12 months agoMerge pull request #1356 from gongminmin/AppVeyor2017
Milo Yip [Mon, 10 Sep 2018 08:59:39 +0000 (16:59 +0800)]
Merge pull request #1356 from gongminmin/AppVeyor2017

Update appveyor rule to support VS2017.

12 months agoUpdate rapidjson.h 1329/head
Milo Yip [Mon, 10 Sep 2018 05:11:17 +0000 (13:11 +0800)]
Update rapidjson.h

12 months agoUpdate appveyor rule to support VS2017. 1356/head
Minmin Gong [Mon, 16 Jul 2018 07:15:50 +0000 (00:15 -0700)]
Update appveyor rule to support VS2017.

12 months agoMerge branch 'master' into fix-noexcept
Milo Yip [Mon, 10 Sep 2018 03:27:45 +0000 (11:27 +0800)]
Merge branch 'master' into fix-noexcept

12 months agoMerge pull request #1327 from gongminmin/FixCompileInVS
Milo Yip [Mon, 10 Sep 2018 03:23:26 +0000 (11:23 +0800)]
Merge pull request #1327 from gongminmin/FixCompileInVS

Fix the compiling problems in VS

12 months agoMerge pull request #1302 from chwarr/min-max-guard
Milo Yip [Mon, 10 Sep 2018 03:22:28 +0000 (11:22 +0800)]
Merge pull request #1302 from chwarr/min-max-guard

Guard against min/max being macros in reader.h

12 months agoMerge pull request #1284 from mobileben/noexcept-assert
Milo Yip [Mon, 10 Sep 2018 03:21:34 +0000 (11:21 +0800)]
Merge pull request #1284 from mobileben/noexcept-assert

Handle non-throwing exception specifications that can still throw #1280

13 months agoMerge pull request #1340 from lelit/issue1336
Milo Yip [Sun, 5 Aug 2018 11:01:46 +0000 (19:01 +0800)]
Merge pull request #1340 from lelit/issue1336

Wrap all WriteXxx() calls within EndValue()

13 months agoExtend the test on issue #1336 to cover all basic types 1340/head
Lele Gaifax [Sun, 5 Aug 2018 07:44:15 +0000 (09:44 +0200)]
Extend the test on issue #1336 to cover all basic types

13 months agoAdd simple test for issue #1336
Lele Gaifax [Fri, 3 Aug 2018 10:34:03 +0000 (12:34 +0200)]
Add simple test for issue #1336

13 months agoWrap all WriteXxx() calls within EndValue(), to ensure a flush after root-level scala...
Lele Gaifax [Fri, 3 Aug 2018 10:17:29 +0000 (12:17 +0200)]
Wrap all WriteXxx() calls within EndValue(), to ensure a flush after root-level scalar value

This attempts to fix issue #1336.

13 months agoMerge pull request #1331 from JPEWdev/mem-alignment-fix
Milo Yip [Wed, 1 Aug 2018 03:56:25 +0000 (11:56 +0800)]
Merge pull request #1331 from JPEWdev/mem-alignment-fix

Fix SIGBUS due to unaligned access

13 months agoMerge pull request #1335 from IceTrailer/master
Milo Yip [Wed, 1 Aug 2018 03:55:44 +0000 (11:55 +0800)]
Merge pull request #1335 from IceTrailer/master

Fixed parentheses in reader.h which were required to prevent the using of max macro

13 months agoFixed parentheses in reader.h which were required to prevent the using of max macro 1335/head
IceTrailer [Tue, 31 Jul 2018 20:23:53 +0000 (22:23 +0200)]
Fixed parentheses in reader.h which were required to prevent the using of max macro

13 months agoFix SIGBUS due to unaligned access 1331/head
Veselin Georgiev [Fri, 27 Jul 2018 18:33:09 +0000 (13:33 -0500)]
Fix SIGBUS due to unaligned access

Update RAPIDJSON_ALIGN() to always align on an 8-byte boundary
unless otherwise overridden.

On some platforms (such as ARM), 64-bit items (such as doubles and
64-bit integers) must be aligned to an 8 byte address, even though the
architecture is only 32-bits. On these platforms, MemoryPoolAllocator
must match the malloc() behavior and return a 8 byte aligned allocation.
This eliminates any alignment issues that may occur at the expense of
additional memory overhead.

Failure to do so caused a SIGBUS signal when calling
GenericValue::SetNull(). The size of the data_ member of the
GenericValue class is 16 bytes in 32-bit mode and its constructor
requires an 8-byte aligned access.

While parsing a JSON formatted string using Document::ParseStream(), a
stack object containing GenericValue items was constructed. Since the
stack was 8-byte aligned, the constructor calls would succeed. When the
lifetime of the object ends, SetObjectRaw() is invoked. This triggered
an allocation with 4-byte alignment to which the previously 8-byte
aligned GenericValue array was copied. After this, any call to a
GenericValue API that triggered the constructor and thus the placement
new operation on the Data type member would trigger a SIGBUS.

Signed-off-by: Veselin Georgiev <veselin.georgiev@garmin.com>
Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
13 months agoAdd RAPIDJSON_NOEXCEPT_ASSERT
Philipp A Hartmann [Wed, 18 Jul 2018 10:02:24 +0000 (12:02 +0200)]
Add RAPIDJSON_NOEXCEPT_ASSERT

This is an alternative implementation to #1284 to handle
asserts in noexcept contexts.

Closes #1280.

14 months agoUpdate the code to adapt the new gtest. 1327/head
Minmin Gong [Mon, 16 Jul 2018 23:03:02 +0000 (16:03 -0700)]
Update the code to adapt the new gtest.

14 months agoMerge pull request #1323 from pah/fix-memaccess
Milo Yip [Mon, 16 Jul 2018 04:22:46 +0000 (12:22 +0800)]
Merge pull request #1323 from pah/fix-memaccess

Fix warnings/errors on GCC 7/8 (-Wclass-memaccess, -Wsign-conversion, -Wformat-overflow)

14 months agoSuppress -Wformat-overflow warning/error 1323/head
Philipp A Hartmann [Sun, 15 Jul 2018 14:02:03 +0000 (16:02 +0200)]
Suppress -Wformat-overflow warning/error

GCC 7 and later warn about overflow/truncation when using
sprintf and related functions with fixed-size buffers.

Suppress the warning in schematest.cpp.

14 months agoFix -Wsign-conversion warnings/errors
Philipp A Hartmann [Sun, 15 Jul 2018 14:01:02 +0000 (16:01 +0200)]
Fix -Wsign-conversion warnings/errors

GCC 8 (incorrectly) warns about sign conversions in (constant)
array size expressions:

error: conversion to 'long unsigned int' from 'int' may
change the sign of the result [-Werror=sign-conversion]
     char schemaBuffer_[128 * 1024];

Make these expressions unsigned by adding a 'u' suffix to
the first operands.

14 months agoFix -Wclass-memaccess warnings/errors
Philipp A Hartmann [Sun, 15 Jul 2018 12:17:14 +0000 (14:17 +0200)]
Fix -Wclass-memaccess warnings/errors

Recent GCC versions warn about using memcpy/memmove to
write to a class pointer (-Wclass-memaccess).

Avoid the warnings by casting to void* first.

Closes #1086.
Closes #1205.
Closes #1246.

14 months agoMerge pull request #1320 from AnomalRoil/master
Milo Yip [Thu, 12 Jul 2018 15:31:19 +0000 (23:31 +0800)]
Merge pull request #1320 from AnomalRoil/master

Removing always true if condition

14 months agoRemoving always true if condition 1320/head
Yolan Romailler [Thu, 12 Jul 2018 13:13:06 +0000 (15:13 +0200)]
Removing always true if condition

14 months agoGuard against min/max being macros in reader.h 1302/head
Christopher Warrington [Wed, 27 Jun 2018 18:48:48 +0000 (11:48 -0700)]
Guard against min/max being macros in reader.h

Sometimes, particularly when Microsoft's windows.h is included, min/max
are defined as macros, interfering with use of
std::numeric_limits::min() and the like.

To guard against this, the function name is wrapped in an extra set of
parenthesis, which inhibits function-style macro expansion.

This is a similar commit to 6e38649ec6, but fixes uses of
std::numeric_limits added after that commit, like those introduced in
2ea43433e2.

14 months agoMerge pull request #1312 from erikfroseth/issue-1308
Milo Yip [Tue, 3 Jul 2018 12:28:24 +0000 (20:28 +0800)]
Merge pull request #1312 from erikfroseth/issue-1308

Detect C++11 features for Developer Studio

14 months agoDetect C++11 features for Developer Studio 1312/head
Erik Froseth [Tue, 3 Jul 2018 11:02:45 +0000 (13:02 +0200)]
Detect C++11 features for Developer Studio

This patch enables various C++11 features if the code is compiled with
Developer Studio compiler version 5.14 or higher.

14 months agoMerge pull request #1307 from moretromain/preprocessor_cleanup
Milo Yip [Tue, 3 Jul 2018 02:34:32 +0000 (10:34 +0800)]
Merge pull request #1307 from moretromain/preprocessor_cleanup

Rename a few internal preprocessor macros to avoid naming conflicts

14 months agoUpdated google test to latest commit 1309/head
Tim Miller [Mon, 2 Jul 2018 12:30:17 +0000 (08:30 -0400)]
Updated google test to latest commit

14 months agoRename a few internal preprocessor macros to avoid potential naming conflicts 1307/head
Romain Moret [Mon, 2 Jul 2018 11:24:18 +0000 (13:24 +0200)]
Rename a few internal preprocessor macros to avoid potential naming conflicts

14 months agoMerge pull request #1252 from StilesCrisis/issue-1251-test
Milo Yip [Tue, 19 Jun 2018 04:43:54 +0000 (12:43 +0800)]
Merge pull request #1252 from StilesCrisis/issue-1251-test

Unit Test: Parsing "128.74836467836484838364836483643636483648e-336" causes a crash

14 months agoMerge pull request #1250 from StilesCrisis/issue-1249-test
Milo Yip [Mon, 18 Jun 2018 15:54:53 +0000 (23:54 +0800)]
Merge pull request #1250 from StilesCrisis/issue-1249-test

Unit Test: Parsing "0e100" in full precision mode causes UB