[Xcb] [PATCH] XCB-XML: Proposal for alignment padding

Jamey Sharp jamey at minilop.net
Mon Mar 14 16:26:13 PDT 2011


I'm really late on this thread. Just wanted to throw in these opinions:

- I'm with Julien that in general "I'd rather have that work done in the
  code generator than in the xml description, to keep that as readable
  as possible (and incidentally, avoid introducing new bugs there)."
  
- On the other hand, code generators ought to be simple to write too.

Together, those suggest to me that we should have a separate tool that
pre-processes the XML-XCB protocol descriptions to add any annotations
we know how to automatically compute. It was for reasons like this that
I wrote proto/src/size.py and friends.

A little constant-folding should be able to compute a simplest
expression that correctly specifies length of the request-so-far, modulo
the alignment needed.

And since every type has a natural alignment, we can compute the minimum
padding required before every field, and minimum required at the end of
a request or response. I tend to believe that the original protocol
descriptions should only contain <pad> elements when the protocol
requires more than minimum padding.

But... Until somebody writes the tool that annotates protocol
descriptions with appropriate alignment automatically, the best solution
is probably to take Evgeny's full proposal, including <sizeof> and
<pad align="n">(expression)</pad>.

Later, if we get a pre-processor that can produce those pad tags
automatically, code-generators will still work and we can remove the
redundant information from the descriptions that humans have to deal
with.

I'd like to see this happen.

Jamey

