From f98f70fb418dff1cd0c906ed9bcd2232fba47a8d Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Sat, 19 Jan 2013 23:12:49 +0000 Subject: [PATCH] gdi32: Avoid signed-unsigned integer comparisons. --- dlls/gdi32/bidi.c | 5 +++-- dlls/gdi32/dib.c | 2 +- dlls/gdi32/font.c | 7 ++++--- dlls/gdi32/freetype.c | 2 +- dlls/gdi32/painting.c | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/bidi.c b/dlls/gdi32/bidi.c index 00dce45413f..1d6be5360ef 100644 --- a/dlls/gdi32/bidi.c +++ b/dlls/gdi32/bidi.c @@ -358,7 +358,8 @@ BOOL BIDI_Reorder( { WORD *chartype; BYTE *levels; - unsigned i, done, glyph_i; + INT i, done; + unsigned glyph_i; BOOL is_complex; int maxItems; @@ -501,7 +502,7 @@ BOOL BIDI_Reorder( glyph_i = 0; while (done < uCount) { - unsigned j; + INT j; classify(lpString + done, chartype, uCount - done); /* limit text to first block */ i = resolveParagraphs(chartype, uCount - done); diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index e5361c12a13..ad2a4dc6b23 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -305,7 +305,7 @@ static void *get_pixel_ptr( const BITMAPINFO *info, void *bits, int x, int y ) static BOOL build_rle_bitmap( const BITMAPINFO *info, struct gdi_image_bits *bits, HRGN *clip ) { - int i = 0; + DWORD i = 0; int left, right; int x, y, width = info->bmiHeader.biWidth, height = info->bmiHeader.biHeight; HRGN run = NULL; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index fdd16e35273..68559f11d3f 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1734,7 +1734,7 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT flags, UINT aa_flags, { static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; UINT indices[3] = {0, 0, 0x20}; - int i; + unsigned int i; DWORD ret, size; int stride; @@ -1775,7 +1775,7 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT flags, UINT aa_flags, static RECT get_total_extents( HDC hdc, INT x, INT y, UINT flags, UINT aa_flags, LPCWSTR str, UINT count, const INT *dx ) { - int i; + UINT i; RECT rect, bounds; reset_bounds( &bounds ); @@ -1814,7 +1814,8 @@ static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS const struct gdi_image_bits *image, const RECT *clip ) { static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; - UINT x, y, i, count, max_count; + UINT i, count, max_count; + LONG x, y; BYTE *ptr = image->ptr; int stride = get_dib_stride( metrics->gmBlackBoxX, 1 ); POINT *pts; diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 639fb638f67..40cf0801ec8 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -5316,7 +5316,7 @@ static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_cha ENUMLOGFONTEXW elf; NEWTEXTMETRICEXW ntm; DWORD type = 0; - int i; + DWORD i; GetEnumStructs(face, face->family->FamilyName, &elf, &ntm, &type); for(i = 0; i < list->total; i++) { diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 354bea93567..f97800137a1 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -140,7 +140,8 @@ BOOL nulldrv_PolyBezierTo( PHYSDEV dev, const POINT *points, DWORD count ) BOOL nulldrv_PolyDraw( PHYSDEV dev, const POINT *points, const BYTE *types, DWORD count ) { POINT *line_pts = NULL, *bzr_pts = NULL, bzr[4]; - INT i, num_pts, num_bzr_pts, space, size; + DWORD i; + INT num_pts, num_bzr_pts, space, size; /* check for valid point types */ for (i = 0; i < count; i++)