[Xcb] [PATCH proto xkb] Fixes for xkb.xml

Ran Benita ran234 at gmail.com
Fri Feb 21 12:12:29 PST 2014


> From 5b57472da786b2aba37807b4888044e686c1a956 Mon Sep 17 00:00:00 2001
> From: Christian Linhart <chris at DemoRecorder.com>
> Date: Fri, 14 Feb 2014 15:55:39 +0100
> Subject: [PATCH 1/5] xkb: pad removed in GetKbdByName
> 
> The 1-byte pad after "load" is not in the spec and therefore harmful.
> (No implicit pad is needed here either because the field after it
> is a 1-byte value anyways.)
> ---
>  src/xkb.xml |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/src/xkb.xml b/src/xkb.xml
> index 9ef4402..ebfa5bf 100644
> --- a/src/xkb.xml
> +++ b/src/xkb.xml
> @@ -1992,7 +1992,6 @@ authorization from the authors.

[Small note: Daniel Martin added a nice snippet to make the patches
mention which request is changed. See the HACKING file:
http://cgit.freedesktop.org/xcb/proto/plain/HACKING
]

>  		<field name="need" type="CARD16" mask="GBNDetail" />
>  		<field name="want" type="CARD16" mask="GBNDetail" />
>  		<field name="load" type="BOOL" />
> -		<pad bytes="1" />

But it is in the spec, here:

    1     CARD8          opcode
    1     23          xkb-opcode
    2     3+(6+m+k+t+c+s+g+p)/4          request-length
    2     KB_DEVICESPEC           deviceSpec
    2     SETofKB_GBNDETAILMASK          need
    2     SETofKB_GBNDETAILMASK          want
    1     BOOL          load
    1               unused

Also in X11/extensions/XKBproto.h:

    typedef struct _xkbGetKbdByName {
        CARD8       reqType;
        CARD8       xkbReqType;     /* always X_KBGetKbdByName */
        CARD16      length B16;
        CARD16      deviceSpec B16;
        CARD16      need B16;       /* combination of XkbGBN_* */
        CARD16      want B16;       /* combination of XkbGBN_* */
        BOOL        load;
        CARD8       pad;
    } xkbGetKbdByNameReq;
    #define sz_xkbGetKbdByNameReq   12

It makes sense in order to make the following lists word-aligned.

>  		<!-- XXX: Intermixed fixed size fields and lists are broken
>  		<field name="keymapsSpecLen" type="CARD8" />
>  		<list name="keymapsSpec" type="STRING8">
> -- 
> 1.7.2.5
> 


More information about the Xcb mailing list