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/AVS/src/utils.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/AVS/src/utils.cpp') diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 4e7603c396..c46fff6a58 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -28,7 +28,7 @@ void mir_sleep(int time) ///////////////////////////////////////////////////////////////////////////////////////// // substitutes variables and passes our own data path as base -void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest) +void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest) { PathToAbsoluteT(VARST(ptszPath), ptszDest, g_szDataPath); } @@ -37,9 +37,9 @@ void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest) // convert the avatar image path to a relative one... // given: contact handle, path to image -void MakePathRelative(MCONTACT hContact, TCHAR *path) +void MakePathRelative(MCONTACT hContact, wchar_t *path) { - TCHAR szFinalPath[MAX_PATH]; + wchar_t szFinalPath[MAX_PATH]; szFinalPath[0] = '\0'; size_t result = PathToRelativeT(path, szFinalPath, g_szDataPath); @@ -68,7 +68,7 @@ void MakePathRelative(MCONTACT hContact) int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) { ptrT tszValue; - TCHAR tszFilename[MAX_PATH]; tszFilename[0] = 0; + wchar_t tszFilename[MAX_PATH]; tszFilename[0] = 0; ace->hbmPic = 0; ace->dwFlags = 0; @@ -139,8 +139,8 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (mir_tstrlen(tszFilename) < 4) return -1; - _tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE); - if (_taccess(tszFilename, 4) == -1) + wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE); + if (_waccess(tszFilename, 4) == -1) return -2; BOOL isTransparentImage = 0; @@ -149,7 +149,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) ace->bmHeight = 0; ace->bmWidth = 0; ace->lpDIBSection = NULL; - _tcsncpy(ace->szFilename, tszFilename, MAX_PATH); + wcsncpy(ace->szFilename, tszFilename, MAX_PATH); ace->szFilename[MAX_PATH - 1] = 0; if (ace->hbmPic == 0) return -1; @@ -230,7 +230,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) #define TOPBIT (1 << (WIDTH - 1)) /* MSB */ #define WIDTH 32 -int GetFileHash(TCHAR* filename) +int GetFileHash(wchar_t* filename) { HANDLE hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -435,7 +435,7 @@ void DeleteGlobalUserAvatar() if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) return; - TCHAR szFilename[MAX_PATH]; + wchar_t szFilename[MAX_PATH]; MyPathToAbsolute(dbv.ptszVal, szFilename); db_free(&dbv); @@ -457,8 +457,8 @@ void SetIgnoreNotify(char *protocol, BOOL ignore) /////////////////////////////////////////////////////////////////////////////////////////////////////// -DWORD GetFileSize(TCHAR *szFilename) +DWORD GetFileSize(wchar_t *szFilename) { struct _stat info; - return (_tstat(szFilename, &info) == -1) ? 0 : info.st_size; + return (_wstat(szFilename, &info) == -1) ? 0 : info.st_size; } -- cgit v1.2.3