[Xcb] sizeof paramters for length less lists
Peter Harris
pharris at opentext.com
Thu Feb 26 08:45:13 PST 2015
On 2015-02-26 01:58, chris at demorecorder.com wrote:
> P.S.: @all: Here's some context, so people on this list can understand what's this about:
>
> In current XCB, the length of the rectangles list of request SetPictureClipRectangles
> is not specified in render.xml:
> <request name="SetPictureClipRectangles" opcode="6">
> <field type="PICTURE" name="picture" />
> <field type="INT16" name="clip_x_origin" />
> <field type="INT16" name="clip_y_origin" />
> <list type="RECTANGLE" name="rectangles" />
> </request>
>
> This needs to be fixed for some applications, including server-side XCB.
> So, the xml will be changed as follows, by using the length-field of the
> request to compute the length of the rectangles-list:
>
> <request name="SetPictureClipRectangles" opcode="6">
> <field type="PICTURE" name="picture" />
> <field type="INT16" name="clip_x_origin" />
> <field type="INT16" name="clip_y_origin" />
> <list type="RECTANGLE" name="rectangles" >
> <op op="/">
> <op op="-">
> <fieldref>length</fieldref>
> <value>3</value>
> </op>
> <value>2</value>
> </op>
> </list>
> </request>
I'm confused. Earlier you said "so, don't use "(length - 3)/2" inside,
but use rectangles_len", and then you went to a lot of manual effort to
define rectangles_len as "(length - 3)/2".
Given that rectangles_len is already implied by a list with no length,
and given that creating all the <op>s by hand is error prone, I'd rather
leave the XML as-is.
If the generator needs this <op> block for something, shouldn't it be
calculated from the rest of the request and inserted by an earlier pass
in the generator? Or did I miss something?
Peter Harris
--
Open Text Connectivity Solutions Group
Peter Harris http://connectivity.opentext.com/
Research and Development Phone: +1 905 762 6001
pharris at opentext.com Toll Free: 1 877 359 4866
More information about the Xcb
mailing list