[cairo] [PATCH 2/8] Don't cast pointers to integers

Pavel Roskin proski at gnu.org
Sun Aug 13 01:17:37 PDT 2006


On Sun, 2006-08-13 at 08:52 +0200, Sven Herzberg wrote:
> On So, 2006-08-13 at 01:57 -0400, Pavel Roskin wrote:
> > diff --git a/pixman/src/fbmmx.c b/pixman/src/fbmmx.c
> > index bc746cf..4d603bf 100644
> > --- a/pixman/src/fbmmx.c
> > +++ b/pixman/src/fbmmx.c
> > @@ -2401,7 +2401,7 @@ fbCopyAreammx (FbPixels	*pSrc,
> >  	    d += 2;
> >  	}
> >  
> > -	while (w >= 4 && ((unsigned int)d & 7))
> > +	while (w >= 4 && ((unsigned long)d & 7))
> >  	{
> >  	    *(CARD32 *)d = *(CARD32 *)s;
> 
> Shouldn't that be uintptr_t?

Yes, if we want to support Win64.  But there are other similar cases
where unsigned long is used.  They all need to be fixed at once.  It
would be wrong for me to use uintptr_t in one place and leave others
unfixed.

I don't have Win64 or any compiler targeting it, so I cannot find all
Win64 issues of this kind.

The point of this fix is to prevent compiler warnings.  There should no
actual breakage.  So the urgency of using uintptr_t is low - it's not
something that can break things without being noticed.  It's more likely
to be noticed without breaking things :)

-- 
Regards,
Pavel Roskin




More information about the cairo mailing list