On Mon, Nov 08, 2010 at 12:57:18PM +0300, Evgeny M. Zubok wrote:
> Hello, 
> 
> this is my proposal for the alignment padding. For the purposes of
> present proposal I introduce a new contruct
> 
> <sizeof>reference</sizeof>, 
> 
> which references to a name of entity (list or field) and giving a size
> in bytes of this entity. <sizeof> helps to avoid duplication of the
> complex expressions for length of lists.
> 
> 
> Example 1. Simple length expression.
> 
> <list type="char" name="vendor">
>   <fieldref>vendor_len</fieldref>
> </list>
> 
> <sizeof>vendor</sizeof> is a size in bytes of list "vendor"; in this
> simple case it will be equal to "vendor_len".
> 
> Example 2. Complex length expression.
> 
> <list type="void" name="data">
>   <op op="/">
>     <op op="*">
>       <fieldref>data_len</fieldref>
>       <fieldref>format</fieldref>
>     </op>
>     <value>8</value>
>   </op>
> </list>
> 
> <sizeof>data</sizeof> references to the length expression
> "data_len*format/8"
> 
> Example 3. Simple types.
> 
> if <field type="ATOM" name="property" /> 
> then <sizeof>property</sizeof> is 4.
> 
> if <field type="CARD8" name="mode" enum="PropMode" />
> then <sizeof>PropMode</sizeof> is 1.
>           
> 
> There is an alternative approach. We could extend already existed and
> specified <localfield> in the following way:
> 
> <localfield type="identifier" name="identifier">expression</localfield>
> 
> Then we could write
> 
> <localfield type="CARD32" name="vendor_size">
>   <fieldref>vendor_len</fieldref>
> </localfield>
> <list type="char" name="vendor">
>   <fieldref>vendor_size</fieldref>
> </list>
> <localfield type="CARD32" name="data_size">
>   <op op="/">
>     <op op="*">
>       <fieldref>data_len</fieldref>
>       <fieldref>format</fieldref>
>     </op>
>     <value>8</value>
>   </op>
> </localfield>
> <list type="void" name="data">
>   <fieldref>data_size</fieldref>
> </list>
> 
> 
> 
> PADDING
> =======
> 
> After examining a full set of X Protocol extensions which are
> available in XCB I conclude that the following form is suitable to
> cover different padding schemas:
> 
> <pad align="integer">expression</pad>
> 
> If the number of unused bytes is variable, the encode-form, as it
> described in the X Protocol Specification, typically is:
> 
>       p		unused, p=pad(E),
> 
> where E is some expression, and pad(E) is the number of bytes needed
> to round E up to a multiple of integer i from the align
> attribute. Typically, the value of align attribute is 4. The content
> of the tag is an expression giving the size in bytes. The expression
> usually includes the references to the size(s) of lists or fields from
> the structure.
> 
> 
> Example 1. Pad for a list of simple types and structures.
> 
> <list type="STR" name="names">
>   <fieldref>names_len</fieldref>
> </list>
> <pad align="4"><sizeof>names</sizeof></pad>
> 
> 
> 
> Example 2. Structure KB_LISTING from XKB specification has 2-byte (!)
> alignment.
> 
> 2    CARD16     flags
> 2    n          length
> n    STRING8    string
> p               unused, p=pad(n) to a 2-byte boundary 
> 
> <struct name="Listing">
>   <field name="flags" type="CARD16" />
>   <field name="length" type="CARD16" />
>   <list name="string" type="STRING8">
>     <fieldref>length</fieldref>
>   </list>
>   <pad align="2"><sizeof>string</sizeof></pad>
> </struct>
> 
> 
> 
> Example 3. Structure SYSTEMCOUNTER from XSync has more complex
> alignment scheme: pad is a function on sizes of two adjacent fields.
> 
> 4    COUNTER    counter
> 8    INT64      resolution
> 2    n          length of name in bytes
> n    STRING8    name
> p               pad, p=pad(n+2)
> 
> <struct name="SYSTEMCOUNTER">
>   <field type="COUNTER" name="counter" />
>   <field type="INT64" name="resolution" />
>   <field type="CARD16" name="name_len" />
>   <list type="char" name="name">
>     <fieldref>name_len</fieldref>
>   </list>
>   <pad align="4">
>     <op op="+">
>        <sizeof>name</sizeof>
>        <value>2</value> <!-- or <sizeof>name_len</sizeof> -->
>     </op>
>   </pad>
> </struct>
> 
> 
> 
> Example 4. Even more complex alignment scheme. "ListComponents"
> request from XKB has the pad
> 
> p        unused, p=pad(6+m+k+t+c+s+g)
> 
> <request name="ListComponents" opcode="22">
>   <field name="deviceSpec" type="DeviceSpec" />
>   <field name="maxNames" type="CARD16" />
>   <field name="keymapsSpecLen" type="CARD8" />
>   <list name="keymapsSpec" type="STRING8">
>     <fieldref>keymapsSpecLen</fieldref>
>   </list>
>   <field name="keycodesSpecLen" type="CARD8" />
>     <list name="keycodesSpec" type="STRING8">
>     <fieldref>keycodesSpecLen</fieldref>
>   </list>
>   <field name="typesSpecLen" type="CARD8" />
>   <list name="typesSpec" type="STRING8">
>     <fieldref>typesSpecLen</fieldref>
>   </list>
>   <field name="compatMapSpecLen" type="CARD8" />
>   <list name="compatMapSpec" type="STRING8">
>     <fieldref>compatMapSpecLen</fieldref>
>   </list>
>   <field name="symbolsSpecLen" type="CARD8" />
>   <list name="symbolsSpec" type="STRING8">
>     <fieldref>symbolsSpecLen</fieldref>
>   </list>
>   <field name="geometrySpecLen" type="CARD8" />
>   <list name="geometrySpec" type="STRING8">
>     <fieldref>geometrySpecLen</fieldref>
>   </list>
>   <pad align="4">
>     <op op="+"><sizeof>keymapsSpec</sizeof>
>     <op op="+"><sizeof>keycodesSpec</sizeof>
>     <op op="+"><sizeof>typesSpec</sizeof>
>     <op op="+"><sizeof>compatMapSpec</sizeof>
>     <op op="+"><sizeof>symbolsSpec</sizeof>
>     <op op="+"><sizeof>geometrySpec</sizeof>
>     <value>6</value>
>     </op></op></op></op></op></op>
>   </pad>
>   <reply>
>     ...
>   </reply>
> </request>
> 
> 
> 
> Example 5. <fieldref> may be also used in expression to calculate size
> for padding. In the following example the size of alignment is
> calculated from the three adjacent lists which have the same size. The
> lists follow one after another without any padding between
> them. randr.xml:
> 
> <request name="SetCrtcGamma" opcode="24">
>   <field type="CRTC" name="crtc" />
>   <field type="CARD16" name="size" />
>   <pad bytes="2"/>
>   <list type="CARD16" name="red">
>     <fieldref>size</fieldref>
>   </list>
>   <list type="CARD16" name="green">
>     <fieldref>size</fieldref>
>   </list>
>   <list type="CARD16" name="blue">
>     <fieldref>size</fieldref>
>   </list>
>   <pad align="4">
>     <op op="*">
>       <fieldref>size</fieldref>
>       <value>6</value>
>     </op>
>   </pad>
> </request>
> 
> 
> 
> I've written a patch. Changes:
> 
> * Add the alignment pads to the structures, requests, and replies
>   where the padding is specified. I've made this change for xproto.xml
>   and every extension. List of structures and requests where the
>   changes were made is below
> 
> * Change xtypes.py in order for it not to process <pad> with "align"
>   attribute and not to break a present code generator's behavior. This
>   is temporary stub.
> 
> * Update documentation xml-xcb.txt for <sizeof> and <pad> tags.
> 
> 
> Please, review.
> 
> 
> A list of changed structures and requests groupped by extension
> ===============================================================
> 
> - [X] xproto.xml
> 
>       * Structs
> 	
> 	HOST
> 	SetupRequest
> 	SetupFailed
> 	Setup
> 
>       * Requests
> 	
> 	InternAtom
> 	GetAtomName
> 	ChangeProperty
> 	GetProperty
> 	OpenFont
> 	QueryTextExtents
> 	ListFonts
> 	ListFontsWithInfo
> 	SetFontPath
> 	GetFontPath
> 	SetDashes
> 	PutImage
> 	PolyText8
> 	PolyText16
> 	ImageText8
> 	ImageText16
> 	AllocNamedColor
> 	StoreNamedColor
> 	LookupColor
> 	QueryExtension
> 	ListExtensions
> 	ChangeHosts
> 	SetPointerMapping
> 	GetPointerMapping
> 
> - [X] dri2.xml
> 	      
>       * Requests
> 
> 	Connect
> 
> - [X] randr.xml
> 
>       * Requests
> 
> 	GetScreenInfo
> 	GetScreenResources
> 	GetOutputInfo
> 	ChangeOutputProperty
> 	GetOutputProperty
> 	CreateMode
> 	GetCrtcGamma
> 	SetCrtcGamma
> 	SetCrtcTransform
> 	GetCrtcTransform
> 
> - [X] render.xml
> 
>       * Requests
> 
> 	AddGlyphs
> 	CompositeGlyphs8
> 	CompositeGlyphs16
> 	CompositeGlyphs32
> 	QueryFilters
> 	SetPictureFilter
> 	
> - [X] sync.xml
> 	      
>       * Structs
> 
> 	SYSTEMCOUNTER
> 
> - [X] xf86dri.xml
> 
>       * Requests
> 
> 	OpenConnection
> 	GetClientDriverName
> 
> - [X] xf86vidmode.xml
> 
>       * Requests
> 	
> 	GetMonitor
> 
> - [X] xfixes.xml
> 
>       * Requests
> 
> 	SetCursorName
> 	GetCursorName
> 	GetCursorImageAndName
> 	ChangeCursorByName
> 
> - [X] xinput.xml
> 
>       * Requests
> 
> 	OpenDevice
> 	GetDeviceButtonMapping
> 	SetDeviceButtonMapping
> 
> - [X] xselinux.xml
> 
>       * Structs
> 
> 	ListItem
> 
>       * Requests
> 
> 	SetDeviceCreateContext
> 	GetDeviceCreateContext
> 	SetDeviceContext
> 	GetDeviceContext
> 	SetWindowCreateContext
> 	GetWindowCreateContext
> 	GetWindowContext
> 	SetPropertyCreateContext
> 	GetPropertyCreateContext
> 	SetPropertyUseContext
> 	GetPropertyUseContext
> 	GetPropertyContext
> 	GetPropertyDataContext
> 	SetSelectionCreateContext
> 	GetSelectionCreateContext
> 	SetSelectionUseContext
> 	GetSelectionUseContext
> 	GetSelectionContext
> 	GetSelectionDataContext
> 	GetClientContext
> 
> - [X] xv.xml
> 
>       * Structs
> 
> 	AdaptorInfo
> 	EncodingInfo
> 	
>       * Requests
> 
> 	QueryAdaptor
> 	QueryPortAttributes
> 	PutImage
> 
> - [X] xkb.xml
> 
>       * Structs
> 
> 	CountedString16
> 	
>       * Requests
> 
> 	SelectEvents
> 	GetMap
> 	SetMap
> 	SetNamedIndicator
> 	GetNames
> 	SetNames
> 	ListComponents
> 	GetKbdByName
> 	GetDeviceInfo
> 	SetDebuggingFlags
> 
> - [X] xprint.xml
>       
>       * Structs
> 	
> 	PRINTER
> 
>       * Requests
> 
> 	PrintGetPrinterList
> 	CreateContext
> 	PrintPutDocumentData
> 	PrintGetDocumentData
> 	PrintGetOneAttributes
> 	PrintSetAttributes
> 
> - [X] glx.xml
> 
>       * Requests
> 
> 	RenderLarge
> 	VendorPrivate
> 	VendorPrivateWithData
> 	QueryServerString
> 	ClientInfo
> 	GetBooleanv
> 	GetPixelMapusv
> 	GetString
> 
> 
> Checked. No changes required:
> 
> - [X] bigreq.xml
> - [X] composite.xml
> - [X] xc_misc.xml
> - [X] damage.xml
> - [X] dpms.xml
> - [X] xtest.xml
> - [X] xvmc.xml
> - [X] xinerama.xml
> - [X] res.xml
> - [X] screensaver.xml
> - [X] shape.xml
> - [X] shm.xml
> - [X] xevie.xml
> - [X] ge.xml
> - [X] record.xml
> 

