[Xcb] [PATCH] sync: add missing state in AlarmNotify event

Peter Harris peter.harris at hummingbird.com
Thu Sep 4 09:16:35 PDT 2008

Julien Danjou wrote:
> At 1220541674 time_t, Peter Harris wrote:
>> Should probably be CARD8 for now (possibly with a comment indicating it
>> is an ALARMSTATE).
> Well, I don't know: it's a typedef-ed enum so I guess it's a integer.
> And AFAICT, Xlib does the same (typedef and use it as is).
> (and I think Xlib implemented the proto correctly, but I might be
> wrong).

In XCB, enums are just lists of numbers. You need to create an actual
<typedef> if you want to use it as such.

The protocol does specify a single byte (CARD8) in that position.

The default type for a C enum is unspecified, so Xlib and the Xserver
are both wrong (the compiler is free to make XSyncAlarmState any size).

If you're really feeling ambitious, you could submit a patch for Xlib
and Xserver. I'm guessing nobody noticed because they mostly use
LSBFirst machines and/or compilers that happen to choose the smallest
type that will fit all the enum's constants and/or never display
remotely (use the same compiler for both Xlib and Xserver).

Peter Harris
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866

More information about the Xcb mailing list