From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Exchange/src/utils.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'plugins/Exchange/src/utils.cpp') diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index c1b297f164..9b5204a0cb 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -92,23 +92,23 @@ char *BinToHex(int size, PBYTE data) return szresult; } -void HexToBin(TCHAR *inData, ULONG &size, LPBYTE &outData) +void HexToBin(wchar_t *inData, ULONG &size, LPBYTE &outData) { - TCHAR buffer[32] = { 0 }; - _tcsncpy(buffer, L"0x", _countof(L"0x")); - _tcsncpy(buffer + 2, inData, HEX_SIZE); - _stscanf(buffer, L"%x", &size); + wchar_t buffer[32] = { 0 }; + wcsncpy(buffer, L"0x", _countof(L"0x")); + wcsncpy(buffer + 2, inData, HEX_SIZE); + swscanf(buffer, L"%x", &size); outData = (unsigned char*)new char[size * 2]; - TCHAR *tmp = inData + HEX_SIZE; + wchar_t *tmp = inData + HEX_SIZE; buffer[4] = '\0'; //mark the end of the string for (UINT i = 0; i < size; i++) { - _tcsncpy(buffer + 2, &tmp[i * 2], 2); - _stscanf(buffer, L"%hhx", &outData[i]); + wcsncpy(buffer + 2, &tmp[i * 2], 2); + swscanf(buffer, L"%hhx", &outData[i]); } } -int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, int size) +int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResult, int size) { DBVARIANT dbv = { 0 }; int res = 1; @@ -117,7 +117,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 0; size_t tmp = mir_tstrlen(dbv.ptszVal); size_t len = (tmp < size - 1) ? tmp : size - 1; - _tcsncpy(szResult, dbv.ptszVal, len); + wcsncpy(szResult, dbv.ptszVal, len); szResult[len] = '\0'; mir_free(dbv.ptszVal); } @@ -125,7 +125,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, res = 1; size_t tmp = mir_tstrlen(szError); size_t len = (tmp < size - 1) ? tmp : size - 1; - _tcsncpy(szResult, szError, len); + wcsncpy(szResult, szError, len); szResult[len] = '\0'; } return res; @@ -220,11 +220,11 @@ int ThreadCheckEmail(int bForceAttempt) return 0; } -void _popupUtil(TCHAR* szMsg) +void _popupUtil(wchar_t* szMsg) { POPUPDATAT ppd = { 0 }; ppd.lchIcon = hiMailIcon; - _tcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1); - _tcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1); + wcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1); + wcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1); PUAddPopupT(&ppd); //show a popup to tell the user what we're doing. } -- cgit v1.2.3