> diff --git a/doc/xml-xcb.txt b/doc/xml-xcb.txt
> index 3c6a155..9d38694 100644
> --- a/doc/xml-xcb.txt
> +++ b/doc/xml-xcb.txt
> @@ -189,6 +189,20 @@ enum; the value is restricted to one of the constants named in the enum.
>    This element declares some padding in a data structure.  The bytes
>    attribute declares the number of bytes of padding.
>  
> +<pad align="integer">expression</pad>
> +  
> +  If the number of unused bytes is variable, the encode-form, as it's
> +  described in the X Protocol Specification, typically is:
> +
> +      p		unused, p=pad(E),
> +
> +  where E is some expression, and pad(E) is the number of bytes needed
> +  to round E up to a multiple of integer i from the align
> +  attribute. Typically, the value of align attribute is 4. The content
> +  of the tag is an expression giving the size of padding in bytes. The
> +  expression usually includes the references to the sizes of either
> +  lists or fields from the current structure.
> +
>  <field type="identifier" name="identifier" />
>  
>    This element represents a field in a data structure.  The type attribute
> @@ -256,6 +270,13 @@ Expressions
>    the structure containing this expression.  The identifier is the value of
>    the "name" attribute on the referenced field.
>  
> +<sizeof>identifier</sizeof>
> +
> +  The sizeof element represents a reference to the size in bytes of
> +  another field or list in the structure containing this
> +  expression. The identifier is the value of the "name" attribute on
> +  the referenced field or list.
> +
>  <value>integer</value>
>  
>    The value element represents a literal integer value in an expression.  The
> diff --git a/src/dri2.xml b/src/dri2.xml
> index dbd43f8..611f26e 100644
> --- a/src/dri2.xml
> +++ b/src/dri2.xml
> @@ -85,23 +85,11 @@ authorization from the authors.
>        <list type="char" name="driver_name">
>          <fieldref>driver_name_length</fieldref>
>        </list>
> -      <list type="void" name="alignment_pad">
> -	  <op op="-">
> -	      <op op="&amp;">
> -		  <op op="+">
> -		      <fieldref>driver_name_length</fieldref>
> -		      <value> 3 </value>
> -		  </op>
> -		  <unop op="~">
> -		      <value>3</value>
> -		  </unop>
> -	      </op>
> -	      <fieldref>driver_name_length</fieldref>
> -	  </op>
> -      </list>
> +      <pad align="4"><sizeof>driver_name</sizeof></pad>
>        <list type="char" name="device_name">
>          <fieldref>device_name_length</fieldref>
>        </list>
> +      <pad align="4"><sizeof>device_name</sizeof></pad>
>      </reply>
>    </request>
>  
> diff --git a/src/glx.xml b/src/glx.xml
> index 544b543..ef6f157 100644
> --- a/src/glx.xml
> +++ b/src/glx.xml
> @@ -139,6 +139,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  		<list type="BYTE" name="data">
>  		    <fieldref>data_len</fieldref>
>  		</list>
> +		<pad align="4"><sizeof>data</sizeof></pad>
>  	</request>
>  
>  	<request name="CreateContext" opcode="3">
> @@ -272,12 +273,14 @@ The patch that fixed this server bug in X.org CVS is here:
>  		<field type="CARD32" name="vendor_code" />
>  		<field type="CONTEXT_TAG" name="context_tag" />
>  		<list type="BYTE" name="data" />
> +		<pad align="4"><sizeof>data</sizeof></pad>
>  	</request>
>  
>  	<request name="VendorPrivateWithReply" opcode="17">
>  		<field type="CARD32" name="vendor_code" />
>  		<field type="CONTEXT_TAG" name="context_tag" />
>  		<list type="BYTE" name="data" />
> +		<pad align="4"><sizeof>data</sizeof></pad>
>  		<reply>
>  			<pad bytes="1" />
>  			<field type="CARD32" name="retval" />
> @@ -314,6 +317,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  			<list type="char" name="string">
>  				<fieldref>str_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>string</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -324,6 +328,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  		<list type="char" name="string">
>  			<fieldref>str_len</fieldref>
>  		</list>
> +		<pad align="4"><sizeof>string</sizeof></pad>
>  	</request>
>  
>  	<!-- Start of GLX 1.3 Requests -->
> @@ -589,6 +594,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  			<list type="BOOL" name="data">
>  				<fieldref>n</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>data</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -814,6 +820,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  			<list type="CARD16" name="data">
>  				<fieldref>n</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>data</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -844,6 +851,7 @@ The patch that fixed this server bug in X.org CVS is here:
>  			<list type="char" name="string">
>  				<fieldref>n</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>string</sizeof></pad>
>  		</reply>
>  	</request>
>  
> diff --git a/src/randr.xml b/src/randr.xml
> index 4f0716f..decd331 100644
> --- a/src/randr.xml
> +++ b/src/randr.xml
> @@ -151,6 +151,12 @@ authorization from the authors.
>  					<fieldref>nSizes</fieldref>
>  				</op>
>  			</list>
> +			<pad align="4">
> +			  <op op="*">
> +			    <fieldref>nInfo</fieldref>
> +			    <value>2</value>
> +			  </op>
> +			</pad>
>  		</reply>
>  	</request>
>  
> @@ -237,6 +243,7 @@ authorization from the authors.
>  			<list type="BYTE" name="names">
>  			    <fieldref>names_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>names</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -275,6 +282,7 @@ authorization from the authors.
>  			<list type="BYTE" name="name">
>  			    <fieldref>name_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>name</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -331,6 +339,7 @@ authorization from the authors.
>  			<value>8</value>
>  		    </op>
>  		</list>
> +		<pad align="4"><sizeof>data</sizeof></pad>
>  	</request>
>  
>  	<request name="DeleteOutputProperty" opcode="14">
> @@ -364,6 +373,7 @@ authorization from the authors.
>  					</op>
>  				</op>
>  			</list>
> +			<pad align="4"><sizeof>data</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -371,6 +381,7 @@ authorization from the authors.
>  		<field type="WINDOW" name="window" />
>  		<field type="ModeInfo" name="mode_info" />
>  		<list type="char" name="name" />
> +		<pad align="4"><sizeof>name</sizeof></pad>
>  		<reply>
>  			<pad bytes="1" />
>  			<field type="MODE" name="mode" />
> @@ -458,6 +469,12 @@ authorization from the authors.
>  				<fieldref>size</fieldref>
>  			</list>
>  		</reply>
> +		<pad align="4">
> +		  <op op="*">
> +		    <fieldref>size</fieldref>
> +		    <value>6</value>
> +		  </op>
> +		</pad>
>  	</request>
>  
>  	<request name="SetCrtcGamma" opcode="24">
> @@ -473,6 +490,12 @@ authorization from the authors.
>  		<list type="CARD16" name="blue">
>  			<fieldref>size</fieldref>
>  		</list>
> +		<pad align="4">
> +		  <op op="*">
> +		    <fieldref>size</fieldref>
> +		    <value>6</value>
> +		  </op>
> +		</pad>
>  	</request>
>  
>  	<!-- new in 1.3 -->
> @@ -503,6 +526,7 @@ authorization from the authors.
>  			<list type="BYTE" name="names">
>  			    <fieldref>names_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>names</sizeof></pad>
>  		</reply>
>  	</request>
>  
> @@ -514,6 +538,7 @@ authorization from the authors.
>  		<list type="char" name="filter_name">
>  			<fieldref>filter_len</fieldref>
>  		</list>
> +		<pad align="4"><sizeof>filter_name</sizeof></pad>
>  		<list type="FIXED" name="filter_params" />
>  	</request>
>  
> @@ -533,12 +558,14 @@ authorization from the authors.
>  			<list type="char" name="pending_filter_name" >
>  				<fieldref>pending_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>pending_filter_name</sizeof></pad>
>  			<list type="FIXED" name="pending_params" >
>  				<fieldref>pending_nparams</fieldref>
>  			</list>
>  			<list type="char" name="current_filter_name" >
>  				<fieldref>current_len</fieldref>
>  			</list>
> +			<pad align="4"><sizeof>current_filter_name</sizeof></pad>
>  			<list type="FIXED" name="current_params" >
>  				<fieldref>current_nparams</fieldref>
>  			</list>
> diff --git a/src/render.xml b/src/render.xml
> index 59cc8e0..2769e4b 100644
> --- a/src/render.xml
> +++ b/src/render.xml
> @@ -377,6 +377,7 @@ for licensing information.
>        <fieldref>glyphs_len</fieldref>
>      </list>
>      <list type="BYTE" name="data" />
> +    <pad align="4"><sizeof>data</sizeof></pad>
>    </request>
>  
>    <!-- opcode 21 reserved for AddGlyphsFromPicture -->
> @@ -396,6 +397,7 @@ for licensing information.
>      <field type="INT16" name="src_x" />
>      <field type="INT16" name="src_y" />
>      <list type="BYTE" name="glyphcmds" />
> +    <pad align="4"><sizeof>glyphcmds</sizeof></pad>
>    </request>
>  
>    <request name="CompositeGlyphs16" opcode="24">
> @@ -408,6 +410,7 @@ for licensing information.
>      <field type="INT16" name="src_x" />
>      <field type="INT16" name="src_y" />
>      <list type="BYTE" name="glyphcmds" />
> +    <pad align="4"><sizeof>glyphcmds</sizeof></pad>
>    </request>
>  
>    <request name="CompositeGlyphs32" opcode="25">
> @@ -420,6 +423,7 @@ for licensing information.
>      <field type="INT16" name="src_x" />
>      <field type="INT16" name="src_y" />
>      <list type="BYTE" name="glyphcmds" />
> +    <pad align="4"><sizeof>glyphcmds</sizeof></pad>
>    </request>
>  
>    <!-- new in version 0.1 -->
> @@ -470,9 +474,11 @@ for licensing information.
>        <list type="CARD16" name="aliases">
>          <fieldref>num_aliases</fieldref>
>        </list>
> +      <pad align="4"><sizeof>aliases</sizeof></pad>
>        <list type="STR" name="filters">
>          <fieldref>num_filters</fieldref>
>        </list>
> +      <pad align="4"><sizeof>filters</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -483,6 +489,7 @@ for licensing information.
>      <list type="char" name="filter">
>        <fieldref>filter_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>filter</sizeof></pad>
>      <list type="FIXED" name="values" />
>    </request>
>  
> diff --git a/src/sync.xml b/src/sync.xml
> index e309233..1a583bc 100644
> --- a/src/sync.xml
> +++ b/src/sync.xml
> @@ -51,6 +51,12 @@ for licensing information.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4">
> +      <op op="+">
> +	<sizeof>name</sizeof>
> +	<value>2</value>
> +      </op>
> +    </pad>
>    </struct>
>  
>    <struct name="TRIGGER">
> diff --git a/src/xf86dri.xml b/src/xf86dri.xml
> index 5bfc572..ad6f572 100644
> --- a/src/xf86dri.xml
> +++ b/src/xf86dri.xml
> @@ -69,6 +69,7 @@ authorization from the authors.
>  	    <list type="char" name="bus_id">
>  		<fieldref>bus_id_len</fieldref>
>  	    </list>
> +	    <pad align="4"><sizeof>bus_id</sizeof></pad>
>  	</reply>
>      </request>
>  
> @@ -88,6 +89,7 @@ authorization from the authors.
>  	    <list type="char" name="client_driver_name">
>  		<fieldref>client_driver_name_len</fieldref>
>  	    </list>
> +	    <pad align="4"><sizeof>client_driver_name</sizeof></pad>
>  	</reply>
>      </request>
>  
> diff --git a/src/xf86vidmode.xml b/src/xf86vidmode.xml
> index 9dacaef..e237dfd 100644
> --- a/src/xf86vidmode.xml
> +++ b/src/xf86vidmode.xml
> @@ -154,23 +154,11 @@ authorization from the authors.
>  	    <list type="char" name="vendor">
>  		<fieldref>vendor_length</fieldref>
>  	    </list>
> -	    <list type="void" name="alignment_pad">
> -		<op op="-">
> -		    <op op="&amp;">
> -			<op op="+">
> -			    <fieldref>vendor_length</fieldref>
> -			    <value> 3 </value>
> -			</op>
> -			<unop op="~">
> -			    <value>3</value>
> -			</unop>
> -		    </op>
> -		    <fieldref>vendor_length</fieldref>
> -		</op>
> -	    </list>
> +	    <pad align="4"><sizeof>vendor</sizeof></pad>
>  	    <list type="char" name="model">
>  		<fieldref>model_length</fieldref>
>  	    </list>
> +	    <pad align="4"><sizeof>model</sizeof></pad>
>  	</reply>
>      </request>
>  
> diff --git a/src/xfixes.xml b/src/xfixes.xml
> index 9bbeaab..acfadd9 100644
> --- a/src/xfixes.xml
> +++ b/src/xfixes.xml
> @@ -265,6 +265,7 @@ authorization from the authors.
>      <field type="CARD16" name="nbytes" />
>      <pad bytes="2" />
>      <list  type="char"   name="name"><fieldref>nbytes</fieldref></list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>    </request>
>  
>    <request name="GetCursorName" opcode="24">
> @@ -275,6 +276,7 @@ authorization from the authors.
>        <field type="CARD16" name="nbytes" />
>        <pad bytes="18" />
>        <list  type="char"   name="name"><fieldref>nbytes</fieldref></list>
> +      <pad align="4"><sizeof>name</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -292,6 +294,7 @@ authorization from the authors.
>        <field type="CARD16" name="nbytes" />
>        <pad bytes="2" />
>        <list  type="char"   name="name"><fieldref>nbytes</fieldref></list>
> +      <pad align="4"><sizeof>name</sizeof></pad>
>        <list  type="CARD32" name="cursor_image">
>          <op op="*">
>            <fieldref>width</fieldref>
> @@ -311,6 +314,7 @@ authorization from the authors.
>      <field type="CARD16" name="nbytes" />
>      <pad bytes="2" />
>      <list  type="char"   name="name"><fieldref>nbytes</fieldref></list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>    </request>
>  
>    <!-- Version 3 -->
> diff --git a/src/xinput.xml b/src/xinput.xml
> index 80416fe..08e4486 100644
> --- a/src/xinput.xml
> +++ b/src/xinput.xml
> @@ -53,6 +53,7 @@ authorization from the authors.
>  	<list type="char" name="name">
>  	    <fieldref>name_len</fieldref>
>  	</list>
> +	<pad align="4"><sizeof>name</sizeof></pad>
>  	<reply>
>  	    <pad bytes="1" />
>  	    <field type="CARD16" name="server_major" />
> @@ -157,6 +158,7 @@ authorization from the authors.
>  	    <list type="InputClassInfo" name="class_info">
>  		<fieldref>num_classes</fieldref>
>  	    </list>
> +	    <pad align="4"><sizeof>class_info</sizeof></pad>
>  	</reply>
>      </request>
>  
> @@ -653,6 +655,7 @@ authorization from the authors.
>  	    <list type="CARD8" name="map">
>  		<fieldref>map_size</fieldref>
>  	    </list>
> +	    <pad align="4"><sizeof>map</sizeof></pad>
>  	</reply>
>      </request>
>  
> @@ -665,6 +668,7 @@ authorization from the authors.
>  	<list type="CARD8" name="map">
>  	    <fieldref>map_size</fieldref>
>  	</list>
> +	<pad align="4"><sizeof>map</sizeof></pad>
>  	<reply>
>  	    <pad bytes="1" />
>  	    <field type="CARD8" name="status" enum="MappingStatus" />
> diff --git a/src/xkb.xml b/src/xkb.xml
> index 33d3ea3..2a21e0b 100644
> --- a/src/xkb.xml
> +++ b/src/xkb.xml
> @@ -396,7 +396,9 @@ authorization from the authors.
>  		<list name="string" type="CARD8">
>  			<fieldref>length</fieldref>
>  		</list>
> -		<pad bytes="1" />
> +		<pad align="4">
> +		  <op op="+"><sizeof>string</sizeof><value>1</value></op>
> +		</pad>
>  	</struct>
>  
>  	<struct name="KTMapEntry">
> @@ -733,6 +735,7 @@ authorization from the authors.
>  		<list name="string" type="STRING8">
>  			<fieldref>length</fieldref>
>  		</list>
> +		<pad align="2"><sizeof>string</sizeof></pad>
>  	</struct>
>  
>  	<struct name="DeviceLedInfo">
> @@ -1125,6 +1128,7 @@ authorization from the authors.
>  				<field name="extdevDetails" type="CARD16" mask="XIFeature" />
>  			</bitcase>
>  		</switch>
> +		<pad align="4"><sizeof>details</sizeof></pad>
>  	</request>
>  
>  	<request name="Bell" opcode="3">
> @@ -1319,6 +1323,7 @@ authorization from the authors.
>  					<list name="acts_rtrn_count" type="CARD8">
>  						<fieldref>nKeyActions</fieldref>
>  					</list>
> +					<pad align="4"><sizeof>acts_rtrn_count</sizeof></pad>
>  					<list name="acts_rtrn_acts" type="Action">
>  						<fieldref>totalActions</fieldref>
>  					</list>
> @@ -1334,18 +1339,21 @@ authorization from the authors.
>  					<list name="vmods_rtrn" type="CARD8" mask="ModMask">
>  						<fieldref>nVModMapKeys</fieldref>
>  					</list>
> +					<pad align="4"><sizeof>vmods_rtrn</sizeof></pad>
>  				</bitcase>
>  				<bitcase>
>  					<enumref ref="MapPart">ExplicitComponents</enumref>
>  					<list name="explicit_rtrn" type="SetExplicit">
>  						<fieldref>totalKeyExplicit</fieldref>
>  					</list>
> +					<pad align="4"><sizeof>explicit_rtrn</sizeof></pad>
>  				</bitcase>
>  				<bitcase>
>  					<enumref ref="MapPart">ModifierMap</enumref>
>  					<list name="modmap_rtrn" type="KeyModMap">
>  						<fieldref>totalModMapKeys</fieldref>
>  					</list>
> +					<pad align="4"><sizeof>modmap_rtrn</sizeof></pad>
>  				</bitcase>
>  				<bitcase>
>  					<enumref ref="MapPart">VirtualModMap</enumref>
> @@ -1403,6 +1411,7 @@ authorization from the authors.
>  				<list name="actionsCount" type="CARD8">
>  					<fieldref>nKeyActions</fieldref>
>  				</list>
> +				<pad align="4"><sizeof>actionsCount</sizeof></pad>
>  				<list name="actions" type="Action">
>  					<fieldref>totalActions</fieldref>
>  				</list>
> @@ -1418,18 +1427,21 @@ authorization from the authors.
>  				<list name="vmods" type="CARD8">
>  					<fieldref>nVModMapKeys</fieldref>
>  				</list>
> +				<pad align="4"><sizeof>vmods</sizeof></pad>
>  			</bitcase>
>  			<bitcase>
>  				<enumref ref="MapPart">ExplicitComponents</enumref>
>  				<list name="explicit" type="SetExplicit">
>  					<fieldref>totalKeyExplicit</fieldref>
>  				</list>
> +				<pad align="4"><sizeof>explicit</sizeof></pad>
>  			</bitcase>
>  			<bitcase>
>  				<enumref ref="MapPart">ModifierMap</enumref>
>  				<list name="modmap" type="KeyModMap">
>  					<fieldref>totalModMapKeys</fieldref>
>  				</list>
> +				<pad align="4"><sizeof>modmap</sizeof></pad>
>  			</bitcase>
>  			<bitcase>
>  				<enumref ref="MapPart">VirtualModMap</enumref>
> @@ -1628,6 +1640,7 @@ authorization from the authors.
>  					<list name="nLevelsPerType" type="CARD8">
>  						<fieldref>nKTLevels</fieldref>
>  					</list>
> +					<pad align="4"><sizeof>nLevelsPerType</sizeof></pad>
>  					<list name="ktLevelNames" type="ATOM">
>  						<sumof ref="nLevelsPerType" />
>  					</list>
> @@ -1731,6 +1744,7 @@ authorization from the authors.
>  				<list name="nLevelsPerType" type="CARD8">
>  					<fieldref>nKTLevels</fieldref>
>  				</list>
> +				<pad align="4"><sizeof>nLevelsPerType</sizeof></pad>
>  				<list name="ktLevelNames" type="ATOM">
>  					<sumof ref="nLevelsPerType" />
>  				</list>
> @@ -1901,6 +1915,16 @@ authorization from the authors.
>  		<list name="geometrySpec" type="STRING8">
>  			<fieldref>geometrySpecLen</fieldref>
>  		</list>
> +		<pad align="4">
> +		  <op op="+"><sizeof>keymapsSpec</sizeof>
> +		  <op op="+"><sizeof>keycodesSpec</sizeof>
> +		  <op op="+"><sizeof>typesSpec</sizeof>
> +		  <op op="+"><sizeof>compatMapSpec</sizeof>
> +		  <op op="+"><sizeof>symbolsSpec</sizeof>
> +		  <op op="+"><sizeof>geometrySpec</sizeof>
> +		  <value>6</value>
> +		  </op></op></op></op></op></op>
> +		</pad>
>  		<reply>
>  			<field name="deviceID" type="CARD8" />
>  			<field name="nKeymaps" type="CARD16" />
> @@ -1929,6 +1953,15 @@ authorization from the authors.
>  			<list name="geometries" type="Listing">
>  				<fieldref>nGeometries</fieldref>
>  			</list>
> +			<pad align="4">
> +			  <op op="+"><sizeof>keymaps</sizeof>
> +			  <op op="+"><sizeof>keycodes</sizeof>
> +			  <op op="+"><sizeof>types</sizeof>
> +			  <op op="+"><sizeof>compatMaps</sizeof>
> +			  <op op="+"><sizeof>symbols</sizeof>
> +			  <sizeof>geometries</sizeof>
> +			  </op></op></op></op></op>
> +			</pad>
>  		</reply>
>  	</request>
>  
> @@ -1962,6 +1995,16 @@ authorization from the authors.
>  		<list name="geometrySpec" type="STRING8">
>  			<fieldref>geometrySpecLen</fieldref>
>  		</list>
> +		<pad align="4">
> +		  <op op="+"><sizeof>keymapsSpec</sizeof>
> +		  <op op="+"><sizeof>keycodesSpec</sizeof>
> +		  <op op="+"><sizeof>typesSpec</sizeof>
> +		  <op op="+"><sizeof>compatMapSpec</sizeof>
> +		  <op op="+"><sizeof>symbolsSpec</sizeof>
> +		  <op op="+"><sizeof>geometrySpec</sizeof>
> +		  <value>6</value>
> +		  </op></op></op></op></op></op>
> +		</pad>
>  		<reply>
>  			<field name="deviceID" type="CARD8" />
>  			<field name="minKeyCode" type="KEYCODE" />
> @@ -2022,6 +2065,7 @@ authorization from the authors.
>  							<list name="acts_rtrn_count" type="CARD8">
>  								<fieldref>nKeyActions</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>acts_rtrn_count</sizeof></pad>
>  							<list name="acts_rtrn_acts" type="Action">
>  								<fieldref>totalActions</fieldref>
>  							</list>
> @@ -2037,18 +2081,21 @@ authorization from the authors.
>  							<list name="vmods_rtrn" type="CARD8" mask="ModMask">
>  								<fieldref>nVModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>vmods_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ExplicitComponents</enumref>
>  							<list name="explicit_rtrn" type="SetExplicit">
>  								<fieldref>totalKeyExplicit</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>explicit_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ModifierMap</enumref>
>  							<list name="modmap_rtrn" type="KeyModMap">
>  								<fieldref>totalModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>modmap_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">VirtualModMap</enumref>
> @@ -2128,6 +2175,7 @@ authorization from the authors.
>  							<list name="acts_rtrn_count" type="CARD8">
>  								<fieldref>nKeyActions</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>acts_rtrn_count</sizeof></pad>
>  							<list name="acts_rtrn_acts" type="Action">
>  								<fieldref>totalActions</fieldref>
>  							</list>
> @@ -2143,18 +2191,21 @@ authorization from the authors.
>  							<list name="vmods_rtrn" type="CARD8" mask="ModMask">
>  								<fieldref>nVModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>vmods_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ExplicitComponents</enumref>
>  							<list name="explicit_rtrn" type="SetExplicit">
>  								<fieldref>totalKeyExplicit</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>explicit_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ModifierMap</enumref>
>  							<list name="modmap_rtrn" type="KeyModMap">
>  								<fieldref>totalModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>modmap_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">VirtualModMap</enumref>
> @@ -2213,6 +2264,7 @@ authorization from the authors.
>  							<list name="acts_rtrn_count" type="CARD8">
>  								<fieldref>nKeyActions</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>acts_rtrn_count</sizeof></pad>
>  							<list name="acts_rtrn_acts" type="Action">
>  								<fieldref>totalActions</fieldref>
>  							</list>
> @@ -2228,18 +2280,21 @@ authorization from the authors.
>  							<list name="vmods_rtrn" type="CARD8" mask="ModMask">
>  								<fieldref>nVModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>vmods_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ExplicitComponents</enumref>
>  							<list name="explicit_rtrn" type="SetExplicit">
>  								<fieldref>totalKeyExplicit</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>explicit_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">ModifierMap</enumref>
>  							<list name="modmap_rtrn" type="KeyModMap">
>  								<fieldref>totalModMapKeys</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>modmap_rtrn</sizeof></pad>
>  						</bitcase>
>  						<bitcase>
>  							<enumref ref="MapPart">VirtualModMap</enumref>
> @@ -2313,6 +2368,7 @@ authorization from the authors.
>  							<list name="nLevelsPerType" type="CARD8">
>  								<fieldref>nKTLevels</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>nLevelsPerType</sizeof></pad>
>  							<list name="ktLevelNames" type="ATOM">
>  								<sumof ref="nLevelsPerType" />
>  							</list>
> @@ -2414,6 +2470,7 @@ authorization from the authors.
>  							<list name="nLevelsPerType" type="CARD8">
>  								<fieldref>nKTLevels</fieldref>
>  							</list>
> +							<pad align="4"><sizeof>nLevelsPerType</sizeof></pad>
>  							<list name="ktLevelNames" type="ATOM">
>  								<sumof ref="nLevelsPerType" />
>  							</list>
> @@ -2531,6 +2588,12 @@ authorization from the authors.
>  			<list name="name" type="STRING8">
>  				<fieldref>nameLen</fieldref>
>  			</list>
> +			<pad align="4">
> +			  <op op="+">
> +			    <sizeof>name</sizeof>
> +			    <value>2</value>
> +			  </op>
> +			</pad>
>  			<list name="btnActions" type="Action">
>  				<fieldref>nBtnsRtrn</fieldref>
>  			</list>
> @@ -2565,6 +2628,7 @@ authorization from the authors.
>  		<list name="message" type="STRING8">
>  			<fieldref>msgLength</fieldref>
>  		</list>
> +		<pad align="4"><sizeof>message</sizeof></pad>
>  		<reply>
>  			<pad bytes="1" />
>  			<field name="currentFlags" type="CARD32" />
> diff --git a/src/xprint.xml b/src/xprint.xml
> index ffd8df1..bfa3fc4 100644
> --- a/src/xprint.xml
> +++ b/src/xprint.xml
> @@ -41,12 +41,12 @@ authorization from the authors.
>          <list type="STRING8" name="name">
>              <fieldref>nameLen</fieldref>
>          </list>
> -        <!-- Padding -->
> +	<pad align="4"><sizeof>name</sizeof></pad>
>          <field type="CARD32" name="descLen" />
>          <list type="STRING8" name="description">
>              <fieldref>descLen</fieldref>
>          </list>
> -        <!-- More padding -->
> +	<pad align="4"><sizeof>description</sizeof></pad>
>      </struct>
>  
>      <!--<typedef oldname="CARD32" newname="PCONTEXT" />-->
> @@ -102,10 +102,11 @@ authorization from the authors.
>          <list type="STRING8" name="printer_name">
>              <fieldref>printerNameLen</fieldref>
>          </list>
> -        <!-- There's some padding in here... -->
> +	<pad align="4"><sizeof>printer_name</sizeof></pad>
>          <list type="STRING8" name="locale">
>              <fieldref>localeLen</fieldref>
>          </list>
> +	<pad align="4"><sizeof>locale</sizeof></pad>
>          <reply>
>              <pad bytes="1" />
>              <field type="CARD32" name="listCount" />
> @@ -125,10 +126,11 @@ authorization from the authors.
>          <list type="STRING8" name="printerName">
>              <fieldref>printerNameLen</fieldref>
>          </list>
> -        <!-- padding -->
> +	<pad align="4"><sizeof>printerName</sizeof></pad>
>          <list type="STRING8" name="locale">
>              <fieldref>localeLen</fieldref>
>          </list>
> +	<pad align="4"><sizeof>locale</sizeof></pad>
>      </request>
>  
>      <request name="PrintSetContext" opcode="3">
> @@ -177,10 +179,11 @@ authorization from the authors.
>          <list type="BYTE" name="data">
>              <fieldref>len_data</fieldref>
>          </list>
> -        <!-- padding -->
> +	<pad align="4"><sizeof>data</sizeof></pad>
>          <list type="STRING8" name="doc_format" />
> -        <!-- padding -->
> +	<pad align="4"><sizeof>doc_format</sizeof></pad>
>          <list type="STRING8" name="options" />
> +	<pad align="4"><sizeof>options</sizeof></pad>
>      </request>
>  
>      <request name="PrintGetDocumentData" opcode="12">
> @@ -195,6 +198,7 @@ authorization from the authors.
>              <list type="BYTE" name="data">
>                  <fieldref>dataLen</fieldref>
>              </list>
> +	    <pad align="4"><sizeof>data</sizeof></pad>
>          </reply>
>      </request>
>  
> @@ -247,6 +251,7 @@ authorization from the authors.
>          <list type="STRING8" name="name">
>              <fieldref>nameLen</fieldref>
>          </list>
> +	<pad align="4"><sizeof>name</sizeof></pad>
>          <reply>
>              <pad bytes="1" />
>              <field type="CARD32" name="valueLen" />
> @@ -254,6 +259,7 @@ authorization from the authors.
>              <list type="STRING8" name="value">
>                  <fieldref>valueLen</fieldref>
>              </list>
> +	    <pad align="4"><sizeof>value</sizeof></pad>
>          </reply>
>      </request>
>  
> @@ -264,6 +270,7 @@ authorization from the authors.
>          <field type="CARD8" name="rule" />
>          <pad bytes="2" />
>          <list type="STRING8" name="attributes" />
> +	<pad align="4"><sizeof>attributes</sizeof></pad>
>      </request>
>  
>      <request name="PrintGetPageDimensions" opcode="21">
> diff --git a/src/xproto.xml b/src/xproto.xml
> index ae20fde..1df13d3 100644
> --- a/src/xproto.xml
> +++ b/src/xproto.xml
> @@ -195,9 +195,11 @@ authorization from the authors.
>      <list type="char" name="authorization_protocol_name">
>        <fieldref>authorization_protocol_name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>authorization_protocol_name</sizeof></pad>
>      <list type="char" name="authorization_protocol_data">
>        <fieldref>authorization_protocol_data_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>authorization_protocol_data</sizeof></pad>
>    </struct>
>  
>    <struct name="SetupFailed">
> @@ -209,6 +211,7 @@ authorization from the authors.
>      <list type="char" name="reason">
>        <fieldref>reason_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>reason</sizeof></pad>
>    </struct>
>  
>    <struct name="SetupAuthenticate">
> @@ -252,6 +255,7 @@ authorization from the authors.
>      <list type="char" name="vendor">
>        <fieldref>vendor_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>vendor</sizeof></pad>
>      <list type="FORMAT" name="pixmap_formats">
>        <fieldref>pixmap_formats_len</fieldref>
>      </list>
> @@ -989,6 +993,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>      <reply>
>        <pad bytes="1" />
>        <field type="ATOM" name="atom" altenum="Atom" />
> @@ -1005,6 +1010,7 @@ authorization from the authors.
>        <list type="char" name="name">
>          <fieldref>name_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>name</sizeof></pad>
>      </reply>
>    </request>
>    
> @@ -1031,6 +1037,7 @@ authorization from the authors.
>          <value>8</value>
>        </op>
>      </list>
> +    <pad align="4"><sizeof>data</sizeof></pad>
>    </request>
>  
>    <request name="DeleteProperty" opcode="19">
> @@ -1065,6 +1072,7 @@ authorization from the authors.
>  	  </op>
>  	</op>
>        </list>
> +      <pad align="4"><sizeof>value</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -1349,6 +1357,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>    </request>
>  
>    <request name="CloseFont" opcode="46">
> @@ -1410,6 +1419,7 @@ authorization from the authors.
>      </exprfield>
>      <field type="FONTABLE" name="font" />
>      <list type="CHAR2B" name="string" />
> +    <pad align="4"><sizeof>string</sizeof></pad>
>      <reply>
>        <field type="BYTE" name="draw_direction" enum="FontDraw" />
>        <field type="INT16" name="font_ascent" />
> @@ -1436,6 +1446,7 @@ authorization from the authors.
>      <list type="char" name="pattern">
>        <fieldref>pattern_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>pattern</sizeof></pad>
>      <reply>
>        <pad bytes="1" />
>        <field type="CARD16" name="names_len" />
> @@ -1443,6 +1454,7 @@ authorization from the authors.
>        <list type="STR" name="names">
>          <fieldref>names_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>names</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -1453,6 +1465,7 @@ authorization from the authors.
>      <list type="char" name="pattern">
>        <fieldref>pattern_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>pattern</sizeof></pad>
>      <reply>
>        <field type="CARD8" name="name_len" />
>        <field type="CHARINFO" name="min_bounds" />
> @@ -1476,6 +1489,7 @@ authorization from the authors.
>        <list type="char" name="name">
>          <fieldref>name_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>name</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -1483,6 +1497,7 @@ authorization from the authors.
>      <pad bytes="1" />
>      <field type="CARD16" name="font_qty" />
>      <list type="char" name="path" />
> +    <pad align="4"><sizeof>font_qty</sizeof></pad>
>    </request>
>  
>    <request name="GetFontPath" opcode="52">
> @@ -1493,6 +1508,7 @@ authorization from the authors.
>        <list type="STR" name="path">
>          <fieldref>path_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>path</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -1628,6 +1644,7 @@ authorization from the authors.
>      <list type="CARD8" name="dashes">
>        <fieldref>dashes_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>dashes</sizeof></pad>
>    </request>
>  
>    <enum name="ClipOrdering">
> @@ -1787,6 +1804,7 @@ authorization from the authors.
>      <field type="CARD8" name="depth" />
>      <pad bytes="2" />
>      <list type="BYTE" name="data" />
> +    <pad align="4"><sizeof>data</sizeof></pad>
>    </request>
>  
>    <!-- FIXME: data array in reply will include padding, but ought not to. -->
> @@ -1818,6 +1836,7 @@ authorization from the authors.
>      <field type="INT16" name="x" />
>      <field type="INT16" name="y" />
>      <list type="BYTE" name="items" />
> +    <pad align="4"><sizeof>items</sizeof></pad>
>    </request>
>  
>    <request name="PolyText16" opcode="75">
> @@ -1827,6 +1846,7 @@ authorization from the authors.
>      <field type="INT16" name="x" />
>      <field type="INT16" name="y" />
>      <list type="BYTE" name="items" />
> +    <pad align="4"><sizeof>items</sizeof></pad>
>    </request>
>  
>    <request name="ImageText8" opcode="76">
> @@ -1838,6 +1858,7 @@ authorization from the authors.
>      <list type="char" name="string">
>        <fieldref>string_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>string</sizeof></pad>
>    </request>
>  
>    <request name="ImageText16" opcode="77">
> @@ -1849,6 +1870,7 @@ authorization from the authors.
>      <list type="CHAR2B" name="string">
>        <fieldref>string_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>string</sizeof></pad>
>    </request>
>  
>    <enum name= "ColormapAlloc">
> @@ -1922,6 +1944,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>      <reply>
>        <pad bytes="1" />
>        <field type="CARD32" name="pixel" />
> @@ -2011,6 +2034,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>    </request>
>  
>    <struct name="RGB">
> @@ -2042,6 +2066,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>      <reply>
>        <pad bytes="1" />
>        <field type="CARD16" name="exact_red" />
> @@ -2132,6 +2157,7 @@ authorization from the authors.
>      <list type="char" name="name">
>        <fieldref>name_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>name</sizeof></pad>
>      <reply>
>        <pad bytes="1" />
>        <field type="BOOL" name="present" />
> @@ -2148,6 +2174,7 @@ authorization from the authors.
>        <list type="STR" name="names">
>          <fieldref>names_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>nemes</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -2297,6 +2324,7 @@ authorization from the authors.
>      <list type="char" name="address">
>        <fieldref>address_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>address</sizeof></pad>
>    </request>
>  
>    <struct name="HOST">
> @@ -2306,6 +2334,7 @@ authorization from the authors.
>      <list type="BYTE" name="address">
>        <fieldref>address_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>address</sizeof></pad>
>    </struct>
>  
>    <request name="ListHosts" opcode="110">
> @@ -2378,6 +2407,7 @@ authorization from the authors.
>      <list type="CARD8" name="map">
>        <fieldref>map_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>map</sizeof></pad>
>      <reply>
>        <field type="BYTE" name="status" enum="MappingStatus" />
>      </reply>
> @@ -2390,6 +2420,7 @@ authorization from the authors.
>        <list type="CARD8" name="map">
>          <fieldref>map_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>map</sizeof></pad>
>      </reply>
>    </request>
>    
> diff --git a/src/xselinux.xml b/src/xselinux.xml
> index 7751470..c87bbf1 100644
> --- a/src/xselinux.xml
> +++ b/src/xselinux.xml
> @@ -41,6 +41,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetDeviceCreateContext" opcode="2">
> @@ -51,6 +52,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -60,6 +62,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetDeviceContext" opcode="4">
> @@ -71,6 +74,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -79,6 +83,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetWindowCreateContext" opcode="6">
> @@ -89,6 +94,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -101,6 +107,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -111,9 +118,11 @@ authorization from the authors.
>      <list type="char" name="object_context">
>        <fieldref>object_context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>object_context</sizeof></pad>
>      <list type="char" name="data_context">
>        <fieldref>data_context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>data_context</sizeof></pad>
>    </struct>
>  
>    <request name="SetPropertyCreateContext" opcode="8">
> @@ -121,6 +130,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetPropertyCreateContext" opcode="9">
> @@ -131,6 +141,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -139,6 +150,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetPropertyUseContext" opcode="11">
> @@ -149,6 +161,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -162,6 +175,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -175,6 +189,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -195,6 +210,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetSelectionCreateContext" opcode="16">
> @@ -205,6 +221,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -213,6 +230,7 @@ authorization from the authors.
>      <list type="char" name="context">
>        <fieldref>context_len</fieldref>
>      </list>
> +    <pad align="4"><sizeof>context</sizeof></pad>
>    </request>
>  
>    <request name="GetSelectionUseContext" opcode="18">
> @@ -223,6 +241,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -235,6 +254,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -247,6 +267,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> @@ -270,6 +291,7 @@ authorization from the authors.
>        <list type="char" name="context">
>  	<fieldref>context_len</fieldref>
>        </list>
> +      <pad align="4"><sizeof>context</sizeof></pad>
>      </reply>
>    </request>
>  
> diff --git a/src/xv.xml b/src/xv.xml
> index d2bfc29..afcc49b 100644
> --- a/src/xv.xml
> +++ b/src/xv.xml
> @@ -101,10 +101,10 @@ authorization from the authors.
>          <list type="char" name="name">
>              <fieldref>name_size</fieldref>
>          </list>
> +	<pad align="4"><sizeof>name</sizeof></pad>
>          <list type="Format" name="formats">
>              <fieldref>num_formats</fieldref>
>          </list>
> -
>      </struct>
>  
>      <struct name="EncodingInfo">
> @@ -121,6 +121,7 @@ authorization from the authors.
>          <list type="char" name="name">
>              <fieldref>name_size</fieldref>
>          </list>
> +	<pad align="4"><sizeof>name</sizeof></pad>
>      </struct>
>  
>      <struct name="Image">
> @@ -373,6 +374,7 @@ authorization from the authors.
>              <list type="AttributeInfo" name="attributes">
>                  <fieldref>num_attributes</fieldref>
>              </list>
> +	    <pad align="4"><sizeof>attributes</sizeof></pad>
>          </reply>
>      </request>
>  
> @@ -425,6 +427,7 @@ authorization from the authors.
>          <field type="CARD16" name="width" />
>          <field type="CARD16" name="height" />
>  	<list type="CARD8" name="data" />
> +	<pad align="4"><sizeof>data</sizeof></pad>
>      </request>
>  
>      <request name="ShmPutImage" opcode="19">
> diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
> index 35fcb91..59cb501 100644
> --- a/xcbgen/xtypes.py
> +++ b/xcbgen/xtypes.py
> @@ -275,6 +275,10 @@ class ComplexType(Type):
>          # Resolve all of our field datatypes.
>          for child in list(self.elt):
>              if child.tag == 'pad':
> +                # This is stub. Don't process pads with 'align'
> +                # attribute for a while
> +                if child.get('align', False):
> +                    continue
>                  field_name = 'pad' + str(pads)
>                  fkey = 'CARD8'
>                  type = PadType(child)

> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20110314/788d3334/attachment-0001.pgp>


More information about the Xcb mailing list