diff options
author | aarzilli <alessandro.arzilli@gmail.com> | 2014-05-02 15:09:23 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:22 +0200 |
commit | a548d9d0f7b889627c43b18811357fad88760b2d (patch) | |
tree | 0d4a0ad302d753638dfdb16159e03d1fb87b0872 /nexgb/xvmc | |
parent | 1f8bd79abee5d96a41a934d1eb8c74e90ccbcc8f (diff) | |
download | haven-a548d9d0f7b889627c43b18811357fad88760b2d.tar.gz haven-a548d9d0f7b889627c43b18811357fad88760b2d.tar.xz haven-a548d9d0f7b889627c43b18811357fad88760b2d.zip |
Fix Issue #21: automatic calculation of alignment padding after lists
Diffstat (limited to 'nexgb/xvmc')
-rw-r--r-- | nexgb/xvmc/xvmc.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nexgb/xvmc/xvmc.go b/nexgb/xvmc/xvmc.go index cd82b33..a574a21 100644 --- a/nexgb/xvmc/xvmc.go +++ b/nexgb/xvmc/xvmc.go @@ -156,7 +156,7 @@ func (v SurfaceInfo) Bytes() []byte { xgb.Put32(buf[b:], v.Flags) b += 4 - return buf + return buf[:b] } // SurfaceInfoListBytes writes a list of SurfaceInfo values to a byte slice. @@ -275,7 +275,6 @@ func createContextReply(buf []byte) *CreateContextReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -397,7 +396,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply { v.ComponentOrder = make([]byte, 4) copy(v.ComponentOrder[:4], buf[b:]) - b += xgb.Pad(int(4)) + b += int(4) b += 12 // padding @@ -406,7 +405,6 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } @@ -513,7 +511,6 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply { v.PrivData[i] = xgb.Get32(buf[b:]) b += 4 } - b = xgb.Pad(b) return v } |