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/dri2/dri2.go | |
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/dri2/dri2.go')
-rw-r--r-- | nexgb/dri2/dri2.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 6cec3d0..5ad0306 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/dri2/dri2.go @@ -76,7 +76,7 @@ func (v AttachFormat) Bytes() []byte { xgb.Put32(buf[b:], v.Format) b += 4 - return buf + return buf[:b] } // AttachFormatListBytes writes a list of AttachFormat values to a byte slice. @@ -281,7 +281,7 @@ func (v DRI2Buffer) Bytes() []byte { xgb.Put32(buf[b:], v.Flags) b += 4 - return buf + return buf[:b] } // DRI2BufferListBytes writes a list of DRI2Buffer values to a byte slice. @@ -567,7 +567,7 @@ func connectReply(buf []byte) *ConnectReply { v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:]) - b += xgb.Pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))) + b += int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))) { byteString := make([]byte, v.DeviceNameLength) @@ -914,7 +914,6 @@ func getBuffersRequest(c *xgb.Conn, Drawable xproto.Drawable, Count uint32, Atta xgb.Put32(buf[b:], Attachments[i]) b += 4 } - b = xgb.Pad(b) return buf } |