Was |int| always thought to be 32bit ?

Egbert Eich eich at freedesktop.org
Mon Apr 25 01:38:40 PDT 2005


Roland Mainz writes:
 > 
 > Hi!
 > 
 > ----
 > 
 > While looking at the X11 headers I see that some structure members and
 > function arguments and return values use |int| - was that datatype
 > thought to be always 32bit or is there any platform which used 16bit for
 > |int| to work with X11 code (client side+Xserver), too (parts of the
 > code use |short| to explicitly say "... it's 16bit..." but I cannot find
 > a clear statement was |int| should be...) ?
 > 

Appearantly at one time there used to be X implementations for DOS
where int was 16bit unless you used a DOS extender and ran in protected
mode. I'm not sure if any Xserver implementation was real mode, though.
The use of short as 'it's 16bit' is rather poor. Fixed sizes should
be taken form system headers where avaialble or defined in an X header.

A bigger problem however arises from the careless interchange of int 
and long in some parts of the code. 
It makes the VSW4 test suite fail in some tests (one even ends up in
an endless loop) on 64bit BE platforms.
Since the problem exists in the server drawable structure a fix would
either break the internal server ABI or would require to hand cast
assignments all over the code :-(

Egbert.


More information about the xorg-arch mailing list