From 58973a21a30bf95427fd43c456e41e35c386218c Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 15 Jun 2012 18:52:16 +0000 Subject: another portion of "#ifsef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mmap_SA/Dbtool/dbtool.h | 12 ++---------- plugins/Dbx_mmap_SA/Dbtool/encryption.cpp | 8 ++------ plugins/Dbx_mmap_SA/Dbtool/langpack.cpp | 6 +----- plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp | 6 ++---- plugins/Dbx_mmap_SA/Import_SA/encryption.c | 7 +------ plugins/Dbx_mmap_SA/Import_SA/progress.c | 5 +---- 6 files changed, 9 insertions(+), 35 deletions(-) (limited to 'plugins/Dbx_mmap_SA') diff --git a/plugins/Dbx_mmap_SA/Dbtool/dbtool.h b/plugins/Dbx_mmap_SA/Dbtool/dbtool.h index 7cd3caf67b..63b6b4ccf1 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/dbtool.h +++ b/plugins/Dbx_mmap_SA/Dbtool/dbtool.h @@ -19,9 +19,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if defined( UNICODE ) && !defined( _UNICODE ) - #define _UNICODE -#endif #include @@ -116,13 +113,8 @@ __inline LPSTR Translate(LPSTR source) { return ( LPSTR )LangPackTranslateString( source, 0 ); } -#if defined( _UNICODE ) - #define TranslateT(s) (TCHAR*)LangPackTranslateString((LPCSTR)_T(s),1) - #define TranslateTS(s) (TCHAR*)LangPackTranslateString((LPCSTR)s,1) -#else - #define TranslateT(s) LangPackTranslateString(s,0) - #define TranslateTS(s) LangPackTranslateString(s,0) -#endif +#define TranslateT(s) (TCHAR*)LangPackTranslateString((LPCSTR)_T(s),1) +#define TranslateTS(s) (TCHAR*)LangPackTranslateString((LPCSTR)s,1) char* Utf8DecodeCP(char* str, int codepage, wchar_t** ucs2); char* Utf8EncodeUcs2(const wchar_t* src); diff --git a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp index cab515864c..3d00d70880 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp @@ -88,15 +88,11 @@ void InitSecurity() Modules[ModulesCount]->hLib = hLib; _snprintf(buf,SIZEOF(buf),"%d.%d.%d.%d", HIBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), HIBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version))); -#ifdef _UNICODE + mbstowcs(Name, Modules[ModulesCount]->cryptor->Name, 100); mbstowcs(Version, buf, 100); mbstowcs(DllName, Modules[ModulesCount]->dllname, 100); -#else - strcpy(Name, Modules[ModulesCount]->cryptor->Name); - strcpy(Version, buf); - strcpy(DllName, Modules[ModulesCount]->dllname); -#endif + AddToStatus(STATUS_MESSAGE,TranslateT("Cryptor loaded: %s [%s] (%s)"), Name, Version, DllName); ModulesCount++; diff --git a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp index d76cea33e0..7f2627cd11 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/langpack.cpp @@ -317,11 +317,7 @@ char *LangPackTranslateString(const char *szEnglish, const int W) return W ? (char *)entry->wlocal : entry->local; } -#if defined( _UNICODE ) - #define FLAGS 1 -#else - #define FLAGS 0 -#endif +#define FLAGS 1 static void TranslateWindow( HWND hwnd ) { diff --git a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp index a93f1720e6..2b91059176 100644 --- a/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp +++ b/plugins/Dbx_mmap_SA/Dbtool/modulechain.cpp @@ -98,13 +98,11 @@ int WorkModuleChain(int firstTime) } if (n) { TCHAR *pszModuleName; -#ifdef UNICODE + TCHAR szModuleName[257]; MultiByteToWideChar(CP_ACP, 0, modChain[iCurrentModName].name, -1, szModuleName, sizeof(szModuleName) / sizeof(TCHAR)); pszModuleName = szModuleName; -#else - pszModuleName = modChain[iCurrentModName].name; -#endif + AddToStatus(STATUS_WARNING,TranslateT("Module name '%s' is not unique: %d duplicates found)"), pszModuleName, n); } } diff --git a/plugins/Dbx_mmap_SA/Import_SA/encryption.c b/plugins/Dbx_mmap_SA/Import_SA/encryption.c index f261581041..ede73c006a 100644 --- a/plugins/Dbx_mmap_SA/Import_SA/encryption.c +++ b/plugins/Dbx_mmap_SA/Import_SA/encryption.c @@ -93,16 +93,11 @@ void InitSecurity() _snprintf(buf,SIZEOF(buf),"%d.%d.%d.%d", HIBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), HIBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version))); // Unsane: none /* -#ifdef _UNICODE + mbstowcs(Name, Modules[ModulesCount]->cryptor->Name, 100); mbstowcs(Version, buf, 100); mbstowcs(DllName, Modules[ModulesCount]->dllname, 100); -#else - strcpy(Name, Modules[ModulesCount]->cryptor->Name); - strcpy(Version, buf); - strcpy(DllName, Modules[ModulesCount]->dllname); -#endif */ AddMessage(LPGEN("Cryptor loaded: %s [%s] (%s)"), Modules[ModulesCount]->cryptor->Name, buf, Modules[ModulesCount]->dllname); diff --git a/plugins/Dbx_mmap_SA/Import_SA/progress.c b/plugins/Dbx_mmap_SA/Import_SA/progress.c index 1417868947..f3f4e9f08a 100644 --- a/plugins/Dbx_mmap_SA/Import_SA/progress.c +++ b/plugins/Dbx_mmap_SA/Import_SA/progress.c @@ -92,12 +92,9 @@ void AddMessage( const char* fmt, ... ) } #endif - #if defined( _UNICODE ) + { TCHAR* str = mir_a2t( msgBuf ); SendMessage( hdlgProgress, PROGM_ADDMESSAGE, 0, ( LPARAM )str ); mir_free( str ); } - #else - SendMessage( hdlgProgress, PROGM_ADDMESSAGE, 0, ( LPARAM )msgBuf ); - #endif } -- cgit v1.2.3