diff options
Diffstat (limited to 'binapi/mdata')
-rw-r--r-- | binapi/mdata/mdata.ba.go | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/binapi/mdata/mdata.ba.go b/binapi/mdata/mdata.ba.go index aba1dee..d4715f7 100644 --- a/binapi/mdata/mdata.ba.go +++ b/binapi/mdata/mdata.ba.go @@ -41,21 +41,18 @@ func (*MdataEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *MdataEnableDisable) Size() int { +func (m *MdataEnableDisable) Size() (size int) { if m == nil { return 0 } - var size int size += 1 // m.EnableDisable return size } func (m *MdataEnableDisable) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer 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.EncodeBool(m.EnableDisable) return buf.Bytes(), nil } @@ -77,27 +74,24 @@ func (*MdataEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *MdataEnableDisableReply) Size() int { +func (m *MdataEnableDisableReply) Size() (size int) { if m == nil { return 0 } - var size int size += 4 // m.Retval return size } func (m *MdataEnableDisableReply) Marshal(b []byte) ([]byte, error) { - var buf *codec.Buffer 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 *MdataEnableDisableReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Retval = int32(buf.DecodeUint32()) + m.Retval = buf.DecodeInt32() return nil } |