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/xselinux | |
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/xselinux')
-rw-r--r-- | nexgb/xselinux/xselinux.go | 20 |
1 files changed, 10 insertions, 10 deletions
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 } |