[Xcb] [PATCH proto 10/12] xinput: struct AddMaster: add align-pad at end

Christian Linhart chris at demorecorder.com
Fri Aug 15 11:36:18 PDT 2014


reasons:
* length of the struct is a multiple of 4 according to spec.
* list of char may not end at a 4-byte aligned position.

see:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt#n1224
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n454
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI2proto.h#n458
(file-positions may become wrong if the spec or header change)
---
 src/xinput.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/xinput.xml b/src/xinput.xml
index 1103a86..7547f02 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -1196,14 +1196,15 @@ <struct name="AddMaster">
         <field type="CARD16" name="len" />
         <field type="CARD16" name="name_len" />
         <field type="CARD8"  name="send_core" />
         <field type="CARD8"  name="enable" />
         <list type="char" name="name">
             <fieldref>name_len</fieldref>
         </list>
+        <pad align="4" />
     </struct>
 
     <struct name="RemoveMaster">
         <field type="CARD16"   name="type" enum="HierarchyChangeType" />
         <field type="CARD16"   name="len" />
         <field type="DeviceId" name="deviceid" altenum="Device" />
         <field type="CARD8"    name="return_mode" enum="ChangeMode" />
-- 
2.0.1



More information about the Xcb mailing list