diff --git a/controls/button.c b/controls/button.c index 0826dc13f8c..5d87b8036fd 100644 --- a/controls/button.c +++ b/controls/button.c @@ -198,7 +198,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, checkBoxWidth = bmp.bmWidth / 4; checkBoxHeight = bmp.bmHeight / 3; } - if (btn_type < 0L || btn_type >= MAX_BTN_TYPE) + if (btn_type >= MAX_BTN_TYPE) return -1; /* abort */ set_button_state( hWnd, BUTTON_UNCHECKED ); return 0; diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 90dfb8ea7a9..a1aa50e2696 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -842,7 +842,7 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); if (dwFlags & ~(CRYPT_USER_DEFAULT | CRYPT_MACHINE_DEFAULT)) CRYPT_ReturnLastError(NTE_BAD_FLAGS); - if (dwProvType < 0 || dwProvType > 999) + if (dwProvType > 999) CRYPT_ReturnLastError(NTE_BAD_PROV_TYPE); if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, dwFlags & CRYPT_USER_DEFAULT)) ) CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -1129,7 +1129,7 @@ BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pd if (!pszProvName || pdwReserved) CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); - if (dwProvType < 0 || dwProvType > MAXPROVTYPES) + if (dwProvType > MAXPROVTYPES) CRYPT_ReturnLastError(NTE_BAD_PROV_TYPE); if (dwFlags & ~(CRYPT_MACHINE_DEFAULT | CRYPT_USER_DEFAULT | CRYPT_DELETE_DEFAULT) || dwFlags == CRYPT_DELETE_DEFAULT) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index d2a5b685ab3..fdfd7d91de0 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1832,10 +1832,10 @@ static VOID LISTVIEW_ShiftIndices(HWND hwnd, INT nItem, INT direction) { checkselection = DPA_GetPtr(infoPtr->hdpaSelectionRanges,index); if ((checkselection->lower >= nItem)&& - (checkselection->lower + direction >= 0)) + ((int)(checkselection->lower + direction) >= 0)) checkselection->lower += direction; if ((checkselection->upper >= nItem)&& - (checkselection->upper + direction >=0)) + ((int)(checkselection->upper + direction) >= 0)) checkselection->upper += direction; index ++; } diff --git a/dlls/ole32/oleobj.c b/dlls/ole32/oleobj.c index 80a90b47b11..67b867f3314 100644 --- a/dlls/ole32/oleobj.c +++ b/dlls/ole32/oleobj.c @@ -288,8 +288,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_Unadvise( /* * Check for invalid cookies. */ - if ( (dwConnection < 0) || - (dwConnection >= This->maxSinks) ) + if (dwConnection >= This->maxSinks) return OLE_E_NOCONNECTION; if (This->arrayOfSinks[dwConnection] == NULL) @@ -647,8 +646,7 @@ static HRESULT WINAPI DataAdviseHolder_Unadvise( /* * Check for invalid cookies. */ - if ( (dwConnection < 0) || - (dwConnection >= This->maxCons) ) + if (dwConnection >= This->maxCons) return OLE_E_NOCONNECTION; if (This->Connections[dwConnection].sink == NULL) diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 7ba62ad19e3..97df765a2b8 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -4067,7 +4067,7 @@ HRESULT WINAPI VarUI2FromUI4(ULONG ulIn, USHORT* puiOut) { TRACE("( %ld, %p ), stub\n", ulIn, puiOut ); - if( ulIn < UI2_MIN || ulIn > UI2_MAX ) + if( ulIn > UI2_MAX ) { return DISP_E_OVERFLOW; } @@ -4167,7 +4167,7 @@ HRESULT WINAPI VarUI4FromI4(LONG lIn, ULONG* pulOut) { TRACE("( %ld, %p ), stub\n", lIn, pulOut ); - if( lIn < UI4_MIN ) + if( lIn < 0 ) { return DISP_E_OVERFLOW; } @@ -4885,7 +4885,7 @@ HRESULT WINAPI VarDateFromUdate(UDATE *pudateout, */ HRESULT WINAPI VarBstrCmp(BSTR left, BSTR right, LCID lcid, DWORD flags) { - DWORD r; + INT r; TRACE("( %s %s %ld %lx ) partial stub\n", debugstr_w(left), debugstr_w(right), lcid, flags); diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index dd3df9b6692..1f84a0b3e66 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -1407,7 +1407,7 @@ static Window __get_top_decoration( Display *display, Window w, Window ancestor static unsigned __td_lookup( Window w, Window* list, unsigned max ) { unsigned i; - for( i = max - 1; i >= 0; i-- ) if( list[i] == w ) break; + for( i = max; i > 0; i-- ) if( list[i - 1] == w ) break; return i; }