[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xcb
Subject:    Re: [Xcb] XSync extension broken in many ways..
From:       Rob Taylor <rob.taylor () codethink ! co ! uk>
Date:       2007-09-03 16:05:23
Message-ID: 46DC30C3.7010801 () codethink ! co ! uk
[Download RAW message or body]

Barton C Massey wrote:
> In message <200709031335.11266.hto@arcor.de> you wrote:
>> I am still fighting with XKB. When that is done I'd like include my 
>> new python generator into XCB (as an option in ./configure) [1].
> 
> I think the plan is rather to throw the XSLT one away at
> that point...
> 
>> The new generator counts the expected size of structs and could 
>> generate the alternative sizeof using a #define.
> 
> Very nice.
> 
>> But why not use the defines unconditionally? The generator could emit:
>>
>>     #define SZ_SOMESTRUCT size
>>
>> and use that everywhere instead of
>>
>>     sizeof(somestruct)
> 
> That sounds sensible.
> 
> My only concern with that plan is that miscounts due to
> wacky C compilers are going to be hard to detect.  Perhaps
> part of "make check" should be a little test program that
> compares the each of defines with its sizeof?
>

The point is that the size of the struct on the wire *doesn't* match up
with the compilers sizeof already. You'd use SZ_SOMESTRUCT wherever
you're talking about the size on the wire.

Thanks
Rob
_______________________________________________
Xcb mailing list
Xcb@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xcb

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic