[Xcb] [PATCH proto 3/3] xkb: Use <pad align="4" /> in GetMap

Peter Harris pharris at opentext.com
Tue Jan 14 12:41:24 PST 2014


There is a bug where lists of size other than one are automatically
aligned by c_client.py. So alignment_pad3 and 4 were aligning twice
and consuming too many bytes.

Rather than change the type to CARD8 and wrap the <op> in yet another
<op> to multiply by two, use the new <pad align> operation.

Signed-off-by: Peter Harris <pharris at opentext.com>
---
 src/xkb.xml | 60 ++++--------------------------------------------------------
 1 file changed, 4 insertions(+), 56 deletions(-)

diff --git a/src/xkb.xml b/src/xkb.xml
index 1df0771..9ef4402 100644
--- a/src/xkb.xml
+++ b/src/xkb.xml
@@ -1351,20 +1351,7 @@ authorization from the authors.
 					<list name="acts_rtrn_count" type="CARD8">
 						<fieldref>nKeyActions</fieldref>
 					</list>
-					<list type="CARD8" name="alignment_pad">
-					    <op op="-">
-						<op op="&">
-						    <op op="+">
-							<fieldref>nKeyActions</fieldref>
-							<value>3</value>
-						    </op>
-						    <unop op="~">
-							<value>3</value>
-						    </unop>
-						</op>
-						<fieldref>nKeyActions</fieldref>
-					    </op>
-					</list>
+                                        <pad align="4" />
 					<list name="acts_rtrn_acts" type="Action">
 						<fieldref>totalActions</fieldref>
 					</list>
@@ -1380,60 +1367,21 @@ authorization from the authors.
 					<list name="vmods_rtrn" type="CARD8" mask="ModMask">
 						<popcount><fieldref>virtualMods</fieldref></popcount>
 					</list>
-					<list type="CARD8" name="alignment_pad2">
-					    <op op="-">
-						<op op="&">
-						    <op op="+">
-							<popcount><fieldref>virtualMods</fieldref></popcount>
-							<value>3</value>
-						    </op>
-						    <unop op="~">
-							<value>3</value>
-						    </unop>
-						</op>
-						<popcount><fieldref>virtualMods</fieldref></popcount>
-					    </op>
-					</list>
+                                        <pad align="4" />
 				</bitcase>
 				<bitcase>
 					<enumref ref="MapPart">ExplicitComponents</enumref>
 					<list name="explicit_rtrn" type="SetExplicit">
 						<fieldref>totalKeyExplicit</fieldref>
 					</list>
-					<list type="CARD16" name="alignment_pad3">
-					    <op op="-">
-						<op op="&">
-						    <op op="+">
-							<fieldref>totalKeyExplicit</fieldref>
-							<value>1</value>
-						    </op>
-						    <unop op="~">
-							<value>1</value>
-						    </unop>
-						</op>
-						<fieldref>totalKeyExplicit</fieldref>
-					    </op>
-					</list>
+                                        <pad align="4" />
 				</bitcase>
 				<bitcase>
 					<enumref ref="MapPart">ModifierMap</enumref>
 					<list name="modmap_rtrn" type="KeyModMap">
 						<fieldref>totalModMapKeys</fieldref>
 					</list>
-					<list type="CARD16" name="alignment_pad4">
-					    <op op="-">
-						<op op="&">
-						    <op op="+">
-							<fieldref>totalModMapKeys</fieldref>
-							<value>1</value>
-						    </op>
-						    <unop op="~">
-							<value>1</value>
-						    </unop>
-						</op>
-						<fieldref>totalModMapKeys</fieldref>
-					    </op>
-					</list>
+                                        <pad align="4" />
 				</bitcase>
 				<bitcase>
 					<enumref ref="MapPart">VirtualModMap</enumref>
-- 
1.8.5.2



More information about the Xcb mailing list