From f0ff6972eb5fecda4218fcea6686194f1b52e704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 23 Jun 2013 12:32:34 +0000 Subject: various warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@5095 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/FileShareNode.cpp | 4 +- plugins/HTTPServer/src/GuiElements.cpp | 2 +- plugins/HTTPServer/src/HttpUser.cpp | 2 +- plugins/IEView/src/ChatHTMLBuilder.cpp | 4 +- plugins/Non-IM Contact/src/namereplacing.cpp | 102 +++++++++++++-------------- plugins/Utils/mir_smileys.cpp | 2 +- plugins/YahooGroups/src/utils.cpp | 8 +-- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/plugins/HTTPServer/src/FileShareNode.cpp b/plugins/HTTPServer/src/FileShareNode.cpp index d2e9f62731..a5b57ecc14 100644 --- a/plugins/HTTPServer/src/FileShareNode.cpp +++ b/plugins/HTTPServer/src/FileShareNode.cpp @@ -207,11 +207,11 @@ bool CLFileShareNode::bSetPaths(char * pszSrvPath, char * pszRealPath) { delete [] st.pszSrvPath; delete [] st.pszRealPath; - st.dwMaxSrvPath = strlen(pszSrvPath) + 1; + st.dwMaxSrvPath = (int)strlen(pszSrvPath) + 1; st.pszSrvPath = new char[ st.dwMaxSrvPath ]; strcpy(st.pszSrvPath, pszSrvPath); - int nRealLen = strlen(pszRealPath); + int nRealLen = (int)strlen(pszRealPath); if (nRealLen <= 2 || !(pszRealPath[1] == ':' || (pszRealPath[0] == '\\' && pszRealPath[1] == '\\'))) { // Relative path diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 9af17158e9..be3233c174 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -63,7 +63,7 @@ string sPageKeyword = szDefaultPageKeyword; void ReplaceAll(string &sSrc, const char * pszReplace, const string &sNew) { string::size_type nCur = 0; - int nRepalceLen = strlen(pszReplace); + int nRepalceLen = (int)strlen(pszReplace); while ((nCur = sSrc.find(pszReplace, nCur)) != sSrc.npos) { sSrc.replace(nCur, nRepalceLen, sNew); nCur += sNew.size(); diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index 475765f495..a565289ba7 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -183,7 +183,7 @@ bool CLHttpUser::bReadGetParameters(char * pszRequest) { pszRequest[0] = 0; pszRequest++; for (int nCur = 0; nCur < eLastParam ; nCur++) { - int nLen = strlen(szParmStr[nCur]); + int nLen = (int)strlen(szParmStr[nCur]); if (strncmp(pszRequest, szParmStr[nCur], nLen) == 0) { if (apszParam[nCur]) { bRet = false; diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp index eb6ff7eaeb..f449cc0c4c 100644 --- a/plugins/IEView/src/ChatHTMLBuilder.cpp +++ b/plugins/IEView/src/ChatHTMLBuilder.cpp @@ -165,7 +165,7 @@ void ChatHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) //DWORD dwFlags = eventData->dwFlags; const char *iconFile = ""; DWORD dwData = eventData->dwData; - int isSent = eventData->bIsMe; + bool isSent = eventData->bIsMe != 0; int outputSize = 0; char *output = NULL; const char *className = ""; @@ -184,7 +184,7 @@ void ChatHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) if (eventData->iType == IEED_GC_EVENT_MESSAGE) { iconFile = isSent ? "message_out_chat.gif" : "message_in_chat.gif"; - showIcon = iconFlags & (isSent ? GC_EVENT_MESSAGE : GC_EVENT_MESSAGE); + showIcon = (iconFlags & (isSent ? GC_EVENT_MESSAGE : GC_EVENT_MESSAGE)) != 0; className = isSent ? "messageOut" : "messageIn"; } else { diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 622126ff64..757a55f0b9 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -53,11 +53,11 @@ int findWordInString(const char* line, const char* string, int* lengthOfWord, in } } i=0; - *lengthOfWord = strlen(word)+strlen(CloseDivider)+strlen(OpenDivider); + *lengthOfWord = (int)(strlen(word)+strlen(CloseDivider)+strlen(OpenDivider)); /* find the word in the line */ while (i < (strlen(line) - strlen(word))) { if (!strncmp(&line[i], word, strlen(word))) { - if (!flag) return i + strlen(word); /* the next char after the word */ + if (!flag) return i + (int)strlen(word); /* the next char after the word */ else return i; /* the char before the word */ } i++; @@ -76,16 +76,16 @@ int findLine(char* FileContents[], const char* string, int linesInFile,int start // check if its a number if (i != -1) { - *positionInOldString += strlen(_itoa(i,tmp,10)) - 1; + *positionInOldString += (int)strlen(_itoa(i,tmp,10)) - 1; return i; } // lastline if (!strncmp(&string[*positionInOldString], Translate("lastline("), strlen(Translate("lastline(")))) { - *positionInOldString += strlen(Translate("lastline(")); + *positionInOldString += (int)strlen(Translate("lastline(")); i = getNumber(&string[*positionInOldString]); if ( i != -1) { - *positionInOldString += strlen(_itoa(i,tmp,10)); + *positionInOldString += (int)strlen(_itoa(i,tmp,10)); return linesInFile - (i+1); } @@ -111,14 +111,14 @@ int findLine(char* FileContents[], const char* string, int linesInFile,int start } i = -1; } - *positionInOldString += strlen(string2Find) + strlen(Translate("\"\")")); + *positionInOldString += (int)(strlen(string2Find) + strlen(Translate("\"\")"))); if (i==-1) return i; // allow for a +- after the word to go up or down lines if (string[*positionInOldString] == '+') { *positionInOldString += 1; j = getNumber(&string[*positionInOldString]); if (j != -1) { - *positionInOldString += strlen(_itoa(j,tmp,10))-2; + *positionInOldString += (int)strlen(_itoa(j,tmp,10))-2; return i+j; } } @@ -126,7 +126,7 @@ int findLine(char* FileContents[], const char* string, int linesInFile,int start *positionInOldString+=1; j = getNumber(&string[*positionInOldString]); if (j != -1) { - *positionInOldString += strlen(_itoa(j,tmp,10))-2; + *positionInOldString += (int)strlen(_itoa(j,tmp,10))-2; return i-j; } } @@ -144,7 +144,7 @@ int findChar(char* FileContents[], const char* string, int linesInFile,int start int i = getNumber(&string[*positionInOldString]); // check if its a number if (i != -1) { - *positionInOldString += strlen(_itoa(i,tmp,10)) - 1; + *positionInOldString += (int)strlen(_itoa(i,tmp,10)) - 1; return i; } @@ -165,15 +165,15 @@ int findChar(char* FileContents[], const char* string, int linesInFile,int start if (j==strlen(FileContents[startLine])) return -1; - *positionInOldString += strlen(string2Find)+1; - return (startEnd) ? j : j+strlen(string2Find); + *positionInOldString += (int)strlen(string2Find)+1; + return (startEnd) ? j : j + (int)strlen(string2Find); } // csv( if (!strncmp(&string[*positionInOldString], Translate("csv("), strlen(Translate("csv(")))) { char seperator; int j=0, k=startChar; - *positionInOldString += strlen(Translate("csv(")); + *positionInOldString += (int)strlen(Translate("csv(")); if (!strncmp(&string[*positionInOldString], "tab", 3)) { *positionInOldString += 3; seperator = '\t'; @@ -188,8 +188,8 @@ int findChar(char* FileContents[], const char* string, int linesInFile,int start } i = getNumber(&string[*positionInOldString]); if ( i == -1) return -1; - *positionInOldString += strlen(_itoa(i,tmp,10)); - while (j