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
17f2ca69
Commit
17f2ca69
authored
Dec 18, 2015
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix clang and gcc warnings problems
parent
74c8dcfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
17 deletions
+8
-17
document.h
include/rapidjson/document.h
+3
-7
reader.h
include/rapidjson/reader.h
+3
-10
unittest.h
test/unittest/unittest.h
+2
-0
No files found.
include/rapidjson/document.h
View file @
17f2ca69
...
@@ -30,6 +30,7 @@ RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
...
@@ -30,6 +30,7 @@ RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
#ifdef __clang__
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
#endif
#endif
#ifdef __GNUC__
#ifdef __GNUC__
...
@@ -724,9 +725,7 @@ public:
...
@@ -724,9 +725,7 @@ public:
else
else
return
data_
.
n
.
u64
==
rhs
.
data_
.
n
.
u64
;
return
data_
.
n
.
u64
==
rhs
.
data_
.
n
.
u64
;
case
kNullType
:
default
:
case
kFalseType
:
case
kTrueType
:
return
true
;
return
true
;
}
}
}
}
...
@@ -2106,10 +2105,7 @@ GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,Sourc
...
@@ -2106,10 +2105,7 @@ GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,Sourc
SetStringRaw
(
StringRef
(
rhs
.
GetString
(),
rhs
.
GetStringLength
()),
allocator
);
SetStringRaw
(
StringRef
(
rhs
.
GetString
(),
rhs
.
GetStringLength
()),
allocator
);
}
}
break
;
break
;
case
kNullType
:
default
:
case
kFalseType
:
case
kTrueType
:
case
kNumberType
:
flags_
=
rhs
.
flags_
;
flags_
=
rhs
.
flags_
;
data_
=
*
reinterpret_cast
<
const
Data
*>
(
&
rhs
.
data_
);
data_
=
*
reinterpret_cast
<
const
Data
*>
(
&
rhs
.
data_
);
break
;
break
;
...
...
include/rapidjson/reader.h
View file @
17f2ca69
...
@@ -42,6 +42,7 @@ RAPIDJSON_DIAG_OFF(4702) // unreachable code
...
@@ -42,6 +42,7 @@ RAPIDJSON_DIAG_OFF(4702) // unreachable code
#ifdef __clang__
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
#endif
#endif
#ifdef __GNUC__
#ifdef __GNUC__
...
@@ -1417,9 +1418,7 @@ private:
...
@@ -1417,9 +1418,7 @@ private:
}
}
}
}
case
IterativeParsingStartState
:
default
:
case
IterativeParsingFinishState
:
case
IterativeParsingValueState
:
// This branch is for IterativeParsingValueState actually.
// This branch is for IterativeParsingValueState actually.
// Use `default:` rather than
// Use `default:` rather than
// `case IterativeParsingValueState:` is for code coverage.
// `case IterativeParsingValueState:` is for code coverage.
...
@@ -1456,13 +1455,7 @@ private:
...
@@ -1456,13 +1455,7 @@ private:
case
IterativeParsingMemberKeyState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorObjectMissColon
,
is
.
Tell
());
return
;
case
IterativeParsingMemberKeyState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorObjectMissColon
,
is
.
Tell
());
return
;
case
IterativeParsingMemberValueState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorObjectMissCommaOrCurlyBracket
,
is
.
Tell
());
return
;
case
IterativeParsingMemberValueState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorObjectMissCommaOrCurlyBracket
,
is
.
Tell
());
return
;
case
IterativeParsingElementState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorArrayMissCommaOrSquareBracket
,
is
.
Tell
());
return
;
case
IterativeParsingElementState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorArrayMissCommaOrSquareBracket
,
is
.
Tell
());
return
;
case
IterativeParsingErrorState
:
default
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorUnspecificSyntaxError
,
is
.
Tell
());
return
;
case
IterativeParsingKeyValueDelimiterState
:
case
IterativeParsingObjectFinishState
:
case
IterativeParsingArrayInitialState
:
case
IterativeParsingElementDelimiterState
:
case
IterativeParsingArrayFinishState
:
case
IterativeParsingValueState
:
RAPIDJSON_PARSE_ERROR
(
kParseErrorUnspecificSyntaxError
,
is
.
Tell
());
return
;
}
}
}
}
...
...
test/unittest/unittest.h
View file @
17f2ca69
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
#ifndef __STDC_CONSTANT_MACROS
#ifndef __STDC_CONSTANT_MACROS
#ifdef __clang__
#ifdef __clang__
#pragma GCC diagnostic push
#pragma GCC diagnostic push
#if __has_warning("-Wreserved-id-macro")
#pragma GCC diagnostic ignored "-Wreserved-id-macro"
#pragma GCC diagnostic ignored "-Wreserved-id-macro"
#endif
#endif
#endif
# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
...
...
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