[Xcb] [PATCH] Remove fieldref from sole list in GetIndicatorMap reply

Daniel Martin consume.noise at gmail.com
Tue Feb 19 10:59:48 PST 2013


On Tue, Feb 19, 2013 at 11:55:23AM -0500, Peter Harris wrote:
> The X.org server never sets nIndicators, and Xlib never reads it. Use the
> reply length to calculate the size of the list instead.
> 
> Signed-off-by: Peter Harris <pharris at opentext.com>
> ---
>  src/xkb.xml |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/src/xkb.xml b/src/xkb.xml
> index c260720..9895fef 100644
> --- a/src/xkb.xml
> +++ b/src/xkb.xml
> @@ -1515,9 +1515,7 @@ authorization from the authors.
>  			<field name="realIndicators" type="CARD32" />
>  			<field name="nIndicators" type="CARD8" />
>  			<pad bytes="15" />
> -			<list name="maps" type="IndicatorMap">
> -				<fieldref>nIndicators</fieldref>
> -			</list>
> +			<list name="maps" type="IndicatorMap" />

It doesn't work with libxcb and fails to build. It searches
automagically for a field 'maps_len' if no fieldref/op is given.

And the server doesn't set the 'length' field 1:1 to the length of the
list. It's:

    rep->length = (nIndicators * SIZEOF(xkbIndicatorMapWireDesc)) / 4;
    at http://cgit.freedesktop.org/xorg/xserver/tree/xkb/xkb.c#n3075

I think the patch should be:

    <list name="maps" type="IndicatorMap">
        <op op="/">
            <op op="*">
                <fieldref>length</fieldref>
                <value>4</value>
            </op>
            <value>12</value> <!-- SIZEOF(xkbIndicatorMapWireDesc) -->
        </op>
    </list>

>  		</reply>
>  	</request>
>  
> -- 
> 1.7.5.4
> 
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb

Cheers,
    Daniel

PS: Looks like we should introduce a <sizeof> tag.


More information about the Xcb mailing list