[PATCH 01/36] xf86: cursor code got mangled by indenting

walter harms wharms at bfs.de
Mon Jul 2 05:12:45 PDT 2012


i would suggest to split even further to improve readability.
would you bother to place that #ifdef ARGB_CURSOR stuff into a separate if() ?

re,
 wh
	

Am 02.07.2012 12:12, schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> This fixes some really ugly code that got mangled by the indenting.
> 
> Reviewed-by: Keith Packard <keithp at keithp.com>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  hw/xfree86/ramdac/xf86Cursor.c |   31 +++++++++++--------------------
>  1 file changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
> index 15e2ada..8b91e05 100644
> --- a/hw/xfree86/ramdac/xf86Cursor.c
> +++ b/hw/xfree86/ramdac/xf86Cursor.c
> @@ -336,28 +336,19 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
>          if (!infoPtr->pScrn->vtSema)
>              ScreenPriv->SavedCursor = pCurs;
>  
> -        if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || ((
> +        if (infoPtr->pScrn->vtSema &&
> +            (ScreenPriv->ForceHWCursorCount ||
> +             ((
>  #ifdef ARGB_CURSOR
> -                                                                              pCurs->
> -                                                                              bits->
> -                                                                              argb
> -                                                                              &&
> -                                                                              infoPtr->
> -                                                                              UseHWCursorARGB
> -                                                                              &&
> -                                                                              (*infoPtr->
> -                                                                               UseHWCursorARGB)
> -                                                                              (pScreen,
> -                                                                               pCurs))
> -                                                                          ||
> -                                                                          (pCurs->
> -                                                                           bits->
> -                                                                           argb
> -                                                                           == 0
> -                                                                           &&
> +               pCurs->bits->argb &&
> +               infoPtr->UseHWCursorARGB &&
> +               (*infoPtr->UseHWCursorARGB)(pScreen, pCurs)) ||
> +              (pCurs->bits->argb == 0 &&
>  #endif
> -                                                                           (pCurs->bits->height <= infoPtr->MaxHeight) && (pCurs->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) {
> -
> +               (pCurs->bits->height <= infoPtr->MaxHeight) &&
> +               (pCurs->bits->width <= infoPtr->MaxWidth) &&
> +               (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) {
> +            
>              if (ScreenPriv->SWCursor)   /* remove the SW cursor */
>                  (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,
>                                                         NullCursor, x, y);


More information about the xorg-devel mailing list