From a548d9d0f7b889627c43b18811357fad88760b2d Mon Sep 17 00:00:00 2001 From: aarzilli Date: Fri, 2 May 2014 15:09:23 +0200 Subject: Fix Issue #21: automatic calculation of alignment padding after lists --- nexgb/xselinux/xselinux.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'nexgb/xselinux') diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index a4cd35e..87d8f98 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -100,12 +100,12 @@ func (v ListItem) Bytes() []byte { b += 4 copy(buf[b:], v.ObjectContext[:v.ObjectContextLen]) - b += xgb.Pad(int(v.ObjectContextLen)) + b += int(v.ObjectContextLen) copy(buf[b:], v.DataContext[:v.DataContextLen]) - b += xgb.Pad(int(v.DataContextLen)) + b += int(v.DataContextLen) - return buf + return buf[:b] } // ListItemListBytes writes a list of ListItem values to a byte slice. @@ -1766,7 +1766,7 @@ func setDeviceContextRequest(c *xgb.Conn, Device uint32, ContextLen uint32, Cont b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1824,7 +1824,7 @@ func setDeviceCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1882,7 +1882,7 @@ func setPropertyCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context str b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1940,7 +1940,7 @@ func setPropertyUseContextRequest(c *xgb.Conn, ContextLen uint32, Context string b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -1998,7 +1998,7 @@ func setSelectionCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context st b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -2056,7 +2056,7 @@ func setSelectionUseContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } @@ -2114,7 +2114,7 @@ func setWindowCreateContextRequest(c *xgb.Conn, ContextLen uint32, Context strin b += 4 copy(buf[b:], Context[:ContextLen]) - b += xgb.Pad(int(ContextLen)) + b += int(ContextLen) return buf } -- cgit v1.2.3-70-g09d2