From 2dc9914b5e6b74c353771e56e90dfd2dd33e0202 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 28 Dec 2013 09:33:09 -0500 Subject: 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. --- nexgb/res/res.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nexgb/res/res.go') diff --git a/nexgb/res/res.go b/nexgb/res/res.go index 43480ec..59a416a 100644 --- a/nexgb/res/res.go +++ b/nexgb/res/res.go @@ -194,7 +194,7 @@ func (v ClientIdValue) Bytes() []byte { { structBytes := v.Spec.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.Length) @@ -328,7 +328,7 @@ func (v ResourceSizeSpec) Bytes() []byte { { structBytes := v.Spec.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.Bytes) @@ -395,7 +395,7 @@ func (v ResourceSizeValue) Bytes() []byte { { structBytes := v.Size.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } xgb.Put32(buf[b:], v.NumCrossReferences) -- cgit v1.2.3-70-g09d2