987 Commits

Author SHA1 Message Date
Eli Fidler
61637d3382 avoid passing a null pointer to memcpy
UBSAN on Clang/Linux gave:
runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:45: note: nonnull attribute specified here
2016-06-13 07:24:26 -07:00
Eli Fidler
8074b722f0 avoid reference to null pointer and member access within null pointer
UBSAN gave issues with the typeless Schema:
runtime error: reference binding to null pointer of type 'rapidjson::GenericSchemaDocument<rapidjson::GenericValue<rapidjson::UTF16<wchar_t>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >, rapidjson::CrtAllocator>'
and
runtime error: member access within null pointer of type 'AllocatorType' (aka 'rapidjson::CrtAllocator')
2016-06-13 07:24:26 -07:00
Eli Fidler
fe550f3866 avoid array index out-of-bounds
UBSAN gave "runtime error: index 13 out of bounds for type 'const uint32_t [10]'"
2016-06-13 07:24:26 -07:00
Eli Fidler
89f6b8a380 Clang doesn't like the C-style casts in nmmintrin.h 2016-06-13 07:24:26 -07:00
Milo Yip
fee5190def Fix a clang warning 2016-06-13 09:34:47 +08:00
Michael Thon
135da7ab34 Allow options for writing and parsing NaN/Infinity
This adds kWriteNanAndInfFlag to Writer to allow writing of nan,
inf and -inf doubles as "NaN", "Infinity" and "-Infinity",
respectively, and kParseNanAndInfFlag to Reader to allow parsing
of "NaN", "Inf", "Infinity", "-Inf" and "-Infinity". This is part
of issue #36, adding optional support for relaxed JSON syntax.
2016-05-20 23:54:55 +02:00
Vlad Lipskiy
819ba73b17 Added missing include guards in istreamwrapper.h and ostreamwrapper.h 2016-05-10 18:09:01 +03:00
Milo Yip
7cc76a9d46 Fix #630 2016-05-10 13:20:03 +08:00
Bruce Stephens
ee4207b3f0 Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang
This makes no difference except that it avoids "warning: macro expansion
producing 'defined' has undefined behavior" messages.
2016-04-25 13:03:39 +01:00
Milo Yip
0fe08c222f Fix english error message gramma
Fix #606
2016-04-19 16:22:24 +08:00
Milo Yip
a6571d504a Combine objectDependices and objectRequired into propertyExist array 2016-04-19 15:10:28 +08:00
Milo Yip
f586edd33d Fix required for duplicated keys
Fix #608
2016-04-19 15:06:41 +08:00
Milo Yip
be352d9548 Fix a bug in regex
Due to dereferencing a pointer which may be invalidated
2016-04-17 11:59:09 +08:00
Milo Yip
01aeebf9bf Improve reader coverage by removing a default case 2016-04-17 09:47:29 +08:00
Milo Yip
a28e4befed Improve coverage of Regex by removing default case. 2016-04-17 09:34:04 +08:00
Milo Yip
ba0a137b9c Remove unnecessary code in GenericSchemaDocument::CreateSchemaRecursive() 2016-04-17 09:17:05 +08:00
Milo Yip
cb2f340d55 Remove ISchemaStateFactory::ReallocState() 2016-04-17 09:11:00 +08:00
Milo Yip
e7149d6659 Fix memory leak for invalid regex 2016-04-17 00:58:32 +08:00
Milo Yip
26e69ffde9 Fix a bug in schema minimum/maximum keywords for 64-bit integer 2016-04-17 00:48:02 +08:00
Milo Yip
ecd8fa3437 Improve coverage of regex 2016-04-16 23:04:40 +08:00
Milo Yip
fdd443120f Move break into same line to make coverage happy 2016-04-16 22:09:23 +08:00
Milo Yip
75d0e4ff65 Use single Peek() in SkipWhitespace
Fix #594
2016-04-07 00:47:26 +08:00
Milo Yip
12425693ba Revert formatting of enum 2016-04-06 23:33:26 +08:00
Milo Yip
44d114f3ee Supress VC C4512 warning 2016-04-06 00:47:16 +08:00
Milo Yip
be5a886f8f Fix clang compilation error 2016-04-06 00:34:45 +08:00
Milo Yip
689be10891 Fix a compilation error 2016-04-06 00:11:49 +08:00
Milo Yip
35ccca8b74 Try to fix VC warning C4512 2016-04-05 23:56:50 +08:00
Milo Yip
8991037ecd Revert using of static const back to enum due to gcc error 2016-04-05 23:26:08 +08:00
Milo Yip
c843a2655b Try to fix all /W4 warnings in VC2015 2016-04-04 15:01:34 +08:00
Jarred Nicholls
926d7ffcc8 Later clang compilers will warn on float -> double promotion because it can add precision. In the context of RapidJSON – especially with its float methods on GenericValue – I think this warning holds no water and should be ignored.
Trim whitespace off the end of various lines.

