Andrew Talbot : gdiplus: Avoid signed-unsigned integer comparisons.

Alexandre Julliard julliard at winehq.org
Thu Jan 24 12:59:49 CST 2013


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Wed Jan 23 21:42:47 2013 +0000

gdiplus: Avoid signed-unsigned integer comparisons.

---

 dlls/gdiplus/graphics.c |    6 ++++--
 dlls/gdiplus/image.c    |    5 +++--
 dlls/gdiplus/region.c   |    6 +++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index e287683..659c46b 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -429,7 +429,8 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst
 
     if (graphics->image && graphics->image->type == ImageTypeBitmap)
     {
-        int i, size;
+        DWORD i;
+        int size;
         RGNDATA *rgndata;
         RECT *rects;
         HRGN hrgn, visible_rgn;
@@ -642,7 +643,8 @@ static int color_is_gray(ARGB color)
 static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data,
     UINT width, UINT height, INT stride, ColorAdjustType type)
 {
-    UINT x, y, i;
+    UINT x, y;
+    INT i;
 
     if (attributes->colorkeys[type].enabled ||
         attributes->colorkeys[ColorAdjustTypeDefault].enabled)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index bb555a8..6aa8d32 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -370,7 +370,7 @@ static inline UINT get_palette_index(BYTE r, BYTE g, BYTE b, BYTE a, ColorPalett
     BYTE index = 0;
     int best_distance = 0x7fff;
     int distance;
-    int i;
+    UINT i;
 
     if (!palette) return 0;
     /* This algorithm scans entire palette,
@@ -3793,7 +3793,8 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res
     LARGE_INTEGER seek;
     HRESULT hr;
     UINT bytesread;
-    int i, j, sig;
+    int i;
+    DWORD j, sig;
 
     /* seek to the start of the stream */
     seek.QuadPart = 0;
diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index f62b599..f7bad57 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -588,7 +588,7 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
     GpStatus stat;
     GpPath* path;
     GpRegion* local;
-    int i;
+    DWORD i;
 
     TRACE("(%p, %p)\n", hrgn, region);
 
@@ -1467,7 +1467,7 @@ GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMat
 GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *count, GpMatrix *matrix)
 {
     GpStatus stat;
-    INT i;
+    DWORD i;
     LPRGNDATA data;
     RECT *rects;
 
@@ -1501,7 +1501,7 @@ GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *co
 GpStatus WINGDIPAPI GdipGetRegionScans(GpRegion *region, GpRectF *scans, INT *count, GpMatrix *matrix)
 {
     GpStatus stat;
-    INT i;
+    DWORD i;
     LPRGNDATA data;
     RECT *rects;
 




More information about the wine-cvs mailing list