Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
binapigen: fix union size
[govpp.git]
/
binapi
/
feature
/
feature.ba.go
diff --git
a/binapi/feature/feature.ba.go
b/binapi/feature/feature.ba.go
index
4d16ce8
..
cc54364
100644
(file)
--- a/
binapi/feature/feature.ba.go
+++ b/
binapi/feature/feature.ba.go
@@
-44,11
+44,10
@@
func (*FeatureEnableDisable) GetMessageType() api.MessageType {
return api.RequestMessage
}
return api.RequestMessage
}
-func (m *FeatureEnableDisable) Size()
int
{
+func (m *FeatureEnableDisable) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 1 // m.Enable
size += 64 // m.ArcName
size += 4 // m.SwIfIndex
size += 1 // m.Enable
size += 64 // m.ArcName
@@
-56,12
+55,10
@@
func (m *FeatureEnableDisable) Size() int {
return size
}
func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
return size
}
func (m *FeatureEnableDisable) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.Enable)
buf.EncodeString(m.ArcName, 64)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeBool(m.Enable)
buf.EncodeString(m.ArcName, 64)
@@
-89,27
+86,24
@@
func (*FeatureEnableDisableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
return api.ReplyMessage
}
-func (m *FeatureEnableDisableReply) Size()
int
{
+func (m *FeatureEnableDisableReply) Size()
(size int)
{
if m == nil {
return 0
}
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
size += 4 // m.Retval
return size
}
func (m *FeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval =
int32(buf.DecodeUint32()
)
+ m.Retval =
buf.DecodeInt32(
)
return nil
}
return nil
}