[Xcb] [PATCH proto 09/12] xinput: ChangeDeviceProperty-request: add align-pad at end
Christian Linhart
chris at demorecorder.com
Fri Aug 15 11:36:17 PDT 2014
reasons:
* all X11-requests must have a length which is a multiple of 4 bytes
* bitcases "8Bits" and "16bits" may have a length
which is not a multiple of 4-bytes
but they start on a 4-byte aligned position.
Therefore the unpadded end of the request may not be 4-byte aligned
* Therefore this requires a 4-byte align-pad.
notes:
* The align pad had to be added in each relevant bitcase
because adding it after the switch would cause the generator
to abort. (which is OK because a <switch> has to be the last item
of a struct, request or reply, according to the xcb-xml-spec)
---
src/xinput.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/xinput.xml b/src/xinput.xml
index d6932ba..1103a86 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1029,20 +1029,22 @@ <request name="ChangeDeviceProperty" opcode="37">
distinguished exactly as their values don't have equal bits.
-->
<bitcase>
<enumref ref="PropertyFormat">8Bits</enumref>
<list type="CARD8" name="data8">
<fieldref>num_items</fieldref>
</list>
+ <pad align="4" />
</bitcase>
<bitcase>
<enumref ref="PropertyFormat">16Bits</enumref>
<list type="CARD16" name="data16">
<fieldref>num_items</fieldref>
</list>
+ <pad align="4" />
</bitcase>
<bitcase>
<enumref ref="PropertyFormat">32Bits</enumref>
<list type="CARD32" name="data32">
<fieldref>num_items</fieldref>
</list>
</bitcase>
--
2.0.1
More information about the Xcb
mailing list