aboutsummaryrefslogtreecommitdiff
path: root/nexgb/res
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2013-12-28 09:33:09 -0500
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:20 +0200
commit2dc9914b5e6b74c353771e56e90dfd2dd33e0202 (patch)
tree8b9c5a460be7a11c23d46be1887ebcaee1eb33b7 /nexgb/res
parentf0385db3a71c33f19d27dafb2a5d158a8a875200 (diff)
downloadhaven-2dc9914b5e6b74c353771e56e90dfd2dd33e0202.tar.gz
haven-2dc9914b5e6b74c353771e56e90dfd2dd33e0202.tar.xz
haven-2dc9914b5e6b74c353771e56e90dfd2dd33e0202.zip
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 'nexgb/res')
-rw-r--r--nexgb/res/res.go6
1 files changed, 3 insertions, 3 deletions
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)