[PATCH] fbbltone.c: Mark bitmasks as unsigned ints

Jamey Sharp jamey at minilop.net
Mon May 23 10:12:00 PDT 2011


Reviewed-by: Jamey Sharp <jamey at minilop.net>

Code clarity notwithstanding. :-)

Jamey

On Sun, May 22, 2011 at 01:50:14PM -0700, Alan Coopersmith wrote:
> Clears many Sun compiler warnings:
> "fbbltone.c", line 491: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 491: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 491: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 491: warning: initializer will be sign-extended: -16777216
> "fbbltone.c", line 491: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 491: warning: initializer will be sign-extended: -1
> "fbbltone.c", line 495: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 495: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 495: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 495: warning: initializer will be sign-extended: -256
> "fbbltone.c", line 495: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 495: warning: initializer will be sign-extended: -1
> "fbbltone.c", line 499: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 499: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 499: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 499: warning: initializer will be sign-extended: -65536
> "fbbltone.c", line 499: warning: integer overflow detected: op "<<"
> "fbbltone.c", line 499: warning: initializer will be sign-extended: -1
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  fb/fbbltone.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fb/fbbltone.c b/fb/fbbltone.c
> index 0a91575..67e7853 100644
> --- a/fb/fbbltone.c
> +++ b/fb/fbbltone.c
> @@ -428,8 +428,8 @@ fbBltOne (FbStip    *src,
>  
>  #define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \
>  		     (Mask24Pos(x,r) < 0 ? \
> -		      0xffffff >> Mask24Neg (x,r) : \
> -		      0xffffff << Mask24Check(x,r)) : 0)
> +		      0xffffffU >> Mask24Neg (x,r) : \
> +		      0xffffffU << Mask24Check(x,r)) : 0)
>  
>  #define SelMask24(b,n,r)	((((b) >> n) & 1) * Mask24(n,r))
>  
> -- 
> 1.7.3.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110523/1f84fe27/attachment-0001.pgp>


More information about the xorg-devel mailing list