diff options
| author | aarzilli <[email protected]> | 2014-05-02 15:09:23 +0200 |
|---|---|---|
| committer | aarzilli <[email protected]> | 2014-05-02 15:09:23 +0200 |
| commit | cdbc8241c4be92fd4fbb6b7b819e84dce4a06850 (patch) | |
| tree | 46fa3d240fa2e2e4704c972f814ad94e4bc6ce72 /dri2/dri2.go | |
| parent | efcb6d44d2722be3a77fe5292f5bfd5e73ed7e48 (diff) | |
Fix Issue #21: automatic calculation of alignment padding after lists
Diffstat (limited to 'dri2/dri2.go')
| -rw-r--r-- | dri2/dri2.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dri2/dri2.go b/dri2/dri2.go index 6cec3d0..5ad0306 100644 --- a/dri2/dri2.go +++ b/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 } |
