From 23fde785eeeb5b5e0451f810d260909e742462eb Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Fri, 28 Dec 2012 22:05:31 +0000 Subject: [PATCH] comctl32: Avoid signed-unsigned integer comparisons. --- dlls/comctl32/imagelist.c | 2 +- dlls/comctl32/monthcal.c | 6 ++++-- dlls/comctl32/rebar.c | 2 +- dlls/comctl32/status.c | 10 ++++++---- dlls/comctl32/updown.c | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 6142ba7c016..3eb772454e0 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -2235,7 +2235,7 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) void *image_bits, *mask_bits = NULL; ILHEAD ilHead; HIMAGELIST himl; - int i; + unsigned int i; TRACE("%p\n", pstm); diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index f27eee3de3e..ef2ad68b38c 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -1076,7 +1076,8 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, /* months before first calendar month and after last calendar month */ static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps) { - INT mask, length, index; + INT mask, index; + UINT length; SYSTEMTIME st_max, st; if (infoPtr->dwStyle & MCS_NOTRAILINGDATES) return; @@ -1116,7 +1117,8 @@ static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc, static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month; - INT i, j, length; + INT i, j; + UINT length; RECT r, fill_bk_rect; SYSTEMTIME st; WCHAR buf[80]; diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 0ae69ef126b..4e26c331cae 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -1124,7 +1124,7 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus) * or infoPtr->uNumBands if none */ static int next_visible(const REBAR_INFO *infoPtr, int i) { - int n; + unsigned int n; for (n = i + 1; n < infoPtr->uNumBands; n++) if (!HIDDENBAND(REBAR_GetBand(infoPtr, n))) break; diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 19d671d8324..c4efedb1e3c 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -285,7 +285,6 @@ STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPA static LRESULT STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc) { - int i; RECT rect; HBRUSH hbrBk; HFONT hOldFont; @@ -319,6 +318,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc) if (infoPtr->simple) { STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0); } else { + unsigned int i; + for (i = 0; i < infoPtr->numParts; i++) { STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i); } @@ -336,7 +337,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc) static int STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt) { - int i; + unsigned int i; + if (infoPtr->simple) return 255; @@ -352,7 +354,7 @@ STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr) { STATUSWINDOWPART *part; RECT rect, *r; - int i; + UINT i; /* get our window size */ GetClientRect (infoPtr->Self, &rect); @@ -883,7 +885,7 @@ STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple) static LRESULT STATUSBAR_WMDestroy (STATUS_INFO *infoPtr) { - int i; + unsigned int i; TRACE("\n"); for (i = 0; i < infoPtr->numParts; i++) { diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 2c5fc60bbca..390f829f8ba 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -1026,10 +1026,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L if (TRACE_ON(updown)) { - INT i; + UINT i; for (i = 0; i < wParam; i++) - TRACE("%d: nSec %u nInc %u\n", i, + TRACE("%u: nSec %u nInc %u\n", i, infoPtr->AccelVect[i].nSec, infoPtr->AccelVect[i].nInc); }