> From: Adam Jackson <[email protected]>
> Date: Mon, 10 Mar 2014 11:04:32 -0400
> 
> My goodness the 24bpp code is ugly.  This failed to build:
> 
> fbbltone.c:432:6: warning: left shift count >= width of type [enabled by
> default]
>       C4_24(0, 0), C4_24(1, 0), C4_24(2, 0), C4_24(3, 0),
>       ^
> fbbltone.c:432:6: error: initializer element is not constant
> fbbltone.c:432:6: error: (near initialization for 'fbStipple24Bits[0][0]')
> 
> The warning causes the error here, because gcc will rightly refuse to
> constprop invalid expressions.  0xffffffU is only uint32_t; when
> FB_SHIFT == 6 FbBits is wider than that, so let's always cast up to
> FbBits.
> 
> Signed-off-by: Adam Jackson <[email protected]>

Reviewed-by: Mark Kettenis <[email protected]>

Although I wouldn't complain if you sneaked in a change that removed
the extra space after Mask24Neg

> ---
>  fb/fbbltone.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fb/fbbltone.c b/fb/fbbltone.c
> index 434d447..ca94384 100644
> --- a/fb/fbbltone.c
> +++ b/fb/fbbltone.c
> @@ -407,8 +407,8 @@ fbBltOne(FbStip * src, FbStride srcStride,      /* FbStip 
> units per scanline */
>  
>  #define Mask24(x,r) (Mask24Pos(x,r) < FB_UNIT ? \
>                    (Mask24Pos(x,r) < 0 ? \
> -                   0xffffffU >> Mask24Neg (x,r) : \
> -                   0xffffffU << Mask24Check(x,r)) : 0)
> +                   ((FbBits)0xffffffU) >> Mask24Neg (x,r) : \
> +                   ((FbBits)0xffffffU) << Mask24Check(x,r)) : 0)
>  
>  #define SelMask24(b,n,r)     ((((b) >> n) & 1) * Mask24(n,r))
>  
> -- 
> 1.8.5.3
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to