summaryrefslogtreecommitdiff
path: root/record/record.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-12-28 09:33:09 -0500
committerAndrew Gallant <[email protected]>2013-12-28 09:33:09 -0500
commit34dd98df049a0a6ecf661ff9fdfe31292688040a (patch)
treeb2cbe9e643ec6271bbcbdf8c1030a56575d57109 /record/record.go
parent9071499d31a04ae4e2e545e2f2227545d32187a4 (diff)
When writing, don't pad the length of bytes produced from inner
structs/unions. Each type should take care of its own padding. Close #14.
Diffstat (limited to 'record/record.go')
-rw-r--r--record/record.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/record/record.go b/record/record.go
index 2644f13..3777422 100644
--- a/record/record.go
+++ b/record/record.go
@@ -213,13 +213,13 @@ func (v ExtRange) Bytes() []byte {
{
structBytes := v.Major.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.Minor.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
return buf
@@ -315,43 +315,43 @@ func (v Range) Bytes() []byte {
{
structBytes := v.CoreRequests.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.CoreReplies.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.ExtRequests.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.ExtReplies.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.DeliveredEvents.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.DeviceEvents.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
{
structBytes := v.Errors.Bytes()
copy(buf[b:], structBytes)
- b += xgb.Pad(len(structBytes))
+ b += len(structBytes)
}
if v.ClientStarted {