Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
aa902401
Commit
aa902401
authored
Jan 24, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cdc5f8f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
t/neo/protogen.go
t/neo/protogen.go
+8
-3
No files found.
t/neo/protogen.go
View file @
aa902401
...
...
@@ -198,6 +198,12 @@ notfixed:
return
0
,
false
}
// does a type have fixed wire size == 1 ?
func
typeSizeFixed1
(
typ
types
.
Type
)
bool
{
wireSize
,
_
:=
typeSizeFixed
(
typ
)
return
wireSize
==
1
}
// Buffer + bell & whistles
type
Buffer
struct
{
...
...
@@ -808,9 +814,8 @@ func codegenType(path string, typ types.Type, obj types.Object, codegen CodecCod
}
case
*
types
.
Array
:
elemSize
,
_
:=
typeSizeFixed
(
u
.
Elem
())
// [...]byte or [...]uint8 - just straight copy
if
false
&&
elemSize
==
1
{
if
false
&&
typeSizeFixed1
(
u
.
Elem
())
{
//codegen.genStrBytes(path+"[:]") // FIXME
codegen
.
genSlice1
(
path
,
u
)
// FIXME
}
else
{
...
...
@@ -821,7 +826,7 @@ func codegenType(path string, typ types.Type, obj types.Object, codegen CodecCod
}
case
*
types
.
Slice
:
if
elemSize
,
_
:=
typeSizeFixed
(
u
.
Elem
());
elemSize
==
1
{
if
typeSizeFixed1
(
u
.
Elem
())
{
codegen
.
genSlice1
(
path
,
u
)
}
else
{
codegen
.
genSlice
(
path
,
u
,
obj
)
...
...
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