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
b04736f9
Commit
b04736f9
authored
May 22, 2019
by
aardappel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed warnings in idl_gen_go.cpp
parent
bc240b30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
idl_gen_go.cpp
src/idl_gen_go.cpp
+7
-8
No files found.
src/idl_gen_go.cpp
View file @
b04736f9
...
...
@@ -161,7 +161,7 @@ class GoGenerator : public BaseGenerator {
// A single enum member.
void
EnumMember
(
const
EnumDef
&
enum_def
,
const
EnumVal
&
ev
,
const
in
t
max_name_length
,
std
::
string
*
code_ptr
)
{
size_
t
max_name_length
,
std
::
string
*
code_ptr
)
{
std
::
string
&
code
=
*
code_ptr
;
code
+=
"
\t
"
;
code
+=
enum_def
.
name
;
...
...
@@ -189,7 +189,7 @@ class GoGenerator : public BaseGenerator {
// A single enum name member.
void
EnumNameMember
(
const
EnumDef
&
enum_def
,
const
EnumVal
ev
,
const
in
t
max_name_length
,
std
::
string
*
code_ptr
)
{
size_
t
max_name_length
,
std
::
string
*
code_ptr
)
{
std
::
string
&
code
=
*
code_ptr
;
code
+=
"
\t
"
;
code
+=
enum_def
.
name
;
...
...
@@ -229,7 +229,7 @@ class GoGenerator : public BaseGenerator {
// A single enum value member.
void
EnumValueMember
(
const
EnumDef
&
enum_def
,
const
EnumVal
ev
,
const
in
t
max_name_length
,
std
::
string
*
code_ptr
)
{
size_
t
max_name_length
,
std
::
string
*
code_ptr
)
{
std
::
string
&
code
=
*
code_ptr
;
code
+=
"
\t\"
"
;
code
+=
ev
.
name
;
...
...
@@ -775,7 +775,7 @@ class GoGenerator : public BaseGenerator {
void
GenEnum
(
const
EnumDef
&
enum_def
,
std
::
string
*
code_ptr
)
{
if
(
enum_def
.
generated
)
return
;
const
int
max_name_length
=
MaxNameLength
(
enum_def
);
auto
max_name_length
=
MaxNameLength
(
enum_def
);
cur_name_space_
=
enum_def
.
defined_namespace
;
GenComment
(
enum_def
.
doc_comment
,
code_ptr
,
nullptr
);
...
...
@@ -989,12 +989,11 @@ class GoGenerator : public BaseGenerator {
const
Namespace
*
CurrentNameSpace
()
const
{
return
cur_name_space_
;
}
static
in
t
MaxNameLength
(
const
EnumDef
&
enum_def
)
{
in
t
max
=
0
;
static
size_
t
MaxNameLength
(
const
EnumDef
&
enum_def
)
{
size_
t
max
=
0
;
for
(
auto
it
=
enum_def
.
Vals
().
begin
();
it
!=
enum_def
.
Vals
().
end
();
++
it
)
{
const
int
length
=
(
*
it
)
->
name
.
length
();
max
=
length
>
max
?
length
:
max
;
max
=
std
::
max
((
*
it
)
->
name
.
length
(),
max
);
}
return
max
;
}
...
...
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