[Xcb] [PATCH proto] xprint: Fix build of xprint extension

Peter Harris pharris at opentext.com
Tue May 19 08:13:35 PDT 2015


On 2015-05-19 10:04, Olivier Fourdan wrote:
> Generated XCB code based on xprint.xml won't compile because the
> arguments do not match now that the accessor functions for requests are
> generated in libxcb.
> 
> Fix the definition so that the arguments match and the generated C code
> for XPrint can compile.
> 
> Note, XPrint support has been removed in the X server since 2008, so
> this is mostly cosmetic or even pedantic because XPrint is long gone.
> 
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>

The fix is obviously correct, or at least obviously better, because a
<list> with an implicit length is only valid as the last member of a
request.

> ---
>  src/xprint.xml | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xprint.xml b/src/xprint.xml
> index dc23dd0..4da49b0 100644
> --- a/src/xprint.xml
> +++ b/src/xprint.xml
> @@ -178,9 +178,13 @@ authorization from the authors.
>              <fieldref>len_data</fieldref>
>          </list>
>          <!-- padding -->

Since you're fixing the protocol definition of this request, you could
also change the <!-- padding --> comment to <pad align="4" />. ("pad
align" is relatively recent, and I'm guessing whoever originally wrote
xprint.xml was too lazy to put in the annoyingly large <op> block
required to do an alignment pad without "pad align").

> -        <list type="STRING8" name="doc_format" />
> +        <list type="STRING8" name="doc_format">
> +            <fieldref>len_fmt</fieldref>
> +        </list>
>          <!-- padding -->

Here too.

> -        <list type="STRING8" name="options" />
> +        <list type="STRING8" name="options">
> +            <fieldref>len_options</fieldref>
> +        </list>
>      </request>

That said, this looks good. With or without the <pad align="4" /> changes,
Reviewed-by: Peter Harris <pharris at opentext.com>

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