Added an additional NumberStream specialization that will always perform a TakePush() even when just Take() is called. This supports RawNumber parsing by pushing onto our StackStream particular parts of the number that currently aren't captured because of full precision double parsing, such as the negative sign, scientific number exponents, etc.

RawNumber parsing fails with input streams that don't have copy optimization, such as the BasicIStreamWrapper stream. To work around this, instead do the Transcode copy operation by reading from a UTF8 StringStream instead of the original InputStream. Since the NumberStream downcasts all input Ch into chars, we know we're dealing with UTF8/ASCII compatible stack characters during the Transcoding.
2016-03-29 15:44:30 -04:00
Milo Yip
4fdcb10c3e Fix #587 2016-03-26 22:47:07 +08:00
Nicholas Fraser
68217548f3 Added trailing comma support to iterative parser
This also fixes cases where the iterative parser should have produced
kParseErrorValueInvalid rather than kParseErrorUnspecifiedSyntaxError
when expecting a value (after a colon in an object, after a comma in an
array, and at the start of an array.)
2016-03-20 12:52:48 -04:00
Nicholas Fraser
3e21bb429d Added optional support for trailing commas
This adds kParseTrailingCommasFlag to allow a trailing comma at the
end of maps and arrays. This is part of issue #36, adding optional
support for relaxed JSON syntax.
2016-03-20 01:10:33 -04:00
Konstantin Trushin
305882489c do potentially precision-losing conversions explicitly 2016-03-13 14:07:39 +03:00
Cory Omand
7a79e91ecd PrettyWriter formatting options.
This change adds PrettyWriter::SetFormatOptions with a corresponding
bitfield enum PrettyFormatOptions. This allows options affecting the
format of the PrettyWriter to be set. The first option to be provided
is kFormatSingleLineArray, which instructs the PrettyWriter to write
arrays on a single line, rather than breaking them up onto a line
per element.
2016-03-08 15:33:04 -08:00
Milo Yip
7886965e34 Fix a bug in dtoa
This previously affects Writer:: SetMaxDecimalPlaces()
2016-03-08 10:03:31 +08:00
Sergey Kosarevsky
6e70e3521a Removed commented code and added an explanatory comment instead 2016-03-05 13:47:32 +01:00
Milo Yip
01b2d463f7 Fix #573 2016-03-05 10:34:00 +08:00
Milo Yip
a62777487d Normalize line endings but not JSON files 2016-03-04 11:52:18 +08:00
Milo Yip
7fb84d304b Revert "Normalize all the line endings"
This reverts commit 6047e3ce128954ec594e9a893ef2125c9f9b61c7.
2016-03-04 11:51:30 +08:00
Milo Yip
6047e3ce12 Normalize all the line endings 2016-03-04 09:46:11 +08:00
Milo Yip
d9cf99baf6 Normalize all line endings 2016-03-04 09:44:01 +08:00
Milo Yip
6d0f0b2a84 Merge pull request #564 from corporateshark/stringnumbers
Implemented feature as in #560 (ints/doubles as strings)
2016-03-03 09:34:53 +08:00
Milo Yip
29c95808ac Inlucde SIMD headers for writer.h 2016-03-02 17:58:16 +08:00
Sergey Kosarevsky
b5966c3290 Added missing static_cast 2016-03-02 03:07:53 +01:00
Sergey Kosarevsky
bea3790a74 Don't insert terminating zero 2016-03-02 02:08:58 +01:00
Milo Yip
364545fe57 Prevent gcc wrong warning 2016-03-02 01:39:33 +08:00
Milo Yip
928caf92ed Fix gcc strict-overflow warning
Fix #566 #568
2016-03-02 01:01:17 +08:00
Milo Yip
6c927047c4 Fix RAPIDJSON_(UN)LIKELY for VC 2016-03-01 10:16:40 +08:00
Sergey Kosarevsky
22d22145d2 Added GenericSchemaValidator::RawNumber() 2016-02-29 18:05:24 +01:00