diff options
author | Andrew Gallant <jamslam@gmail.com> | 2013-08-11 20:54:15 -0400 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:18 +0200 |
commit | 38b293e74db6631873d5dfd74cf731eb7b76737d (patch) | |
tree | aca66c5633a1c2e823318efdd05ff5ff996f4021 /nexgb/sync/sync.go | |
parent | b06a8ca97625c1134449c3af65d9ac3fb251a613 (diff) | |
download | haven-38b293e74db6631873d5dfd74cf731eb7b76737d.tar.gz haven-38b293e74db6631873d5dfd74cf731eb7b76737d.tar.xz haven-38b293e74db6631873d5dfd74cf731eb7b76737d.zip |
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.
Diffstat (limited to 'nexgb/sync/sync.go')
-rw-r--r-- | nexgb/sync/sync.go | 16 |
1 files changed, 8 insertions, 8 deletions
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' |