From 8c5cf9634f560f7dd3976d762573071d9fca31b3 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 18 Oct 2013 20:05:08 +0000 Subject: small code warning fix git-svn-id: http://svn.miranda-ng.org/main/trunk@6521 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_string.h | 2 +- plugins/AVS/src/options.cpp | 2 +- plugins/Db3x_mmap/src/dbtool/modulechain.cpp | 22 +++++++++------------- plugins/Import/src/import.cpp | 12 ++++++------ plugins/Scriver/src/chat/manager.cpp | 4 ++-- src/modules/options/iconheader.cpp | 2 +- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index fd7ab6a235..7417e4ef3f 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -214,7 +214,7 @@ public: // See comment in SetString() about why we do this UINT_PTR nOffset = pszSrc - GetString(); - UINT nOldLength = GetLength(); + int nOldLength = GetLength(); if (nOldLength < 0) { // protects from underflow nOldLength = 0; diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 61eba41b6a..8b1212e04d 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -297,7 +297,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar { LVITEM item = {0}; LVCOLUMN lvc = {0}; - UINT64 newItem = 0; + int newItem = 0; dialoginit = TRUE; TranslateDialogDefault(hwndDlg); diff --git a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp index d6b426f1b5..509b837905 100644 --- a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp @@ -58,19 +58,15 @@ int CDb3Base::WorkModuleChain(int firstTime) phase++; return ERROR_SUCCESS; } - if (moduleName.cbName>256) - cb->pfnAddLogMessage(STATUS_WARNING,TranslateT("Unreasonably long module name, skipping")); - else { - modChain = (ModChainEntry*)realloc(modChain,sizeof(ModChainEntry)*++modChainCount); - - modChain[modChainCount-1].ofsOld = ofsCurrent; - modChain[modChainCount-1].size = offsetof(DBModuleName,name)+moduleName.cbName; - modChain[modChainCount-1].ofsNew = 0; - - if (moduleName.cbName) - PeekSegment(ofsCurrent+offsetof(DBModuleName,name),&modChain[modChainCount-1].name,moduleName.cbName); - modChain[modChainCount-1].name[moduleName.cbName] = 0; - } + modChain = (ModChainEntry*)realloc(modChain,sizeof(ModChainEntry)*++modChainCount); + + modChain[modChainCount-1].ofsOld = ofsCurrent; + modChain[modChainCount-1].size = offsetof(DBModuleName,name)+moduleName.cbName; + modChain[modChainCount-1].ofsNew = 0; + + if (moduleName.cbName) + PeekSegment(ofsCurrent+offsetof(DBModuleName,name),&modChain[modChainCount-1].name,moduleName.cbName); + modChain[modChainCount-1].name[moduleName.cbName] = 0; ofsCurrent = moduleName.ofsNext; break; case 1: diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index e17eb4fbce..f220b3b6bc 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -64,13 +64,13 @@ static void mySet(HANDLE hContact, const char *module, const char *var, DBVARIAN ///////////////////////////////////////////////////////////////////////////////////////// -static HANDLE HContactFromNumericID(char* szProto, char* pszSetting, DWORD dwID) +static HANDLE HContactFromNumericID(char* pszProtoName, char* pszSetting, DWORD dwID) { HANDLE hContact = dstDb->FindFirstContact(); while (hContact != NULL) { - if ( db_get_dw(hContact, szProto, pszSetting, 0) == dwID) { + if ( db_get_dw(hContact, pszProtoName, pszSetting, 0) == dwID) { char* szProto = GetContactProto(hContact); - if (szProto != NULL && !lstrcmpA(szProto, szProto)) + if (szProto != NULL && !lstrcmpA(szProto, pszProtoName)) return hContact; } hContact = dstDb->FindNextContact(hContact); @@ -78,13 +78,13 @@ static HANDLE HContactFromNumericID(char* szProto, char* pszSetting, DWORD dwID) return INVALID_HANDLE_VALUE; } -static HANDLE HContactFromID(char* szProto, char* pszSetting, TCHAR* pwszID) +static HANDLE HContactFromID(char* pszProtoName, char* pszSetting, TCHAR* pwszID) { HANDLE hContact = dstDb->FindFirstContact(); while (hContact != NULL) { char* szProto = GetContactProto(hContact); - if ( !lstrcmpA(szProto, szProto)) { - ptrW id( db_get_tsa(hContact, szProto, pszSetting)); + if ( !lstrcmpA(szProto, pszProtoName)) { + ptrW id( db_get_tsa(hContact, pszProtoName, pszSetting)); if ( !lstrcmp(pwszID, id)) return hContact; } diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index 7d3191c733..0c54c89940 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -1276,11 +1276,11 @@ TCHAR* UM_FindUserAutoComplete(USERINFO* pUserList, const TCHAR* pszOriginal, co BOOL UM_RemoveUser(USERINFO** ppUserList, const TCHAR* pszUID) { - USERINFO *pTemp = *ppUserList, *pLast = NULL; - if (!ppUserList || !pszUID) return FALSE; + USERINFO *pTemp = *ppUserList, *pLast = NULL; + while (pTemp != NULL) { if (!lstrcmpi( pTemp->pszUID, pszUID )) { if (pLast == NULL) diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index 184ca6c4a7..a185e1aecd 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -517,7 +517,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L return itc->nSelectedIdx; case ITCM_GETITEMDATA: - if (wParam >= 0 && (int)wParam < itc->pList.getCount()) + if ((int)wParam < itc->pList.getCount()) return ((MIcoTab *)itc->pList[wParam])->data; return 0; -- cgit v1.2.3