diff options
author | Přemysl Janouch <p@janouch.name> | 2018-09-30 16:46:08 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-30 17:34:27 +0200 |
commit | 139c50b7488ee2277be7d9b0eee8d807af628932 (patch) | |
tree | b3652edb4dbad148de09507c8697c7fc70d1f7f0 /nexgb/xproto | |
parent | e6e4e9443661bab3bb69a6c32dacfaf0e54f32ef (diff) | |
download | haven-139c50b7488ee2277be7d9b0eee8d807af628932.tar.gz haven-139c50b7488ee2277be7d9b0eee8d807af628932.tar.xz haven-139c50b7488ee2277be7d9b0eee8d807af628932.zip |
nexgb: update to xcb-proto 1.13
Diffstat (limited to 'nexgb/xproto')
-rw-r--r-- | nexgb/xproto/xproto.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nexgb/xproto/xproto.go b/nexgb/xproto/xproto.go index 82f893d..fc3bfe0 100644 --- a/nexgb/xproto/xproto.go +++ b/nexgb/xproto/xproto.go @@ -5882,7 +5882,9 @@ type SetupRequest struct { AuthorizationProtocolDataLen uint16 // padding: 2 bytes AuthorizationProtocolName string // size: xgb.Pad((int(AuthorizationProtocolNameLen) * 1)) + // alignment gap to multiple of 4 AuthorizationProtocolData string // size: xgb.Pad((int(AuthorizationProtocolDataLen) * 1)) + // alignment gap to multiple of 4 } // SetupRequestRead reads a byte slice into a SetupRequest value. @@ -5915,6 +5917,8 @@ func SetupRequestRead(buf []byte, v *SetupRequest) int { b += int(v.AuthorizationProtocolNameLen) } + b = (b + 3) & ^3 // alignment gap + { byteString := make([]byte, v.AuthorizationProtocolDataLen) copy(byteString[:v.AuthorizationProtocolDataLen], buf[b:]) @@ -5922,6 +5926,8 @@ func SetupRequestRead(buf []byte, v *SetupRequest) int { b += int(v.AuthorizationProtocolDataLen) } + b = (b + 3) & ^3 // alignment gap + return b } @@ -5937,7 +5943,7 @@ func SetupRequestReadList(buf []byte, dest []SetupRequest) int { // Bytes writes a SetupRequest value to a byte slice. func (v SetupRequest) Bytes() []byte { - buf := make([]byte, ((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1)))) + buf := make([]byte, ((((12 + xgb.Pad((int(v.AuthorizationProtocolNameLen) * 1))) + 4) + xgb.Pad((int(v.AuthorizationProtocolDataLen) * 1))) + 4)) b := 0 buf[b] = v.ByteOrder @@ -5962,9 +5968,13 @@ func (v SetupRequest) Bytes() []byte { copy(buf[b:], v.AuthorizationProtocolName[:v.AuthorizationProtocolNameLen]) b += int(v.AuthorizationProtocolNameLen) + b = (b + 3) & ^3 // alignment gap + copy(buf[b:], v.AuthorizationProtocolData[:v.AuthorizationProtocolDataLen]) b += int(v.AuthorizationProtocolDataLen) + b = (b + 3) & ^3 // alignment gap + return buf[:b] } @@ -5984,7 +5994,7 @@ func SetupRequestListBytes(buf []byte, list []SetupRequest) int { func SetupRequestListSize(list []SetupRequest) int { size := 0 for _, item := range list { - size += ((12 + xgb.Pad((int(item.AuthorizationProtocolNameLen) * 1))) + xgb.Pad((int(item.AuthorizationProtocolDataLen) * 1))) + size += ((((12 + xgb.Pad((int(item.AuthorizationProtocolNameLen) * 1))) + 4) + xgb.Pad((int(item.AuthorizationProtocolDataLen) * 1))) + 4) } return size } |