Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
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
flatbuffers
Commits
b095367d
Commit
b095367d
authored
Jan 18, 2017
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/google/flatbuffers
parents
eac29055
12fd0c68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
idl_gen_cpp.cpp
src/idl_gen_cpp.cpp
+7
-10
No files found.
src/idl_gen_cpp.cpp
View file @
b095367d
...
...
@@ -525,16 +525,13 @@ class CppGenerator : public BaseGenerator {
code_
.
SetValue
(
"SEP"
,
",
\n
"
);
if
(
enum_def
.
attributes
.
Lookup
(
"bit_flags"
))
{
if
(
minv
->
value
!=
0
)
{
// If the user didn't defined NONE value
code_
.
SetValue
(
"KEY"
,
GenEnumValDecl
(
enum_def
,
"NONE"
));
code_
.
SetValue
(
"VALUE"
,
"0"
);
code_
+=
"{{SEP}} {{KEY}} = {{VALUE}}
\\
"
;
}
if
(
maxv
->
value
!=
anyv
)
{
// If the user didn't defined ANY value
code_
.
SetValue
(
"KEY"
,
GenEnumValDecl
(
enum_def
,
"ANY"
));
code_
.
SetValue
(
"VALUE"
,
NumToString
(
anyv
));
code_
+=
"{{SEP}} {{KEY}} = {{VALUE}}
\\
"
;
}
code_
.
SetValue
(
"KEY"
,
GenEnumValDecl
(
enum_def
,
"NONE"
));
code_
.
SetValue
(
"VALUE"
,
"0"
);
code_
+=
"{{SEP}} {{KEY}} = {{VALUE}}
\\
"
;
code_
.
SetValue
(
"KEY"
,
GenEnumValDecl
(
enum_def
,
"ANY"
));
code_
.
SetValue
(
"VALUE"
,
NumToString
(
anyv
));
code_
+=
"{{SEP}} {{KEY}} = {{VALUE}}
\\
"
;
}
else
{
// MIN & MAX are useless for bit_flags
code_
.
SetValue
(
"KEY"
,
GenEnumValDecl
(
enum_def
,
"MIN"
));
code_
.
SetValue
(
"VALUE"
,
GenEnumValDecl
(
enum_def
,
minv
->
name
));
...
...
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