comctl32: Avoid signed-unsigned integer comparisons
Andrew Talbot
andrew.talbot at talbotville.com
Fri Dec 28 16:05:31 CST 2012
Changelog:
comctl32: Avoid signed-unsigned integer comparisons.
diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 6142ba7..8043930 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -2273,6 +2273,7 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
DWORD *ptr = image_bits;
BYTE *mask_ptr = mask_bits;
int stride = himl->cy * image_info->bmiHeader.biWidth;
+ unsigned int i2;
if (image_info->bmiHeader.biHeight > 0) /* bottom-up */
{
@@ -2283,9 +2284,9 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
}
else image_info->bmiHeader.biHeight = -himl->cy;
- for (i = 0; i < ilHead.cCurImage; i += TILE_COUNT)
+ for (i2 = 0; i2 < ilHead.cCurImage; i2 += TILE_COUNT)
{
- add_dib_bits( himl, i, min( ilHead.cCurImage - i, TILE_COUNT ),
+ add_dib_bits( himl, i2, min( ilHead.cCurImage - i2, TILE_COUNT ),
himl->cx, himl->cy, image_info, mask_info, ptr, mask_ptr );
ptr += stride;
mask_ptr += stride / 8;
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index f27eee3..ef2ad68 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 0ae69ef..4e26c33 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 19d671d..5141514 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);
@@ -663,6 +665,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
{
STATUSWINDOWPART *tmp;
INT i, oldNumParts;
+ UINT i2;
TRACE("(%d,%p)\n", count, parts);
@@ -692,8 +695,8 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
return TRUE;
}
- for (i = 0; i < infoPtr->numParts; i++)
- infoPtr->parts[i].x = parts[i];
+ for (i2 = 0; i2 < infoPtr->numParts; i2++)
+ infoPtr->parts[i2].x = parts[i2];
if (infoPtr->hwndToolTip) {
INT nTipCount;
@@ -883,7 +886,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 2c5fc60..390f829 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);
}
More information about the wine-patches
mailing list