From 38b293e74db6631873d5dfd74cf731eb7b76737d Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:54:15 -0400 Subject: Padding on a list is on the length of the list. There was a bug where padding was being computed on each element of the list. Close #5. --- nexgb/sync/sync.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'nexgb/sync/sync.go') diff --git a/nexgb/sync/sync.go b/nexgb/sync/sync.go index 93fb2b7..3234d60 100644 --- a/nexgb/sync/sync.go +++ b/nexgb/sync/sync.go @@ -483,9 +483,9 @@ func Int64ListBytes(buf []byte, list []Int64) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } type Systemcounter struct { @@ -558,9 +558,9 @@ func SystemcounterListBytes(buf []byte, list []Systemcounter) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // SystemcounterListSize computes the size (bytes) of a list of Systemcounter values. @@ -645,9 +645,9 @@ func TriggerListBytes(buf []byte, list []Trigger) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -710,9 +710,9 @@ func WaitconditionListBytes(buf []byte, list []Waitcondition) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // Skipping definition for base type 'Bool' -- cgit v1.2.3-70-g09d2