Was |int| always thought to be 32bit ?

Mike A. Harris mharris at www.linux.org.uk
Mon Apr 25 06:43:16 PDT 2005


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

Since we're using dlloader in X11R7, and X11R7 is a major release of
the X Window System, it would seem that now is the time to make as
many major changes as possible, in particular those that change the
ABI.  Existing XFree86 4.x server modules and xorg 6.[78] modules
are not likely going to work in X11R7 anyway.  By overcoming as many
limitations as possible in X11R7, we can capitalize on the opportunity
to do more things "right", and perhaps remove a bunch of cruft from
the code.  If not, we can at least fix major bugs that require ABI
changes.

MAXSCREENS is perhaps another one that could be fixed if it hasn't
been checked into CVS already.

Thoughts?


More information about the xorg-arch mailing list