From d5d023f683b23fe26ddea93738cb721d532804f0 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy <watcherhd@gmail.com> Date: Thu, 14 Jun 2012 16:22:13 +0000 Subject: another portion of "#ifsef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/miranda.cpp | 6 ------ src/core/miranda.h | 45 +++++++++---------------------------------- src/modules/button/button.cpp | 16 +++++---------- src/modules/clist/clc.cpp | 23 +++++++--------------- 4 files changed, 21 insertions(+), 69 deletions(-) (limited to 'src') diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp index 2403b5aaf8..5bcf10285f 100644 --- a/src/core/miranda.cpp +++ b/src/core/miranda.cpp @@ -578,11 +578,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) MyMonitorFromPoint = (pfnMyMonitorFromPoint)GetProcAddress(hUser32, "MonitorFromPoint"); MyMonitorFromRect = (pfnMyMonitorFromRect)GetProcAddress(hUser32, "MonitorFromRect"); MyMonitorFromWindow = (pfnMyMonitorFromWindow)GetProcAddress(hUser32, "MonitorFromWindow"); -#ifdef _UNICODE MyGetMonitorInfo = (pfnMyGetMonitorInfo)GetProcAddress(hUser32, "GetMonitorInfoW"); -#else - MyGetMonitorInfo = (pfnMyGetMonitorInfo)GetProcAddress(hUser32, "GetMonitorInfoA"); -#endif hShFolder = GetModuleHandleA("shell32"); shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA"); @@ -769,8 +765,6 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam) mir_snprintf(( char* )lParam, wParam, "%S x64 Unicode", productVersion ); #elif defined( _UNICODE ) mir_snprintf(( char* )lParam, wParam, "%S Unicode", productVersion ); -#else - lstrcpyn((char*)lParam, productVersion, wParam); #endif mir_free(pVerInfo); return 0; diff --git a/src/core/miranda.h b/src/core/miranda.h index f9d6340fb4..044b807fa7 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -44,11 +44,7 @@ typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathW)(HWND, LPWSTR, int, extern pfnSHGetSpecialFolderPathA shGetSpecialFolderPathA; extern pfnSHGetSpecialFolderPathW shGetSpecialFolderPathW; -#ifdef _UNICODE #define shGetSpecialFolderPath shGetSpecialFolderPathW -#else -#define shGetSpecialFolderPath shGetSpecialFolderPathA -#endif typedef HDESK (WINAPI* pfnOpenInputDesktop)(DWORD, BOOL, DWORD); extern pfnOpenInputDesktop openInputDesktop; @@ -177,13 +173,8 @@ char* Utf8EncodeUcs2( const wchar_t* str ); int Ucs2toUtf8Len(const wchar_t *src); -#if defined( _UNICODE ) - #define Utf8DecodeT Utf8DecodeUcs2 - #define Utf8EncodeT Utf8EncodeUcs2 -#else - #define Utf8DecodeT Utf8DecodeA - #define Utf8EncodeT Utf8Encode -#endif +#define Utf8DecodeT Utf8DecodeUcs2 +#define Utf8EncodeT Utf8EncodeUcs2 /**** langpack.c ***********************************************************************/ @@ -215,18 +206,12 @@ __inline unsigned int hashstr(const wchar_t * key) int pathToAbsolute(const char *pSrc, char *pOut, char* base); void CreatePathToFile( char* wszFilePath ); int CreateDirectoryTree(const char *szDir); -#if defined( _UNICODE ) - void CreatePathToFileW( WCHAR* wszFilePath ); - int CreateDirectoryTreeW(const WCHAR *szDir); - int pathToAbsoluteW(const TCHAR *pSrc, TCHAR *pOut, TCHAR* base); - #define pathToAbsoluteT pathToAbsoluteW - #define CreatePathToFileT CreatePathToFileW - #define CreateDirectoryTreeT CreateDirectoryTreeW -#else - #define pathToAbsoluteT pathToAbsolute - #define CreatePathToFileT CreatePathToFile - #define CreateDirectoryTreeT CreateDirectoryTree -#endif +void CreatePathToFileW( WCHAR* wszFilePath ); +int CreateDirectoryTreeW(const WCHAR *szDir); +int pathToAbsoluteW(const TCHAR *pSrc, TCHAR *pOut, TCHAR* base); +#define pathToAbsoluteT pathToAbsoluteW +#define CreatePathToFileT CreatePathToFileW +#define CreateDirectoryTreeT CreateDirectoryTreeW /**** skin2icons.c *********************************************************************/ @@ -309,9 +294,7 @@ __inline static INT_PTR CallProtoService( const char* szModule, const char* szSe /**** utils.c **************************************************************************/ -#if defined( _UNICODE ) - char* __fastcall rtrim(char* str); -#endif +char* __fastcall rtrim(char* str); TCHAR* __fastcall rtrim(TCHAR* str); char* __fastcall ltrim(char* str); char* __fastcall ltrimp(char* str); @@ -353,19 +336,9 @@ public: operator const LPARAM () const { return ( LPARAM )m_body; } }; -#ifdef _UNICODE - #define StrConvT( x ) StrConvUT( x ) #define StrConvTu( x ) x #define StrConvA( x ) StrConvAT( x ) #define StrConvU( x ) x -#else - -#define StrConvT( x ) x -#define StrConvTu( x ) StrConvAT( x ) -#define StrConvA( x ) x -#define StrConvU( x ) StrConvUT( x ) - -#endif diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index 86282fe47f..7395f2122a 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -489,14 +489,10 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(bct->hwndToolTips, TTM_DELTOOL, 0, (LPARAM)&ti); ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS; ti.uId = (UINT_PTR)bct->hwnd; - #if defined( _UNICODE ) - if ( lParam & BATF_UNICODE ) - ti.lpszText = mir_wstrdup( TranslateW(( WCHAR* )wParam )); - else - ti.lpszText = LangPackPcharToTchar(( char* )wParam ); - #else - ti.lpszText = Translate(( char* )wParam ); - #endif + if ( lParam & BATF_UNICODE ) + ti.lpszText = mir_wstrdup( TranslateW(( WCHAR* )wParam )); + else + ti.lpszText = LangPackPcharToTchar(( char* )wParam ); if (bct->pAccPropServices) { wchar_t *tmpstr = mir_t2u(ti.lpszText); bct->pAccPropServices->SetHwndPropStr(bct->hwnd, OBJID_CLIENT, @@ -504,9 +500,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L mir_free(tmpstr); } SendMessage( bct->hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti); - #if defined( _UNICODE ) - mir_free( ti.lpszText ); - #endif + mir_free( ti.lpszText ); } break; case WM_SETFOCUS: // set keybord focus and redraw diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 1a9e32617f..982ede3406 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -422,25 +422,16 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, } if ( dbcws->value.type == DBVT_ASCIIZ ) { - #if defined( UNICODE ) - WCHAR* wszGrpName = mir_a2u(dbcws->value.pszVal+1); - eq = !lstrcmp( szFullName, wszGrpName ); - mir_free( wszGrpName ); - #else - eq = !lstrcmp( szFullName, dbcws->value.pszVal+1 ); - #endif + WCHAR* wszGrpName = mir_a2u(dbcws->value.pszVal+1); + eq = !lstrcmp( szFullName, wszGrpName ); + mir_free( wszGrpName ); } else { char* szGrpName = NEWSTR_ALLOCA(dbcws->value.pszVal+1); - #if defined( UNICODE ) - WCHAR* wszGrpName; - Utf8Decode(szGrpName, &wszGrpName ); - eq = !lstrcmp( szFullName, wszGrpName ); - mir_free( wszGrpName ); - #else - Utf8Decode(szGrpName, NULL); - eq = !lstrcmp( szFullName, szGrpName ); - #endif + WCHAR* wszGrpName; + Utf8Decode(szGrpName, &wszGrpName ); + eq = !lstrcmp( szFullName, wszGrpName ); + mir_free( wszGrpName ); } if ( eq && (contact->group->hideOffline != 0) == ((dbcws->value.pszVal[0] & GROUPF_HIDEOFFLINE) != 0)) break; //only expanded has changed: no action reqd -- cgit v1.2.3