Was |int| always thought to be 32bit ?

Roland Mainz roland.mainz at nrubsig.org
Mon Apr 25 19:48:24 PDT 2005


Egbert Eich wrote:
>  > 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.

AFAIK all C implementations take |short| as 16bit. Originally (before
64bit machines were "invented") |long| was 32bit and |int| was a
datatype which picked the "natural" representation of an integer for
this machine type (or better: the representation which was the fastest
or "best" for register/memory access) ...

> 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.

Was there ever filed a bug for that ?

> 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 :-(

It may be better to cleanup the code now...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)


More information about the xorg-arch mailing list