From 6be364a555dce699d093f9d49cd14a9b0c174893 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 22:12:34 +0000 Subject: warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@11181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/log.cpp | 2 +- src/core/stdclist/src/clcpaint.cpp | 18 +++++++++--------- src/core/stdfile/filesenddlg.cpp | 5 ++--- src/core/stdfile/filexferdlg.cpp | 2 +- src/core/stduserinfo/contactinfo.cpp | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src/core') diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp index 458183baf6..94c59430c6 100644 --- a/src/core/stdchat/src/log.cpp +++ b/src/core/stdchat/src/log.cpp @@ -31,7 +31,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG if (lstrdat->buffer == NULL) { lstrdat->bufferOffset = 0; lstrdat->buffer = pci->Log_CreateRTF(lstrdat); - lstrdat->bufferLen = mir_strlen(lstrdat->buffer); + lstrdat->bufferLen = (int)mir_strlen(lstrdat->buffer); } // give the RTF to the RE control diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index 49be0fca84..649c8123f7 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -320,14 +320,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight); else ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); - GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, mir_tstrlen(group->cl.items[group->scanIndex]->szText), &textSize); + GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, (int)mir_tstrlen(group->cl.items[group->scanIndex]->szText), &textSize); width = textSize.cx; if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]); if (szCounts[0]) { GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize); ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight); - GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize); + GetTextExtentPoint32A(hdcMem, szCounts, (int)mir_strlen(szCounts), &countsSize); width += spaceSize.cx + countsSize.cx; } } @@ -424,7 +424,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3; DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, - mir_tstrlen(group->cl.items[group->scanIndex]->szText)); + (int)mir_tstrlen(group->cl.items[group->scanIndex]->szText)); rc.left = rc.right + 6 + textSize.cx; rc.right = clRect.right; DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); @@ -440,7 +440,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (rc.right < rc.left + 4) rc.right = clRect.right + 1; else - TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts)); + TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, (int)mir_strlen(szCounts)); ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); if (selected) SetTextColor(hdcMem, dat->selTextColour); @@ -448,12 +448,12 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) SetHotTrackColour(hdcMem, dat); rc.right--; ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText, - mir_tstrlen(group->cl.items[group->scanIndex]->szText), NULL); + (int)mir_tstrlen(group->cl.items[group->scanIndex]->szText), NULL); } else TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace, - y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, - mir_tstrlen(group->cl.items[group->scanIndex]->szText)); + y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, + (int)mir_tstrlen(group->cl.items[group->scanIndex]->szText)); if (dat->exStyle & CLS_EX_LINEWITHGROUPS) { rc.top = y + (dat->rowHeight >> 1); rc.bottom = rc.top + 2; @@ -470,14 +470,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) rc.top = y + ((dat->rowHeight - fontHeight) >> 1); rc.right = (clRect.right - clRect.left); rc.bottom = rc.top; - DrawText(hdcMem, szText, mir_tstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); + DrawText(hdcMem, szText, (int)mir_tstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); } if (selected) { if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) { TCHAR *szText = group->cl.items[group->scanIndex]->szText; RECT rc; - int qlen = mir_tstrlen(dat->szQuickSearch); + size_t qlen = mir_tstrlen(dat->szQuickSearch); SetTextColor(hdcMem, dat->quickSearchColour); rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; rc.top = y + ((dat->rowHeight - fontHeight) >> 1); diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp index c207cb9ff0..f9be264353 100644 --- a/src/core/stdfile/filesenddlg.cpp +++ b/src/core/stdfile/filesenddlg.cpp @@ -82,13 +82,12 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) const TCHAR *pBuf; int nNumberOfFiles = 0; int nTemp; - int fileOffset; // :NOTE: The first string in the buffer is the directory, followed by a // NULL separated list of all files // fileOffset is the offset to the first file. - fileOffset = mir_tstrlen(buf) + 1; + size_t fileOffset = mir_tstrlen(buf) + 1; // Count number of files pBuf = buf + fileOffset; @@ -106,7 +105,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf) nTemp = 0; while (*pBuf) { // Allocate space for path+filename - int cbFileNameLen = mir_tstrlen(pBuf); + size_t cbFileNameLen = mir_tstrlen(pBuf); dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1)); // Add path to filename and copy into array diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp index f5eeeec531..962283e9b0 100644 --- a/src/core/stdfile/filexferdlg.cpp +++ b/src/core/stdfile/filexferdlg.cpp @@ -85,7 +85,7 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei) char *szFileNames = Utf8EncodeT(dat->szFilenames), *szMsg = Utf8EncodeT(dat->szMsg); dbei.flags |= DBEF_UTF; - dbei.cbBlob = sizeof(DWORD) + mir_strlen(szFileNames) + mir_strlen(szMsg) + 2; + dbei.cbBlob = int(sizeof(DWORD) + mir_strlen(szFileNames) + mir_strlen(szMsg) + 2); dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); *(PDWORD)dbei.pBlob = 0; mir_strcpy((char*)dbei.pBlob + sizeof(DWORD), szFileNames); diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp index 06a9a6c2e7..dd3984b1c8 100644 --- a/src/core/stduserinfo/contactinfo.cpp +++ b/src/core/stduserinfo/contactinfo.cpp @@ -196,7 +196,7 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail) SelectObject(hdc, hEmailFont); SIZE textSize; - GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &textSize); + GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &textSize); ReleaseDC(hwndEmails, hdc); if (hti.pt.x < rc.left+textSize.cx) { if (szEmail && cchEmail) -- cgit v1.2.3