[Xcb] [PATCH] sync: Change value list param of CreateAlarm and ChangeAlarm into switch

Peter Harris git at peter.is-a-geek.org
Thu Jun 27 11:41:04 PDT 2013


On Fri, Jun 21, 2013 at 9:13 AM, Louis-Francis Ratté-Boulianne wrote:
> Values for "Value" and "Delta" fields are 64-bit that couldn't be passed through a regular value list/mask.
>
> It does break the API, but CreateAlarm and ChangeAlarm are unusable without that change.

I'm a huge fan of replacing valueparam with switch. Thanks for the
patch. It needs a few tweaks to work with both LSB and MSB,
unfortunately:

> +      <bitcase>
> +        <enumref ref="CA">Value</enumref>
> +        <field type="INT64" name="value" />
> +      </bitcase>

It's actually
        <field type="INT32" name="value_high" />
        <field type="CARD32" name="value_low" />

(which is a royal pain, and gives you a middle-endian INT64 when the
wire is set to LSBFirst, but that's the way the server reads it off
the wire).

Same with CA Delta.

> +      <bitcase>
> +        <enumref ref="CA">Events</enumref>
> +        <field type="BOOL" name="events" />
> +        <pad bytes="3" />
> +      </bitcase>

The only valid values are xTrue and xFalse, but it's actually
        <field type="CARD32" name="events" />

(which matters when the wire is set to MSBFirst, or if some generator
does not zero-fill the padding)

>    <request name="ChangeAlarm" opcode="9">

See CreateAlarm.

Thanks,
 Peter Harris


More information about the Xcb mailing list