[Xcb] valueparam does not work in reply

Josh Triplett josh@freedesktop.org
Fri Jan 21 23:46:46 PST 2005


Jeremy Kolb wrote:
> Josh Triplett wrote:
>> Jeremy Kolb wrote:
>>> <valueparam> does not work in reply:
>>>
>>> <request name="GetFBConfigs" opcode="21">
>>>        <field type="CARD32" name="screen" />
>>>        <reply>
>>>            <pad bytes="1" />
>>>            <field type="CARD32" name="numFBConfigs" />
>>>            <field type="CARD32" name="numProperties" />
>>>            <pad bytes="16" />
>>>            <valueparam value-mask-type="CARD32"
>>>                value-mask-name="value_mask"
>>>                value-list-name="value_list" />
>>>        </reply>
>>>    </request>
>>>
>>> generates:
>>>
>>> XCBGLXGetFBConfigsCookie XCBGLXGetFBConfigs(XCBConnection *c, CARD32
>>> screen);
>>> CARD32 *XCBGLXGetFBConfigsValueList(XCBGLXGetFBConfigsRep *R);
>>> int XCBGLXGetFBConfigsValueListLength(XCBGLXGetFBConfigsRep *R);
>>> XCBGenericIter XCBGLXGetFBConfigsValueListEnd(XCBGLXGetFBConfigsRep *R);
>>> XCBGLXGetFBConfigsRep *XCBGLXGetFBConfigsReply(XCBConnection *c,
>>> XCBGLXGetFBConfigsCookie cookie, XCBGenericError **e);
>>>
>>> value_mask is undefined, c doesn't like that.
>>
>> Check the reply structure definition in the C header file; it should
>> have a "CARD32 value_mask".  The function definitions you quote are only
>> for retrieving variable-length data like the list, but the mask is a
>> normal field.
>
> The structure is as it should be in the header file:
>
> typedef struct {
>     BYTE response_type;
>     CARD8 pad0;
>     CARD16 sequence;
>     CARD32 length;
>     CARD32 numFBConfigs;
>     CARD32 numProperties;
>     CARD8 pad1[16];
>     CARD32 value_mask;
> } XCBGLXGetFBConfigsRep;
>
> However the functions are bad:
>
> CARD32 *XCBGLXGetFBConfigsValueList(XCBGLXGetFBConfigsRep *R)
> {
>     return (CARD32 *) (R + 1);
> }
>
> int XCBGLXGetFBConfigsValueListLength(XCBGLXGetFBConfigsRep *R)
> {
>     return XCBPopcount(value_mask);
> }
>
> XCBGenericIter XCBGLXGetFBConfigsValueListEnd(XCBGLXGetFBConfigsRep *R)
> {
>     XCBGenericIter i;
>     i.data = ((CARD32 *) (R + 1)) + (XCBPopcount(value_mask));
>     i.rem = 0;
>     i.index = (char *) i.data - (char *) R;
>     return i;
> }
>
> alue_mask is not defined. I added the glx.xml file and glx.h/c to my own
> copy of xcb and it failed to compile because value_mask was unfedined.

Ah, I see.  That should be outputting "R->value_mask", not just
"value_mask".  That's definitely a bug, and I'll look into it as soon as
I can.  Thanks for pointing it out.

- Josh Triplett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20050121/bdb56ffc/signature.pgp


More information about the xcb mailing list