Fix signed/unsigned comparison warnings.

This commit is contained in:
Hans Leidekker 2004-09-02 23:00:53 +00:00 committed by Alexandre Julliard
parent ad6b12c64c
commit 411fc5f164
24 changed files with 72 additions and 59 deletions

View File

@ -663,7 +663,7 @@ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWO
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 RegQueryMultipleValuesA(HKEY hkey, PVALENTA val_list, DWORD num_val
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;

View File

@ -192,7 +192,7 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
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 @@ StartServiceA( SC_HANDLE hService, DWORD dwNumServiceArgs,
{
LPWSTR *lpwstr=NULL;
UNICODE_STRING usBuffer;
int i;
unsigned int i;
TRACE("(%p,%ld,%p)\n",hService,dwNumServiceArgs,lpServiceArgVectors);

View File

@ -526,7 +526,7 @@ static HRESULT WINAPI ACMStream_fnWrite(IAVIStream *iface, LONG start,
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);

View File

@ -957,7 +957,7 @@ LONG WINAPI AVIStreamSampleToTime(PAVISTREAM pstream, LONG lSample)
LONG WINAPI AVIStreamTimeToSample(PAVISTREAM pstream, LONG lTime)
{
AVISTREAMINFOW asiw;
LONG sample;
ULONG sample;
TRACE("(%p,%ld)\n", pstream, lTime);

View File

@ -986,13 +986,13 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
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 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
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 HRESULT AVIFILE_ReadBlock(IAVIStreamImpl *This, DWORD pos,
static void AVIFILE_SamplesToBlock(IAVIStreamImpl *This, LPLONG pos,
LPLONG offset)
{
DWORD block;
LONG block;
/* pre-conditions */
assert(This != NULL);

View File

@ -544,7 +544,8 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart,
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 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart,
/* 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)

View File

@ -472,7 +472,7 @@ static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
/* initial format setting? */
if (This->lpbiInput == NULL) {
LONG size;
ULONG size;
assert(This->hic != NULL);

View File

@ -164,7 +164,7 @@ static ULONG WINAPI ITmpFile_fnRelease(IAVIFile *iface)
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) {

View File

@ -341,7 +341,7 @@ char *cabinet_read_string(struct cabinet *cab)
{
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 @@ void QTMinitmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s) {
* 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) */

View File

@ -95,7 +95,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR what)
LPSTR dir;
unsigned char *ptr = (unsigned char*) dest;
int i;
unsigned int i;
TRACE("(dest == %0lx, what == %s)\n", (long) dest, debugstr_a(what));

View File

@ -280,7 +280,7 @@ char *FDI_read_string(HFDI hfdi, INT_PTR hf, long cabsize)
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 @@ void QTMfdi_initmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s)
* 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 @@ BOOL __cdecl FDICopy(
{
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';

View File

@ -400,14 +400,14 @@ static void COMBOEX_AdjustEditPos (COMBOEX_INFO *infoPtr)
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_Size (COMBOEX_INFO *infoPtr, INT width, INT height)
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);

View File

@ -631,7 +631,8 @@ INT WINAPI
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) {

View File

@ -832,9 +832,9 @@ CreateMappedBitmap (HINSTANCE hInstance, INT idBitmap, UINT wFlags,
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;

View File

@ -256,7 +256,8 @@ DATETIME_SetMonthCalFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
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 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt)
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]) {

View File

@ -108,8 +108,8 @@ static INT
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_SetItemBounds (HWND hwnd)
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 @@ HEADER_Refresh (HWND hwnd, HDC hdc)
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_InternalHitTest (HWND hwnd, LPPOINT lpPt, UINT *pFlags, INT *pItem)
{
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 @@ HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
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_SetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam)
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 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
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 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
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;

View File

@ -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 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT gcWheelDelta = 0;
UINT pulScrollLines = 3;
INT pulScrollLines = 3;
SCROLLINFO scrollInfo;
TRACE("(wheelDelta=%d)\n", wheelDelta);

View File

@ -751,8 +751,8 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend,
/* 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);

View File

@ -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 @@ CheckParameter:
/* 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 @@ CheckParameter:
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 @@ CheckParameter:
/* 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 @@ CheckParameter:
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)

View File

@ -1051,7 +1051,7 @@ static void TAB_SetItemBounds (HWND hwnd)
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 @@ static void TAB_SetItemBounds (HWND hwnd)
/* 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 @@ static void TAB_EnsureSelectionVisible(
if (newselected != iTargetRow)
{
INT i;
UINT i;
if(lStyle & TCS_VERTICAL)
{
for (i=0; i < infoPtr->uNumItem; i++)
@ -2387,7 +2387,8 @@ static void TAB_EnsureSelectionVisible(
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 @@ static LRESULT
TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
INT iItem;
UINT iItem;
if (!infoPtr)
return 0;

View File

@ -6025,7 +6025,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
{
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 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
{
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 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
!(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));

View File

@ -2168,7 +2168,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TTTOOL_INFO *toolPtr;
INT i;
UINT i;
/* free tools */
if (infoPtr->tools) {

View File

@ -563,7 +563,8 @@ TRACKBAR_DrawTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
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;

View File

@ -668,7 +668,7 @@ static LPWSTR FD31_MapStringPairsToW(LPCSTR strA, UINT size)
{
LPCSTR s;
LPWSTR x;
int n, len;
unsigned int n, len;
s = strA;
while (*s)