Fix signed/unsigned comparison warnings.
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 404d5a8..004ba50 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -663,7 +663,7 @@
DWORD WINAPI RegQueryMultipleValuesA(HKEY hkey, PVALENTA val_list, DWORD num_vals,
LPSTR lpValueBuf, LPDWORD ldwTotsize)
{
- int i;
+ unsigned int i;
DWORD maxBytes = *ldwTotsize;
HRESULT status;
LPSTR bufptr = lpValueBuf;
@@ -709,7 +709,7 @@
DWORD WINAPI RegQueryMultipleValuesW(HKEY hkey, PVALENTW val_list, DWORD num_vals,
LPWSTR lpValueBuf, LPDWORD ldwTotsize)
{
- int i;
+ unsigned int i;
DWORD maxBytes = *ldwTotsize;
HRESULT status;
LPSTR bufptr = (LPSTR)lpValueBuf;
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index aec42ed..2498563 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -192,7 +192,7 @@
DWORD dwNumServiceArgs ;
LPWSTR *lpArgVecW;
LPSTR *lpArgVecA;
- int i;
+ unsigned int i;
TRACE("(%p)\n", servent);
wait = CreateSemaphoreW(NULL,1,1,_ServiceStartDataW);
@@ -808,7 +808,7 @@
{
LPWSTR *lpwstr=NULL;
UNICODE_STRING usBuffer;
- int i;
+ unsigned int i;
TRACE("(%p,%ld,%p)\n",hService,dwNumServiceArgs,lpServiceArgVectors);
diff --git a/dlls/avifil32/acmstream.c b/dlls/avifil32/acmstream.c
index a3146dc..13d7975 100644
--- a/dlls/avifil32/acmstream.c
+++ b/dlls/avifil32/acmstream.c
@@ -526,7 +526,7 @@
ICOM_THIS(IAVIStreamImpl,iface);
HRESULT hr;
- LONG size;
+ ULONG size;
TRACE("(%p,%ld,%ld,%p,%ld,0x%08lX,%p,%p)\n", iface, start, samples,
buffer, buffersize, flags, sampwritten, byteswritten);
diff --git a/dlls/avifil32/api.c b/dlls/avifil32/api.c
index 2323ace..8346cad 100644
--- a/dlls/avifil32/api.c
+++ b/dlls/avifil32/api.c
@@ -957,7 +957,7 @@
LONG WINAPI AVIStreamTimeToSample(PAVISTREAM pstream, LONG lTime)
{
AVISTREAMINFOW asiw;
- LONG sample;
+ ULONG sample;
TRACE("(%p,%ld)\n", pstream, lTime);
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index 6f5685f..6308828 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -986,13 +986,13 @@
LPBITMAPINFOHEADER lpbiOld = (LPBITMAPINFOHEADER)This->lpFormat;
RGBQUAD *rgbNew = (RGBQUAD*)((LPBYTE)lpbiNew + lpbiNew->biSize);
AVIPALCHANGE *lppc = NULL;
- INT n;
+ UINT n;
- /* pherhaps formatchange, check it ... */
+ /* perhaps format change, check it ... */
if (This->cbFormat != formatsize)
return AVIERR_UNSUPPORTED;
- /* no formatchange, only the initial one */
+ /* no format change, only the initial one */
if (memcmp(This->lpFormat, format, formatsize) == 0)
return AVIERR_OK;
@@ -1090,7 +1090,7 @@
if (This->sInfo.dwSampleSize != 0) {
/* fixed samplesize -- we can read over frame/block boundaries */
- LONG block = start;
+ ULONG block = start;
LONG offset = 0;
/* convert start sample to block,offset pair */
@@ -2080,7 +2080,7 @@
static void AVIFILE_SamplesToBlock(IAVIStreamImpl *This, LPLONG pos,
LPLONG offset)
{
- DWORD block;
+ LONG block;
/* pre-conditions */
assert(This != NULL);
diff --git a/dlls/avifil32/editstream.c b/dlls/avifil32/editstream.c
index dc18f9c..611f505 100644
--- a/dlls/avifil32/editstream.c
+++ b/dlls/avifil32/editstream.c
@@ -544,7 +544,8 @@
IEditStreamInternal*pInternal = NULL;
IAVIEditStreamImpl *pEdit = NULL;
PAVISTREAM pStream;
- DWORD startPos, endPos, streamNr, n, nStreams;
+ DWORD startPos, endPos, streamNr, nStreams;
+ LONG n;
TRACE("(%p,%p,%p,%p,%ld,%ld)\n",iface,plStart,plLength,
pSource,lStart,lLength);
@@ -576,7 +577,7 @@
/* streamtype specific tests */
if (srcInfo.fccType == streamtypeVIDEO) {
- DWORD size;
+ LONG size;
size = srcInfo.rcFrame.right - srcInfo.rcFrame.left;
if (size != This->sInfo.rcFrame.right - This->sInfo.rcFrame.left)
diff --git a/dlls/avifil32/icmstream.c b/dlls/avifil32/icmstream.c
index 62b8cdc..f346e14 100644
--- a/dlls/avifil32/icmstream.c
+++ b/dlls/avifil32/icmstream.c
@@ -472,7 +472,7 @@
/* initial format setting? */
if (This->lpbiInput == NULL) {
- LONG size;
+ ULONG size;
assert(This->hic != NULL);
diff --git a/dlls/avifil32/tmpfile.c b/dlls/avifil32/tmpfile.c
index 6978456..69cfbda 100644
--- a/dlls/avifil32/tmpfile.c
+++ b/dlls/avifil32/tmpfile.c
@@ -164,7 +164,7 @@
TRACE("(%p) -> %ld\n", iface, This->ref - 1);
if (!--(This->ref)) {
- int i;
+ unsigned int i;
for (i = 0; i < This->fInfo.dwStreams; i++) {
if (This->ppStreams[i] != NULL) {
diff --git a/dlls/cabinet/cabextract.c b/dlls/cabinet/cabextract.c
index 566cccd..f750e6b 100644
--- a/dlls/cabinet/cabextract.c
+++ b/dlls/cabinet/cabextract.c
@@ -341,7 +341,7 @@
{
cab_off_t len=256, base = cabinet_getoffset(cab), maxlen = cab->filelen - base;
BOOL ok = FALSE;
- int i;
+ unsigned int i;
cab_UBYTE *buf = NULL;
TRACE("(cab == ^%p)\n", cab);
@@ -1148,7 +1148,8 @@
* QTMinit (internal)
*/
int QTMinit(int window, int level, cab_decomp_state *decomp_state) {
- int wndsize = 1 << window, msz = window * 2, i;
+ unsigned int wndsize = 1 << window;
+ int msz = window * 2, i;
cab_ULONG j;
/* QTM supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */
diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index 4b079b3..ee2e549 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -95,7 +95,7 @@
LPSTR dir;
unsigned char *ptr = (unsigned char*) dest;
- int i;
+ unsigned int i;
TRACE("(dest == %0lx, what == %s)\n", (long) dest, debugstr_a(what));
diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 9a1f9b7..750b1ba 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -280,7 +280,7 @@
base = FDI_getoffset(hfdi, hf),
maxlen = cabsize - base;
BOOL ok = FALSE;
- int i;
+ unsigned int i;
cab_UBYTE *buf = NULL;
TRACE("(hfdi == ^%p, hf == %d)\n", hfdi, hf);
@@ -650,7 +650,8 @@
* QTMfdi_init (internal)
*/
int QTMfdi_init(int window, int level, fdi_decomp_state *decomp_state) {
- int wndsize = 1 << window, msz = window * 2, i;
+ unsigned int wndsize = 1 << window;
+ int msz = window * 2, i;
cab_ULONG j;
/* QTM supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */
@@ -2279,8 +2280,8 @@
{
FDICABINETINFO fdici;
FDINOTIFICATION fdin;
- int cabhf, filehf;
- int i, idx;
+ int cabhf, filehf, idx;
+ unsigned int i;
char fullpath[MAX_PATH];
size_t pathlen, filenamelen;
char emptystring = '\0';
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index 3c8c130..7be3b27 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -400,14 +400,14 @@
static void COMBOEX_ReSize (COMBOEX_INFO *infoPtr)
{
SIZE mysize;
- UINT cy;
+ LONG cy;
IMAGEINFO iinfo;
COMBOEX_GetComboFontSize (infoPtr, &mysize);
cy = mysize.cy + CBE_EXTRA;
if (infoPtr->himl && ImageList_GetImageInfo(infoPtr->himl, 0, &iinfo)) {
cy = max (iinfo.rcImage.bottom - iinfo.rcImage.top, cy);
- TRACE("upgraded height due to image: height=%d\n", cy);
+ TRACE("upgraded height due to image: height=%ld\n", cy);
}
SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)cy);
if (infoPtr->hwndCombo) {
@@ -1610,7 +1610,7 @@
static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp)
{
RECT cbx_wrect, cbx_crect, cb_wrect;
- UINT width, height;
+ INT width, height;
GetWindowRect (infoPtr->hwndSelf, &cbx_wrect);
GetClientRect (infoPtr->hwndSelf, &cbx_crect);
diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c
index 8944c19..3f2818f 100644
--- a/dlls/comctl32/comctl32undoc.c
+++ b/dlls/comctl32/comctl32undoc.c
@@ -631,7 +631,8 @@
FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
{
LPWINEMRULIST mp = (LPWINEMRULIST)hList;
- UINT i, ret;
+ INT ret;
+ UINT i;
LPSTR dataA = NULL;
if (!mp->extview.lpfnCompare) {
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index a07b89c..b69ffa1 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -832,9 +832,9 @@
HGLOBAL hglb;
HRSRC hRsrc;
LPBITMAPINFOHEADER lpBitmap, lpBitmapInfo;
- UINT nSize, nColorTableSize;
+ UINT nSize, nColorTableSize, iColor;
RGBQUAD *pColorTable;
- INT iColor, i, iMaps, nWidth, nHeight;
+ INT i, iMaps, nWidth, nHeight;
HDC hdcScreen;
HBITMAP hbm;
LPCOLORMAP sysColorMap;
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 8bf49ce..85de945 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -256,7 +256,8 @@
static void
DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
{
- int i,j,k,len;
+ unsigned int i;
+ int j,k,len;
int *nrFields=& infoPtr->nrFields;
TRACE ("%s\n",formattxt);
@@ -267,7 +268,7 @@
len=strlen(allowedformatchars);
k=0;
- for (i=0; i<strlen (formattxt); i++) {
+ for (i=0; formattxt[i]; i++) {
TRACE ("\n%d %c:",i, formattxt[i]);
for (j=0; j<len; j++) {
if (allowedformatchars[j]==formattxt[i]) {
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 31be924..219db53 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -108,8 +108,8 @@
HEADER_OrderToIndex(HWND hwnd, WPARAM wParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- INT i,iorder = (INT)wParam;
-
+ INT iorder = (INT)wParam;
+ UINT i;
if ((iorder <0) || iorder >infoPtr->uNumItem)
return iorder;
@@ -125,7 +125,8 @@
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *phdi;
RECT rect;
- int i, x;
+ unsigned int i;
+ int x;
infoPtr->bRectsValid = TRUE;
@@ -354,7 +355,8 @@
HFONT hFont, hOldFont;
RECT rect;
HBRUSH hbrBk;
- INT i, x;
+ UINT i;
+ INT x;
/* get rect for the bar, adjusted for the border */
GetClientRect (hwnd, &rect);
@@ -401,7 +403,8 @@
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
RECT rect, rcTest;
- INT iCount, width;
+ UINT iCount;
+ INT width;
BOOL bNoWidth;
GetClientRect (hwnd, &rect);
@@ -814,7 +817,7 @@
LPINT order = (LPINT) lParam;
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
- if ((int)wParam <infoPtr->uNumItem)
+ if ((unsigned int)wParam <infoPtr->uNumItem)
return FALSE;
for (i=0; i<(int)wParam; i++)
*order++=HEADER_OrderToIndex(hwnd,i);
@@ -829,7 +832,7 @@
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem;
- if ((int)wParam <infoPtr->uNumItem)
+ if ((unsigned int)wParam <infoPtr->uNumItem)
return FALSE;
for (i=0; i<(int)wParam; i++)
{
@@ -870,7 +873,8 @@
HDITEMA *phdi = (HDITEMA*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
- INT len, i, iOrder;
+ INT len, iOrder;
+ UINT i;
if ((phdi == NULL) || (nItem < 0))
return -1;
@@ -971,7 +975,8 @@
HDITEMW *phdi = (HDITEMW*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
- INT len, i, iOrder;
+ INT len, iOrder;
+ UINT i;
if ((phdi == NULL) || (nItem < 0))
return -1;
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 7686c4c..0104305 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -41,7 +41,7 @@
* Bugs
* -- Expand large item in ICON mode when the cursor is flying over the icon or text.
* -- Support CustonDraw options for _WIN32_IE >= 0x560 (see NMLVCUSTOMDRAW docs.
- * -- in LISTVIEW_AddGroupSelection, se whould send LVN_ODSTATECHANGED
+ * -- in LISTVIEW_AddGroupSelection, we would send LVN_ODSTATECHANGED
* -- LVA_SNAPTOGRID not implemented
* -- LISTVIEW_ApproximateViewRect partially implemented
* -- LISTVIEW_[GS]etColumnOrderArray stubs
@@ -7723,7 +7723,7 @@
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT gcWheelDelta = 0;
- UINT pulScrollLines = 3;
+ INT pulScrollLines = 3;
SCROLLINFO scrollInfo;
TRACE("(wheelDelta=%d)\n", wheelDelta);
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 5503991..d93cf59 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -751,8 +751,8 @@
/* start and end bands are *not* hidden */
{
REBAR_BAND *lpBand;
- UINT x, xsep, extra, curwidth, fudge;
- INT i, last_adjusted;
+ UINT xsep, extra, curwidth, fudge;
+ INT x, i, last_adjusted;
TRACE("start=%u, end=%u, max x=%d, max y=%d\n",
rowstart, rowend, maxx, mcy);
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c
index 2a7a58d..d8e7a29 100644
--- a/dlls/comctl32/syslink.c
+++ b/dlls/comctl32/syslink.c
@@ -34,6 +34,7 @@
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
+#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(progress);
@@ -375,7 +376,7 @@
/* Copy the tag parameters */
if(lpID != NULL)
{
- nc = min(lenId, lstrlenW(lpID));
+ nc = min(lenId, strlenW(lpID));
nc = min(nc, MAX_LINKID_TEXT);
Last->u.Link.szID = SYSLINK_Alloc((MAX_LINKID_TEXT + 1) * sizeof(WCHAR));
if(Last->u.Link.szID != NULL)
@@ -388,7 +389,7 @@
Last->u.Link.szID = NULL;
if(lpUrl != NULL)
{
- nc = min(lenUrl, lstrlenW(lpUrl));
+ nc = min(lenUrl, strlenW(lpUrl));
nc = min(nc, L_MAX_URL_LENGTH);
Last->u.Link.szUrl = SYSLINK_Alloc((L_MAX_URL_LENGTH + 1) * sizeof(WCHAR));
if(Last->u.Link.szUrl != NULL)
@@ -455,7 +456,7 @@
/* Copy the tag parameters */
if(lpID != NULL)
{
- nc = min(lenId, lstrlenW(lpID));
+ nc = min(lenId, strlenW(lpID));
nc = min(nc, MAX_LINKID_TEXT);
Last->u.Link.szID = SYSLINK_Alloc((MAX_LINKID_TEXT + 1) * sizeof(WCHAR));
if(Last->u.Link.szID != NULL)
@@ -468,7 +469,7 @@
Last->u.Link.szID = NULL;
if(lpUrl != NULL)
{
- nc = min(lenUrl, lstrlenW(lpUrl));
+ nc = min(lenUrl, strlenW(lpUrl));
nc = min(nc, L_MAX_URL_LENGTH);
Last->u.Link.szUrl = SYSLINK_Alloc((L_MAX_URL_LENGTH + 1) * sizeof(WCHAR));
if(Last->u.Link.szUrl != NULL)
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index f8a66d5..2e00137 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -1051,7 +1051,7 @@
TAB_INFO* infoPtr = TAB_GetInfoPtr(hwnd);
LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);
TEXTMETRICA fontMetrics;
- INT curItem;
+ UINT curItem;
INT curItemLeftPos;
INT curItemRowCount;
HFONT hFont, hOldFont;
@@ -1243,8 +1243,8 @@
/* Arrange all tabs evenly if style says so */
if (!(lStyle & TCS_RAGGEDRIGHT) && ((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) && (infoPtr->uNumItem > 0))
{
- INT tabPerRow,remTab;
- INT iRow,iItm;
+ INT tabPerRow,remTab,iRow;
+ UINT iItm;
INT iCount=0;
/*
@@ -2341,7 +2341,7 @@
if (newselected != iTargetRow)
{
- INT i;
+ UINT i;
if(lStyle & TCS_VERTICAL)
{
for (i=0; i < infoPtr->uNumItem; i++)
@@ -2387,7 +2387,8 @@
else
{
RECT r;
- INT width, i;
+ INT width;
+ UINT i;
/* Calculate the part of the client area that is visible */
GetClientRect(hwnd, &r);
@@ -3173,7 +3174,7 @@
TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
- INT iItem;
+ UINT iItem;
if (!infoPtr)
return 0;
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 04e1e5a..2d27ba7 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -6025,7 +6025,7 @@
{
WCHAR wszBuffer[INFOTIPSIZE+1];
NMTBGETINFOTIPW tbgit;
- int len; /* in chars */
+ unsigned int len; /* in chars */
wszBuffer[0] = '\0';
wszBuffer[INFOTIPSIZE] = '\0';
@@ -6063,7 +6063,7 @@
{
CHAR szBuffer[INFOTIPSIZE+1];
NMTBGETINFOTIPA tbgit;
- int len; /* in chars */
+ unsigned int len; /* in chars */
szBuffer[0] = '\0';
szBuffer[INFOTIPSIZE] = '\0';
@@ -6104,7 +6104,7 @@
!(infoPtr->buttons[index].fsStyle & BTNS_SHOWTEXT))
{
LPWSTR pszText = TOOLBAR_GetText(infoPtr, &infoPtr->buttons[index]);
- int len = pszText ? strlenW(pszText) : 0;
+ unsigned int len = pszText ? strlenW(pszText) : 0;
TRACE("using button hidden text %s\n", debugstr_w(pszText));
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index fb042f4..2229dc1 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -2168,7 +2168,7 @@
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TTTOOL_INFO *toolPtr;
- INT i;
+ UINT i;
/* free tools */
if (infoPtr->tools) {
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c
index 2114c59..727d79e 100644
--- a/dlls/comctl32/trackbar.c
+++ b/dlls/comctl32/trackbar.c
@@ -563,7 +563,8 @@
static void
TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
- int i, ticFlags = dwStyle & 0x0f;
+ unsigned int i;
+ int ticFlags = dwStyle & 0x0f;
LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) };
HPEN hOldPen, hTicPen;
diff --git a/dlls/commdlg/filedlg31.c b/dlls/commdlg/filedlg31.c
index 92fa309..9a19822 100644
--- a/dlls/commdlg/filedlg31.c
+++ b/dlls/commdlg/filedlg31.c
@@ -668,7 +668,7 @@
{
LPCSTR s;
LPWSTR x;
- int n, len;
+ unsigned int n, len;
s = strA;
while (*s)