Huw Davies : gdi32: Simplify the point type checking logic.

Alexandre Julliard julliard at winehq.org
Tue Nov 27 14:30:48 CST 2012


Module: wine
Branch: master
Commit: e6f1930116c9f0fa49d931120ea02e4828e1991a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e6f1930116c9f0fa49d931120ea02e4828e1991a

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Nov 27 09:15:53 2012 +0000

gdi32: Simplify the point type checking logic.

---

 dlls/gdi32/painting.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 74ca835..354bea9 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -152,12 +152,11 @@ BOOL nulldrv_PolyDraw( PHYSDEV dev, const POINT *points, const BYTE *types, DWOR
         case PT_LINETO:
             break;
         case PT_BEZIERTO:
-            if((i + 2 < count) && (types[i + 1] == PT_BEZIERTO) &&
-               ((types[i + 2] & ~PT_CLOSEFIGURE) == PT_BEZIERTO))
-            {
-                i += 2;
-                break;
-            }
+            if (i + 2 >= count) return FALSE;
+            if (types[i + 1] != PT_BEZIERTO) return FALSE;
+            if ((types[i + 2] & ~PT_CLOSEFIGURE) != PT_BEZIERTO) return FALSE;
+            i += 2;
+            break;
         default:
             return FALSE;
         }




More information about the wine-cvs mailing list