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 --- include/m_acc.h | 2 +- include/m_clc.h | 5 ++--- include/m_core.h | 2 -- include/m_hotkeys.h | 4 ++-- include/m_langpack.h | 9 ++------- include/m_metacontacts.h | 3 ++- include/m_options.h | 22 +++++++++++----------- include/m_popup.h | 2 -- include/m_system.h | 1 - include/m_system_cpp.h | 24 ++++++++++-------------- 10 files changed, 30 insertions(+), 44 deletions(-) (limited to 'include') diff --git a/include/m_acc.h b/include/m_acc.h index 0881098274..93be99d204 100644 --- a/include/m_acc.h +++ b/include/m_acc.h @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. # define __M_ACC_H__ -#define AVATAR_CONTROL_CLASS _T( "MAvatarControlClass" ) // Class of the control +#define AVATAR_CONTROL_CLASS L"MAvatarControlClass" // Class of the control // Sets the contact that this avatar represents. This invalidates diff --git a/include/m_clc.h b/include/m_clc.h index 90cf424c22..7357e2fb1a 100644 --- a/include/m_clc.h +++ b/include/m_clc.h @@ -25,9 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CLC_H__ #define M_CLC_H__ 1 -//This module is new in 0.1.2.1 - -#define CLISTCONTROL_CLASS "CListControl" +#define CLISTCONTROL_CLASS "CListControl" +#define CLISTCONTROL_CLASSW L"CListControl" //styles #define CLS_MANUALUPDATE 0x0001 //todo diff --git a/include/m_core.h b/include/m_core.h index f4c6fcaea0..dfbea3077f 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -429,13 +429,11 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); }; typedef union { char *a; // utf8 or ansi strings - TCHAR *t; // strings of TCHARs wchar_t *w; // strings of WCHARs } MAllStrings; typedef union { char **a; // array of utf8 or ansi strings - TCHAR **t; // array of strings of TCHARs wchar_t **w; // array of strings of WCHARs } MAllStringArray; diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h index 8c5dc4fd8c..a732dda242 100644 --- a/include/m_hotkeys.h +++ b/include/m_hotkeys.h @@ -41,11 +41,11 @@ typedef struct const char *pszName; /* name to refer to hotkey when playing and in db */ union { const char *pszDescription; /* description for options dialog */ - const TCHAR *ptszDescription; + const wchar_t *ptszDescription; }; union { const char *pszSection; /* section name used to group sounds (NULL is acceptable) */ - const TCHAR *ptszSection; + const wchar_t *ptszSection; }; const char *pszService; /* Service to call when HotKey Pressed */ WORD DefHotKey; /* default hot key for action */ diff --git a/include/m_langpack.h b/include/m_langpack.h index 25cd934944..c158bc89ea 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -51,14 +51,13 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang); #define Translate(s) TranslateA_LP(s, hLangpack) #define TranslateW(s) TranslateW_LP(s, hLangpack) +#define TranslateT(s) TranslateW_LP(_A2W(s), hLangpack) #define TranslateDialogDefault(h) TranslateDialog_LP(h,hLangpack) #ifdef _UNICODE - #define TranslateT(s) TranslateW_LP(_T(s),hLangpack) #define TranslateTS(s) TranslateW_LP(s,hLangpack) #define TranslateTH(l,s) TranslateW_LP(s,l) #else - #define TranslateT(s) TranslateA_LP(s,hLangpack) #define TranslateTS(s) TranslateA_LP(s,hLangpack) #define TranslateTH(l,s) TranslateA_LP(s,l) #endif @@ -70,11 +69,7 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang); #define LPGEN(s) s #define LPGENW(s) L ## s -#ifdef _UNICODE - #define LPGENT(s) _T(s) -#else - #define LPGENT(s) s -#endif + //Those macros do NOTHING. They are just markers for lpgen.pl. ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h index 6eab3200ac..272abb61e2 100644 --- a/include/m_metacontacts.h +++ b/include/m_metacontacts.h @@ -27,7 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include // standard module for all mc-related information -#define META_PROTO "MetaContacts" +#define META_PROTO "MetaContacts" +#define META_PROTOW L"MetaContacts" //gets the handle for the 'most online' contact //wParam=(HANDLE)hMetaContact diff --git a/include/m_options.h b/include/m_options.h index 8ebefb40e8..50dd7e1627 100644 --- a/include/m_options.h +++ b/include/m_options.h @@ -59,28 +59,28 @@ DLUs. typedef struct { int position; //a position number, lower numbers are topmost union { - char* pszTitle; // [TRANSLATED-BY-CORE] - TCHAR* ptszTitle; + char *pszTitle; // [TRANSLATED-BY-CORE] + wchar_t *pwszTitle; }; DLGPROC pfnDlgProc; char *pszTemplate; HINSTANCE hInstance; - HICON hIcon; //v0.1.0.1+ + HICON hIcon; union { - char* pszGroup; //v0.1.0.1+ [TRANSLATED-BY-CORE] - TCHAR* ptszGroup; //v0.1.0.1+ + char *pszGroup; + wchar_t *pwszGroup; }; - int groupPosition; //v0.1.0.1+ - HICON hGroupIcon; //v0.1.0.1+ - DWORD flags; //v0.1.2.1+ + int groupPosition; + HICON hGroupIcon; + DWORD flags; union { - char* pszTab; //v0.6.0.0+ [TRANSLATED-BY-CORE] - TCHAR* ptszTab; //v0.6.0.0+ + char *pszTab; + wchar_t *pwszTab; }; union { - LPARAM dwInitParam; //v0.8.0.0+ a value to pass to lParam of WM_INITDIALOG message + LPARAM dwInitParam; // a value to pass to lParam of WM_INITDIALOG message class CDlgBase *pDialog; }; int hLangpack; diff --git a/include/m_popup.h b/include/m_popup.h index a418066a60..87d69bb297 100644 --- a/include/m_popup.h +++ b/include/m_popup.h @@ -691,12 +691,10 @@ typedef struct { union { const char *pszTitle; const wchar_t *pwszTitle; - const TCHAR *ptszTitle; }; union { const char *pszText; const wchar_t *pwszText; - const TCHAR *ptszText; }; void *PluginData; MCONTACT hContact; diff --git a/include/m_system.h b/include/m_system.h index 3adb87982f..da061c8c13 100644 --- a/include/m_system.h +++ b/include/m_system.h @@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1), A) #define NEWWSTR_ALLOCA(A) ((A==NULL)?NULL:wcscpy((wchar_t*)alloca(sizeof(wchar_t)*(wcslen(A)+1)),A)) -#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)), A) #include diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index 95d9c35e50..1f60a5c399 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -30,13 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #if defined(__cplusplus) -#if defined(_STRING_) -namespace std -{ - typedef basic_string, allocator > tstring; -} -#endif - /////////////////////////////////////////////////////////////////////////////// // mir_ptr - automatic pointer for buffers, allocated using mir_alloc/mir_calloc @@ -58,7 +51,7 @@ public: }; typedef mir_ptr ptrA; -typedef mir_ptr ptrT; +typedef mir_ptr ptrT; typedef mir_ptr ptrW; /////////////////////////////////////////////////////////////////////////////// @@ -272,24 +265,27 @@ template struct OBJLIST : public LIST __inline T& operator[](int idx) const { return *this->items[idx]; } }; -class _A2T : public ptrT +#define __A2W(s) L ## s +#define _A2W(s) __A2W(s) + +class _A2T : public ptrW { public: - __inline _A2T(const char* s) : ptrT(mir_a2t(s)) {} - __inline _A2T(const char* s, int cp) : ptrT(mir_a2t_cp(s, cp)) {} + __inline _A2T(const char* s) : ptrW(mir_a2u(s)) {} + __inline _A2T(const char* s, int cp) : ptrW(mir_a2u_cp(s, cp)) {} }; class _T2A : public ptrA { public: - __forceinline _T2A(const TCHAR* s) : ptrA(mir_t2a(s)) {} - __forceinline _T2A(const TCHAR* s, int cp) : ptrA(mir_t2a_cp(s, cp)) {} + __forceinline _T2A(const wchar_t* s) : ptrA(mir_u2a(s)) {} + __forceinline _T2A(const wchar_t* s, int cp) : ptrA(mir_u2a_cp(s, cp)) {} }; class T2Utf : public ptrA { public: - __forceinline T2Utf(const TCHAR *str) : ptrA(mir_utf8encodeT(str)) {} + __forceinline T2Utf(const wchar_t *str) : ptrA(mir_utf8encodeW(str)) {} __forceinline operator BYTE* () const { return (BYTE*)data; } #ifdef _XSTRING_ std::string str() const { return std::string(data); } -- cgit v1.2.3