Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
adf66292
Commit
adf66292
authored
Jun 25, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed VC which doesn't have INT64_C()/UINT64_C macros.
parent
208d2bd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
document.h
include/rapidjson/document.h
+6
-6
rapidjson.h
include/rapidjson/rapidjson.h
+14
-0
reader.h
include/rapidjson/reader.h
+4
-4
No files found.
include/rapidjson/document.h
View file @
adf66292
...
...
@@ -91,23 +91,23 @@ public:
data_
.
n
.
i64
=
i64
;
if
(
i64
>=
0
)
{
flags_
|=
kNumberUint64Flag
;
if
(
!
(
static_cast
<
uint64_t
>
(
i64
)
&
UINT64_C
(
0xFFFFFFFF00000000
)))
if
(
!
(
static_cast
<
uint64_t
>
(
i64
)
&
RAPIDJSON_
UINT64_C
(
0xFFFFFFFF00000000
)))
flags_
|=
kUintFlag
;
if
(
!
(
static_cast
<
uint64_t
>
(
i64
)
&
UINT64_C
(
0xFFFFFFFF80000000
)))
if
(
!
(
static_cast
<
uint64_t
>
(
i64
)
&
RAPIDJSON_
UINT64_C
(
0xFFFFFFFF80000000
)))
flags_
|=
kIntFlag
;
}
else
if
(
i64
>=
INT64_C
(
-
2147483648
))
else
if
(
i64
>=
RAPIDJSON_
INT64_C
(
-
2147483648
))
flags_
|=
kIntFlag
;
}
//! Constructor for uint64_t value.
GenericValue
(
uint64_t
u64
)
:
flags_
(
kNumberUint64Flag
)
{
data_
.
n
.
u64
=
u64
;
if
(
!
(
u64
&
UINT64_C
(
0x8000000000000000
)))
if
(
!
(
u64
&
RAPIDJSON_
UINT64_C
(
0x8000000000000000
)))
flags_
|=
kInt64Flag
;
if
(
!
(
u64
&
UINT64_C
(
0xFFFFFFFF00000000
)))
if
(
!
(
u64
&
RAPIDJSON_
UINT64_C
(
0xFFFFFFFF00000000
)))
flags_
|=
kUintFlag
;
if
(
!
(
u64
&
UINT64_C
(
0xFFFFFFFF80000000
)))
if
(
!
(
u64
&
RAPIDJSON_
UINT64_C
(
0xFFFFFFFF80000000
)))
flags_
|=
kIntFlag
;
}
...
...
include/rapidjson/rapidjson.h
View file @
adf66292
...
...
@@ -13,12 +13,26 @@
// Here defines int64_t and uint64_t types in global namespace.
// If user have their own definition, can define RAPIDJSON_NO_INT64DEFINE to disable this.
#ifndef RAPIDJSON_NO_INT64DEFINE
// Old Visual C++ does not have standard integer types, typedef our own.
#ifdef _MSC_VER
typedef
__int64
int64_t
;
typedef
unsigned
__int64
uint64_t
;
#ifndef RAPIDJSON_INT64_C
#define RAPIDJSON_INT64_C(x) x##LL
#endif
#ifndef RAPIDJSON_UINT64_C
#define RAPIDJSON_UINT64_C(x) x##uLL
#endif
#else
// Other compilers should have this.
#include <inttypes.h>
#ifndef RAPIDJSON_INT64_C
#define RAPIDJSON_INT64_C(x) INT64_C(x)
#endif
#ifndef RAPIDJSON_UINT64_C
#define RAPIDJSON_UINT64_C(x) UINT64_C(x)
#endif
#endif // _MSC_VER
#endif // RAPIDJSON_NO_INT64TYPEDEF
///////////////////////////////////////////////////////////////////////////////
...
...
include/rapidjson/reader.h
View file @
adf66292
...
...
@@ -527,8 +527,8 @@ private:
i64
=
i
;
if
(
minus
)
while
(
s
.
Peek
()
>=
'0'
&&
s
.
Peek
()
<=
'9'
)
{
if
(
i64
>=
UINT64_C
(
922337203685477580
))
// 2^63 = 9223372036854775808
if
(
i64
!=
UINT64_C
(
922337203685477580
)
||
s
.
Peek
()
>
'8'
)
{
if
(
i64
>=
RAPIDJSON_
UINT64_C
(
922337203685477580
))
// 2^63 = 9223372036854775808
if
(
i64
!=
RAPIDJSON_
UINT64_C
(
922337203685477580
)
||
s
.
Peek
()
>
'8'
)
{
useDouble
=
true
;
break
;
}
...
...
@@ -536,8 +536,8 @@ private:
}
else
while
(
s
.
Peek
()
>=
'0'
&&
s
.
Peek
()
<=
'9'
)
{
if
(
i64
>=
UINT64_C
(
1844674407370955161
))
// 2^64 - 1 = 18446744073709551615
if
(
i64
!=
UINT64_C
(
1844674407370955161
)
||
s
.
Peek
()
>
'5'
)
{
if
(
i64
>=
RAPIDJSON_
UINT64_C
(
1844674407370955161
))
// 2^64 - 1 = 18446744073709551615
if
(
i64
!=
RAPIDJSON_
UINT64_C
(
1844674407370955161
)
||
s
.
Peek
()
>
'5'
)
{
useDouble
=
true
;
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment