user32: Sign-compare warnings fix (Try 2)
Andrew Talbot
andrew.talbot at talbotville.com
Sat Dec 13 07:21:50 CST 2008
Changelog:
user32: Sign-compare warnings fix (Try 2).
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index 9dd9083..4ea1959 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -84,9 +84,9 @@ typedef struct
/* Radio button group */
typedef struct
{
- UINT firstID;
- UINT lastID;
- UINT checkID;
+ INT firstID;
+ INT lastID;
+ INT checkID;
} RADIOGROUP;
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index ed93eff..4a3a6d2 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1111,7 +1111,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop )
{
MENUITEM *lpitem;
HDC hdc;
- int start, i;
+ UINT start, i;
int orgX, orgY, maxX, maxTab, maxTabWidth, maxHeight;
lppop->Width = lppop->Height = 0;
@@ -1199,7 +1199,8 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
LPPOPUPMENU lppop, HWND hwndOwner )
{
MENUITEM *lpitem;
- int start, i, orgX, orgY, maxY, helpPos;
+ UINT start, i, helpPos;
+ int orgX, orgY, maxY;
if ((lprect == NULL) || (lppop == NULL)) return;
if (lppop->nItems == 0) return;
@@ -1208,7 +1209,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
lppop->Height = 0;
maxY = lprect->top+1;
start = 0;
- helpPos = -1;
+ helpPos = ~0U;
lppop->maxBmpSize.cx = 0;
lppop->maxBmpSize.cy = 0;
while (start < lppop->nItems)
@@ -1220,7 +1221,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
/* Parse items until line break or end of menu */
for (i = start; i < lppop->nItems; i++, lpitem++)
{
- if ((helpPos == -1) && (lpitem->fType & MF_RIGHTJUSTIFY)) helpPos = i;
+ if ((helpPos == ~0U) && (lpitem->fType & MF_RIGHTJUSTIFY)) helpPos = i;
if ((i != start) &&
(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
@@ -1250,7 +1251,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect,
orgY = lpitem->rect.top;
orgX = lprect->right;
for (i = lppop->nItems - 1; i >= helpPos; i--, lpitem--) {
- if ( (helpPos==-1) || (helpPos>i) )
+ if ( (helpPos == ~0U) || (helpPos > i) )
break; /* done */
if (lpitem->rect.top != orgY) break; /* Other line */
if (lpitem->rect.right >= orgX) break; /* Too far right already */
@@ -2671,7 +2672,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk, UINT wFlags )
icons such as MDI maximize, restore or close) */
else if ((vk == VK_RIGHT) && !IS_SYSTEM_MENU(menu))
{
- int i = menu->FocusedItem + 1;
+ UINT i = menu->FocusedItem + 1;
while (i < menu->nItems) {
if ((menu->items[i].wID >= SC_SIZE &&
menu->items[i].wID <= SC_RESTORE)) {
diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c
index 2aed057..59fa410 100644
--- a/dlls/user32/spy.c
+++ b/dlls/user32/spy.c
@@ -2653,7 +2653,8 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn,
*/
int SPY_Init(void)
{
- int i, j;
+ int i;
+ UINT j;
char buffer[1024];
const SPY_NOTIFY *p;
const USER_MSG *q;
@@ -2700,7 +2701,7 @@ int SPY_Init(void)
p = &spnfy_array[0];
j = 0xffffffff;
while (p->name) {
- if ((UINT)p->value > (UINT)j) {
+ if (p->value > j) {
ERR("Notify message array out of order\n");
ERR(" between values [%08x] %s and [%08x] %s\n",
j, (p-1)->name, p->value, p->name);
More information about the wine-patches
mailing list