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
e440b695
Commit
e440b695
authored
Jul 10, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #62 from pah/fixes/msvc
Fixes and cleanups for MSVC
parents
63d05434
6d558362
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
17 deletions
+23
-17
premake4.lua
build/premake4.lua
+2
-2
document.h
include/rapidjson/document.h
+1
-1
encodings.h
include/rapidjson/encodings.h
+5
-2
strfunc.h
include/rapidjson/internal/strfunc.h
+1
-2
reader.h
include/rapidjson/reader.h
+7
-3
writer.h
include/rapidjson/writer.h
+4
-4
rapidjsontest.cpp
test/perftest/rapidjsontest.cpp
+1
-1
unittest.h
test/unittest/unittest.h
+2
-2
No files found.
build/premake4.lua
View file @
e440b695
...
@@ -64,7 +64,7 @@ solution "test"
...
@@ -64,7 +64,7 @@ solution "test"
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
configuration
"gmake"
configuration
"gmake"
buildoptions
"-msse4.2 -Werror -Wall -Wextra
-Wswitch-default
"
buildoptions
"-msse4.2 -Werror -Wall -Wextra"
project
"gtest"
project
"gtest"
kind
"StaticLib"
kind
"StaticLib"
...
@@ -87,7 +87,7 @@ solution "test"
...
@@ -87,7 +87,7 @@ solution "test"
kind
"ConsoleApp"
kind
"ConsoleApp"
if
_ACTION
==
"gmake"
then
if
_ACTION
==
"gmake"
then
buildoptions
"-Weffc++"
buildoptions
"-Weffc++
-Wswitch-default
"
end
end
files
{
files
{
...
...
include/rapidjson/document.h
View file @
e440b695
...
@@ -501,7 +501,7 @@ public:
...
@@ -501,7 +501,7 @@ public:
\see GenericStringRef, operator=(T)
\see GenericStringRef, operator=(T)
*/
*/
GenericValue
&
operator
=
(
StringRefType
str
)
{
GenericValue
&
operator
=
(
StringRefType
str
)
{
return
(
*
this
).
template
operator
=<
StringRefType
>
(
str
);
return
(
*
this
).
operator
=<
StringRefType
>
(
str
);
}
}
//! Assignment with primitive types.
//! Assignment with primitive types.
...
...
include/rapidjson/encodings.h
View file @
e440b695
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
#include "rapidjson.h"
#include "rapidjson.h"
#ifdef __GNUC__
#ifdef _MSC_VER
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
4244
)
// conversion from 'type1' to 'type2', possible loss of data
#elif defined(__GNUC__)
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
RAPIDJSON_DIAG_OFF
(
effc
++
)
#endif
#endif
...
@@ -529,7 +532,7 @@ struct Transcoder<Encoding, Encoding> {
...
@@ -529,7 +532,7 @@ struct Transcoder<Encoding, Encoding> {
}
// namespace rapidjson
}
// namespace rapidjson
#if
def __GNUC__
#if
defined(__GNUC__) || defined(_MSV_VER)
RAPIDJSON_DIAG_POP
RAPIDJSON_DIAG_POP
#endif
#endif
...
...
include/rapidjson/internal/strfunc.h
View file @
e440b695
...
@@ -13,8 +13,7 @@ namespace internal {
...
@@ -13,8 +13,7 @@ namespace internal {
template
<
typename
Ch
>
template
<
typename
Ch
>
inline
SizeType
StrLen
(
const
Ch
*
s
)
{
inline
SizeType
StrLen
(
const
Ch
*
s
)
{
const
Ch
*
p
=
s
;
const
Ch
*
p
=
s
;
while
(
*
p
!=
'\0'
)
while
(
*
p
)
++
p
;
++
p
;
return
SizeType
(
p
-
s
);
return
SizeType
(
p
-
s
);
}
}
...
...
include/rapidjson/reader.h
View file @
e440b695
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
#include "internal/pow10.h"
#include "internal/pow10.h"
#include "internal/stack.h"
#include "internal/stack.h"
#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
#include <intrin.h>
#pragma intrinsic(_BitScanForward)
#endif
#ifdef RAPIDJSON_SSE42
#ifdef RAPIDJSON_SSE42
#include <nmmintrin.h>
#include <nmmintrin.h>
#elif defined(RAPIDJSON_SSE2)
#elif defined(RAPIDJSON_SSE2)
...
@@ -16,8 +20,8 @@
...
@@ -16,8 +20,8 @@
#endif
#endif
#ifdef _MSC_VER
#ifdef _MSC_VER
#pragma warning(push)
RAPIDJSON_DIAG_PUSH
#pragma warning(disable : 4127)
// conditional expression is constant
RAPIDJSON_DIAG_OFF
(
4127
)
// conditional expression is constant
#endif
#endif
#ifndef RAPIDJSON_PARSE_ERROR_NORETURN
#ifndef RAPIDJSON_PARSE_ERROR_NORETURN
...
@@ -769,7 +773,7 @@ typedef GenericReader<UTF8<>, UTF8<> > Reader;
...
@@ -769,7 +773,7 @@ typedef GenericReader<UTF8<>, UTF8<> > Reader;
}
// namespace rapidjson
}
// namespace rapidjson
#ifdef _MSC_VER
#ifdef _MSC_VER
#pragma warning(pop)
RAPIDJSON_DIAG_POP
#endif
#endif
#endif // RAPIDJSON_READER_H_
#endif // RAPIDJSON_READER_H_
include/rapidjson/writer.h
View file @
e440b695
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
#include <new> // placement new
#include <new> // placement new
#ifdef _MSC_VER
#ifdef _MSC_VER
#pragma warning(push)
RAPIDJSON_DIAG_PUSH
#pragma warning(disable :
4127) // conditional expression is constant
RAPIDJSON_DIAG_OFF
(
4127
)
// conditional expression is constant
#endif
#endif
namespace
rapidjson
{
namespace
rapidjson
{
...
@@ -185,7 +185,7 @@ protected:
...
@@ -185,7 +185,7 @@ protected:
char
buffer
[
10
];
char
buffer
[
10
];
char
*
p
=
buffer
;
char
*
p
=
buffer
;
do
{
do
{
*
p
++
=
(
u
%
10
)
+
'0'
;
*
p
++
=
char
(
u
%
10
)
+
'0'
;
u
/=
10
;
u
/=
10
;
}
while
(
u
>
0
);
}
while
(
u
>
0
);
...
@@ -306,7 +306,7 @@ private:
...
@@ -306,7 +306,7 @@ private:
}
// namespace rapidjson
}
// namespace rapidjson
#ifdef _MSC_VER
#ifdef _MSC_VER
#pragma warning(pop)
RAPIDJSON_DIAG_POP
#endif
#endif
#endif // RAPIDJSON_RAPIDJSON_H_
#endif // RAPIDJSON_RAPIDJSON_H_
test/perftest/rapidjsontest.cpp
View file @
e440b695
...
@@ -242,7 +242,7 @@ TEST_F(RapidJson, PrettyWriter_StringBuffer) {
...
@@ -242,7 +242,7 @@ TEST_F(RapidJson, PrettyWriter_StringBuffer) {
TEST_F
(
RapidJson
,
internal_Pow10
)
{
TEST_F
(
RapidJson
,
internal_Pow10
)
{
double
sum
=
0
;
double
sum
=
0
;
for
(
size_t
i
=
0
;
i
<
kTrialCount
*
kTrialCount
;
i
++
)
for
(
size_t
i
=
0
;
i
<
kTrialCount
*
kTrialCount
;
i
++
)
sum
+=
internal
::
Pow10
(
i
&
255
);
sum
+=
internal
::
Pow10
(
i
nt
(
i
&
255
)
);
EXPECT_GT
(
sum
,
0.0
);
EXPECT_GT
(
sum
,
0.0
);
}
}
...
...
test/unittest/unittest.h
View file @
e440b695
...
@@ -27,10 +27,10 @@
...
@@ -27,10 +27,10 @@
#endif
#endif
template
<
typename
Ch
>
template
<
typename
Ch
>
inline
size_t
StrLen
(
const
Ch
*
s
)
{
inline
unsigned
StrLen
(
const
Ch
*
s
)
{
const
Ch
*
p
=
s
;
const
Ch
*
p
=
s
;
while
(
*
p
)
p
++
;
while
(
*
p
)
p
++
;
return
p
-
s
;
return
unsigned
(
p
-
s
)
;
}
}
template
<
typename
Ch
>
template
<
typename
Ch
>
...
...
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