[Xcb] [xsync] attributes of XCBSyncCreateAlarm

Ian Osgood iano at quirkster.com
Mon Jul 24 07:46:10 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jul 22, 2006, at 1:48 PM, Jamey Sharp wrote:

> On Wed, Jul 19, 2006 at 06:26:17PM -0700, Ian Osgood wrote:
>> Also, I notice that some of the field types of the structs refer to
>> the enumeration names instead of CARD8/16/32. What size do these end
>> up in the structure definitions? C enums don't actually specify a
>> physical size, so these might be incorrect compared to the wire
>> protocol (xextproto/syncstr.h).
>
> I don't remember whether the C standard specifies this behavior, but I
> believe GCC will treat any enum type as the size of an int. For most
> cases in the X protocol, that would be wrong. We've needed an
> improvement to the protocol descriptions for a long time that would  
> let
> us specify an enum typed field of a particular size.
>
> --Jamey

It is not standard, other compilers will try to compress the enum to  
the smallest size by default. This bit us at work when we changed  
over from CodeWarrior to XCode (gcc).  There are flags and pragmas to  
control this.

Also, fields are sometimes better described by a type union (an enum  
or a WINDOW, for instance).

Ian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFExN04HDwFgzc3zyIRAlzXAJ4+ni1E9b6RMDMbhj7tqWHbhw485wCg031+
22Stsg1FMnogae1Kdw20Eqs=
=vWQA
-----END PGP SIGNATURE-----


More information about the Xcb mailing list