aboutsummaryrefslogtreecommitdiff
path: root/nexgb/res
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-09-30 16:46:08 +0200
committerPřemysl Janouch <p@janouch.name>2018-09-30 17:34:27 +0200
commit139c50b7488ee2277be7d9b0eee8d807af628932 (patch)
treeb3652edb4dbad148de09507c8697c7fc70d1f7f0 /nexgb/res
parente6e4e9443661bab3bb69a6c32dacfaf0e54f32ef (diff)
downloadhaven-139c50b7488ee2277be7d9b0eee8d807af628932.tar.gz
haven-139c50b7488ee2277be7d9b0eee8d807af628932.tar.xz
haven-139c50b7488ee2277be7d9b0eee8d807af628932.zip
nexgb: update to xcb-proto 1.13
Diffstat (limited to 'nexgb/res')
-rw-r--r--nexgb/res/res.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/nexgb/res/res.go b/nexgb/res/res.go
index 6b1a807..6e686b6 100644
--- a/nexgb/res/res.go
+++ b/nexgb/res/res.go
@@ -157,7 +157,7 @@ func ClientIdSpecListBytes(buf []byte, list []ClientIdSpec) int {
type ClientIdValue struct {
Spec ClientIdSpec
Length uint32
- Value []uint32 // size: xgb.Pad((int(Length) * 4))
+ Value []uint32 // size: xgb.Pad(((int(Length) / 4) * 4))
}
// ClientIdValueRead reads a byte slice into a ClientIdValue value.
@@ -170,8 +170,8 @@ func ClientIdValueRead(buf []byte, v *ClientIdValue) int {
v.Length = xgb.Get32(buf[b:])
b += 4
- v.Value = make([]uint32, v.Length)
- for i := 0; i < int(v.Length); i++ {
+ v.Value = make([]uint32, (int(v.Length) / 4))
+ for i := 0; i < int((int(v.Length) / 4)); i++ {
v.Value[i] = xgb.Get32(buf[b:])
b += 4
}
@@ -191,7 +191,7 @@ func ClientIdValueReadList(buf []byte, dest []ClientIdValue) int {
// Bytes writes a ClientIdValue value to a byte slice.
func (v ClientIdValue) Bytes() []byte {
- buf := make([]byte, (12 + xgb.Pad((int(v.Length) * 4))))
+ buf := make([]byte, (12 + xgb.Pad(((int(v.Length) / 4) * 4))))
b := 0
{
@@ -203,7 +203,7 @@ func (v ClientIdValue) Bytes() []byte {
xgb.Put32(buf[b:], v.Length)
b += 4
- for i := 0; i < int(v.Length); i++ {
+ for i := 0; i < int((int(v.Length) / 4)); i++ {
xgb.Put32(buf[b:], v.Value[i])
b += 4
}
@@ -227,7 +227,7 @@ func ClientIdValueListBytes(buf []byte, list []ClientIdValue) int {
func ClientIdValueListSize(list []ClientIdValue) int {
size := 0
for _, item := range list {
- size += (12 + xgb.Pad((int(item.Length) * 4)))
+ size += (12 + xgb.Pad(((int(item.Length) / 4) * 4)))
}
return size
}