diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/TooltipNotify/src | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TooltipNotify/src')
-rw-r--r-- | plugins/TooltipNotify/src/TooltipNotify.cpp | 6 | ||||
-rw-r--r-- | plugins/TooltipNotify/src/TooltipNotify.h | 2 | ||||
-rw-r--r-- | plugins/TooltipNotify/src/Utils.cpp | 9 | ||||
-rw-r--r-- | plugins/TooltipNotify/src/Utils.h | 2 | ||||
-rw-r--r-- | plugins/TooltipNotify/src/stdafx.h | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index ac480dc1e6..d21cae65d2 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -727,8 +727,8 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.lParam = i;
#ifdef _UNICODE
WCHAR wszProto[128];
- long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName,
- strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto));
+ long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName,
+ (int)strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto));
wszProto[lLen] = L'\0';
lvi.pszText = wszProto;
@@ -1009,7 +1009,7 @@ TCHAR *CTooltipNotify::MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *sz #ifdef _UNICODE
WCHAR wszProto[32];
- long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, strlen(szProto), wszProto, ARRAY_SIZE(wszProto));
+ long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)strlen(szProto), wszProto, ARRAY_SIZE(wszProto));
wszProto[lLen] = _T('\0');
_sntprintf(szString, iBufSize-1, szFormatString, wszProto, _T(": "), szContactName);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 5e17597dd6..00ed0bb932 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -126,7 +126,7 @@ private: {
CTooltipNotify::GetObjInstance()->OnTooltipTimer(hwnd, uMsg, idEvent, dwTime);
}
- static BOOL CALLBACK OptionsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+ static INT_PTR CALLBACK OptionsDlgProcWrapper(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
return CTooltipNotify::GetObjInstance()->OptionsDlgProc(hDlg, msg, wParam, lParam);
}
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp index ce73dbc59b..67b9b670b6 100644 --- a/plugins/TooltipNotify/src/Utils.cpp +++ b/plugins/TooltipNotify/src/Utils.cpp @@ -14,19 +14,16 @@ BOOL IsNt50() return (bMajorVer>=5 && bMinorVer>=0);
}
-void TruncateWithDots(TCHAR* szString, int iNewLen)
+void TruncateWithDots(TCHAR* szString, size_t iNewLen)
{
assert(iNewLen >= 0);
- int iOrigLen = _tcslen(szString);
- if (iNewLen < iOrigLen)
- {
+ size_t iOrigLen = _tcslen(szString);
+ if (iNewLen < iOrigLen) {
TCHAR* p = szString+iNewLen;
*p = _T('\0');
for(int i=0; --p>=szString && i<3; i++)
- {
*p = _T('.');
- }
}
}
diff --git a/plugins/TooltipNotify/src/Utils.h b/plugins/TooltipNotify/src/Utils.h index d1ad4d0fe7..7264e4c27c 100644 --- a/plugins/TooltipNotify/src/Utils.h +++ b/plugins/TooltipNotify/src/Utils.h @@ -5,4 +5,4 @@ #pragma once
BOOL IsNt50();
-void TruncateWithDots(TCHAR* szString, int iNewLen);
\ No newline at end of file +void TruncateWithDots(TCHAR* szString, size_t iNewLen);
\ No newline at end of file diff --git a/plugins/TooltipNotify/src/stdafx.h b/plugins/TooltipNotify/src/stdafx.h index d77c5a3037..d00b996556 100644 --- a/plugins/TooltipNotify/src/stdafx.h +++ b/plugins/TooltipNotify/src/stdafx.h @@ -5,7 +5,7 @@ #pragma once
-
+#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _WIN32_WINNT 0x0500
|