summaryrefslogtreecommitdiff
path: root/sync/sync.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-08-11 20:54:15 -0400
committerAndrew Gallant <[email protected]>2013-08-11 20:54:15 -0400
commiteb7c38953b074e33f86861a3da4c05623cd44fc6 (patch)
tree0393a0a57afb536c401afb5e3587384c282ddd00 /sync/sync.go
parent8bc7a097c3aeddc1832d47cd74a9a365ab1f86ad (diff)
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 'sync/sync.go')
-rw-r--r--sync/sync.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/sync/sync.go b/sync/sync.go
index 93fb2b7..3234d60 100644
--- a/sync/sync.go
+++ b/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'