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
9ce381b8
Commit
9ce381b8
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 again
parent
17f2ca69
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
6 deletions
+36
-6
messagereader.cpp
example/messagereader/messagereader.cpp
+12
-4
document.h
include/rapidjson/document.h
+2
-1
en.h
include/rapidjson/error/en.h
+12
-1
filereadstream.h
include/rapidjson/filereadstream.h
+1
-0
filewritestream.h
include/rapidjson/filewritestream.h
+9
-0
No files found.
example/messagereader/messagereader.cpp
View file @
9ce381b8
...
...
@@ -17,6 +17,11 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
#endif
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
#endif
struct
MessageHandler
:
public
BaseReaderHandler
<
UTF8
<>
,
MessageHandler
>
{
MessageHandler
()
:
messages_
(),
state_
(
kExpectObjectStart
),
name_
()
{}
...
...
@@ -26,16 +31,13 @@ struct MessageHandler
case
kExpectObjectStart
:
state_
=
kExpectNameOrObjectEnd
;
return
true
;
case
kExpectNameOrObjectEnd
:
case
kExpectValue
:
default:
return
false
;
}
}
bool
String
(
const
char
*
str
,
SizeType
length
,
bool
)
{
switch
(
state_
)
{
case
kExpectObjectStart
:
return
false
;
case
kExpectNameOrObjectEnd
:
name_
=
string
(
str
,
length
);
state_
=
kExpectValue
;
...
...
@@ -44,6 +46,8 @@ struct MessageHandler
messages_
.
insert
(
MessageMap
::
value_type
(
name_
,
string
(
str
,
length
)));
state_
=
kExpectNameOrObjectEnd
;
return
true
;
default:
return
false
;
}
}
...
...
@@ -64,6 +68,10 @@ struct MessageHandler
RAPIDJSON_DIAG_POP
#endif
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif
static
void
ParseMessages
(
const
char
*
json
,
MessageMap
&
messages
)
{
Reader
reader
;
MessageHandler
handler
;
...
...
include/rapidjson/document.h
View file @
9ce381b8
...
...
@@ -1557,7 +1557,8 @@ public:
case
kStringType
:
return
handler
.
String
(
GetString
(),
GetStringLength
(),
(
flags_
&
kCopyFlag
)
!=
0
);
case
kNumberType
:
default
:
RAPIDJSON_ASSERT
(
GetType
()
==
kNumberType
);
if
(
IsInt
())
return
handler
.
Int
(
data_
.
n
.
i
.
i
);
else
if
(
IsUint
())
return
handler
.
Uint
(
data_
.
n
.
u
.
u
);
else
if
(
IsInt64
())
return
handler
.
Int64
(
data_
.
n
.
i64
);
...
...
include/rapidjson/error/en.h
View file @
9ce381b8
...
...
@@ -17,6 +17,12 @@
#include "error.h"
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
RAPIDJSON_DIAG_OFF
(
covered
-
switch
-
default
)
#endif
RAPIDJSON_NAMESPACE_BEGIN
//! Maps error code of parsing into error message.
...
...
@@ -54,10 +60,15 @@ inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErro
case
kParseErrorTermination
:
return
RAPIDJSON_ERROR_STRING
(
"Terminate parsing due to Handler error."
);
case
kParseErrorUnspecificSyntaxError
:
return
RAPIDJSON_ERROR_STRING
(
"Unspecific syntax error."
);
default:
return
RAPIDJSON_ERROR_STRING
(
"Unknown error."
);
}
return
RAPIDJSON_ERROR_STRING
(
"Unknown error."
);
}
RAPIDJSON_NAMESPACE_END
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif
#endif // RAPIDJSON_ERROR_EN_H_
include/rapidjson/filereadstream.h
View file @
9ce381b8
...
...
@@ -21,6 +21,7 @@
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
unreachable
-
code
)
#endif
RAPIDJSON_NAMESPACE_BEGIN
...
...
include/rapidjson/filewritestream.h
View file @
9ce381b8
...
...
@@ -18,6 +18,11 @@
#include "rapidjson.h"
#include <cstdio>
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
unreachable
-
code
)
#endif
RAPIDJSON_NAMESPACE_BEGIN
//! Wrapper of C file stream for input using fread().
...
...
@@ -92,4 +97,8 @@ inline void PutN(FileWriteStream& stream, char c, size_t n) {
RAPIDJSON_NAMESPACE_END
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif
#endif // RAPIDJSON_FILESTREAM_H_
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