[PATCH 1/4] dix: warning fix

Adam Jackson ajax at redhat.com
Tue Mar 15 09:03:20 PDT 2011


On Tue, 2011-03-15 at 08:35 -0700, Keith Packard wrote:
> On Tue, 15 Mar 2011 11:05:04 -0400, Adam Jackson <ajax at redhat.com> wrote:
> 
> > -	ErrorF("[dix] AddResource(%lx, %lx, %lx), client=%d \n",
> > -		(unsigned long)id, type, (unsigned long)value, client);
> > +	ErrorF("[dix] AddResource(%x, %x, %lx), client=%d \n",
> > +	       id, type, (unsigned long)value, client);
> 
> <bikeshed>
> I hate printf. This does assume that XID is the same as 'unsigned int'
> on all machines. I think XID is still 'unsigned long' on 32-bit
> machines, right? We could use %lx and a cast to unsigned long
> everywhere...
> </bikeshed>

That printf lacks format specifiers for stdint.h is a pretty fantastic
bug, yeah.  Almost as fantastic as varying the typedef for XID across
platforms.

So, the XID typedef lives in Xdefs.h, which we can't really change
because it's also included client-side.  But Xdefs.h defines remarkably
little, and we don't actually include it from that many places in the
server.  I'll rework this so we no longer include it, so XID can be
sanely typed in the server (ie, uint32_t).  It'll be like the future.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110315/05024f60/attachment.pgp>


More information about the xorg-devel mailing list