283 Commits

Author SHA1 Message Date
Milo Yip
3b1a037499 Merge pull request #748 from sfinktah/sfinktah-minwindef-fix
Fix for winmindef.h defining min/max macros
2016-10-17 14:29:10 +08:00
Milo Yip
2363227974 Add Value::Value(float) and static_cast for suppressing clang warning 2016-10-14 22:03:54 +08:00
Sfinktah Bungholio
51a31ce006 Fix for winmindef.h defining min/max macros 2016-09-25 20:36:33 +10:00
Janusz Chorko
862c39be37 Explicitly disable copy assignment operator 2016-08-26 21:26:50 +02:00
Janusz Chorko
3b2441b87f Removed non-compiling assignment operator. Fixed #718 2016-08-26 21:17:38 +02:00
fuzhufang
b67ff2fb11 if define RAPIDJSON_HAS_STDSTRING, FindMember use std::string, but it
also use internal::StrLen to get the string lengtht,
when it call FindMember(StringRef(name)).
Now use GenericValue construct it, then can use the std::string.size.
now it will be faster.
2016-07-14 17:50:48 +08:00
yiteng.nyt
8c43554de6 fix rapidjson::value::Get<std::string>() may returns wrong data
Change-Id: Ia7325edb437e3039e29223d0ecc4d9c83d824bc0
2016-07-11 12:38:10 +08:00
Philipp A. Hartmann
f6a07692f9 Fix warnings on GCC 6 and later (closes #666)
* document.h
  * suppress -Wterminate on GCC 6.x and later
  * simplify warning handling
* schema.h
  * drop RAPIDJSON_NOEXCEPT from GenericSchemaDocument constructor
    (calls RAPIDJSON_NEW anyway)
  * simplify warning handling
    (avoids RAPIDJSON_POP mismatch on Clang)
* encodingtest.cpp, istreamwrappertest.cpp
  * work around -Wdangling-else
* readertest.cpp
  * suppress -Wdangling-else
2016-06-23 21:42:16 +02:00
Eli Fidler
21acc56d57 range check in IsLosslessFloat to avoid undefined double->float cast
UBSAN gave in Value.IsLosslessFloat:
include/rapidjson/document.h:981:38: runtime error: value 3.40282e+38 is outside the range of representable values of type 'float'
2016-06-14 07:01:41 -07:00
Eli Fidler
c52cec7e51 fix undefined double to uint64_t cast
note that std::numeric_limits<uint64_t>::max() and
std::numeric_limits<int64_t>::max() aren't exactly representable in a
double, so we need to be strictly less to be definitely lossless

UBSAN gave during Value.IsLosslessDouble test:
include/rapidjson/document.h:955:42: runtime error: value 1.84467e+19 is outside the range of representable values of type 'unsigned long'
2016-06-14 07:01:41 -07:00
Milo Yip
12425693ba Revert formatting of enum 2016-04-06 23:33:26 +08:00
Milo Yip
be5a886f8f Fix clang compilation error 2016-04-06 00:34:45 +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
Milo Yip
4fdcb10c3e Fix #587 2016-03-26 22:47:07 +08:00
Milo Yip
01b2d463f7 Fix #573 2016-03-05 10:34:00 +08:00
Milo Yip
d9cf99baf6 Normalize all line endings 2016-03-04 09:44:01 +08:00
Sergey Kosarevsky
2bbfe0d8a8 Number() -> RawNumber() to avoid name clashes with the union Number 2016-02-28 18:50:04 +01:00
Sergey Kosarevsky
4f94ec9b0b Added GenericDocument::Number() 2016-02-28 18:38:06 +01:00
Kevin Atkinson
2f1e59324f Documentation fix.
GenericObject is a helper class for accessing Value of _object_ type.
2016-02-22 00:53:58 -05:00
Milo Yip
4620fa60f5 Fix VS2010 compilation errors 2016-02-21 12:52:14 +08:00
Milo Yip
5fc59cb6fa Merge branch 'master' into issue158_parsestdstring 2016-02-20 00:35:52 +08:00
Milo Yip
b8c83c53b1 Resolve conflicts 2016-02-19 23:40:48 +08:00
Milo Yip
9f6736c2cc Add noexcept to the constructors 2016-02-19 01:07:16 +08:00
Milo Yip
46dc8e9240 Add implicit constructors of GenericValue for GenercArray|Object
Also remove SetArray|Object(…)
2016-02-19 00:49:05 +08:00
Milo Yip
d13be6c721 Change pointer to reference in GenericArray|Object 2016-02-18 19:04:22 +08:00
Milo Yip
70f9671bdf Return value type for GenericObject/Array member functions 2016-02-18 01:19:47 +08:00
Milo Yip
8c79fb65ae Fix return type of GenericObject::AddMember() 2016-02-17 09:34:19 +08:00
Milo Yip
4ababca893 Fixed typos pointed out by @pah 2016-02-17 08:48:22 +08:00
Milo Yip
48378b751e Optimize the new Parse() interfaces 2016-02-15 20:21:36 +08:00
Milo Yip
9fe18f71c1 Add Document::Parse() overloads 2016-02-15 17:15:27 +08:00
Milo Yip
49c982b4b7 Fix C++03 compilation error about sizeof() 2016-02-15 12:19:30 +08:00
Milo Yip
4bb6f2c089 Fix compilation errors on 32-bit gcc/clang 2016-02-15 11:39:32 +08:00
Milo Yip
e731726c56 Optimize memory consumption with RAPIDJSON_48BITPOINTER_OPTIMIZATION
#330
2016-02-15 11:20:00 +08:00
Milo Yip
6671bd50f1 Fix another compilation error 2016-02-14 14:07:19 +08:00
Milo Yip
be66450ecd Fix compilation errors 2016-02-14 14:00:27 +08:00
Milo Yip
1634395378 Add object helper 2016-02-14 13:49:52 +08:00
Milo Yip
923db0e641 Fix gcc compilation error 2016-02-14 06:14:12 +08:00
Milo Yip
effc8a8f30 Let constness of GenericArray::ValueItaertor depending on ValueType 2016-02-14 00:12:04 +08:00
Milo Yip
0b098eb38d Rectify constness of Array 2016-02-13 22:09:14 +08:00
Milo Yip
59309b5dd2 Add GenericArray helper class with range-based for 2016-02-13 19:06:03 +08:00
Milo Yip
c6946fd2c1 Merge branch 'master' into issue316_templatedaccessors 2016-02-13 17:09:15 +08:00
Milo Yip
98ddfacdf1 Another try with volatile 2016-02-13 16:53:45 +08:00
Milo Yip
58d8d9ab9b Try fixing unit test in release configuration 2016-02-12 23:35:17 +08:00
Milo Yip
513fe7894e Add templated accessors for C string 2016-02-12 23:06:49 +08:00
Milo Yip
4d648fdcd8 Add templated accessors 2016-02-12 18:23:32 +08:00
Milo Yip
e61169e61a Fix Value::GetFloat() 2016-02-12 18:13:11 +08:00
Milo Yip
8b4c999888 Add Value::GetFloat(), Value::IsLossLessFloat/Double()
Fix #341
2016-02-12 16:33:31 +08:00
Milo Yip
d43f001a36 Fix #472 Template specialization failure with SunOS compiler 2016-02-02 22:59:27 +08:00