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/MirandaG15/src/LCDFramework/CLCDInput.cpp | 12 ++++++------ plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp | 2 +- plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp | 2 +- plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp | 2 +- plugins/MirandaG15/src/LCDFramework/debug.cpp | 4 ++-- plugins/MirandaG15/src/LCDFramework/debug.h | 2 +- plugins/MirandaG15/src/LCDFramework/misc.cpp | 6 +++--- plugins/MirandaG15/src/LCDFramework/misc.h | 8 ++++---- plugins/MirandaG15/src/LCDFramework/stdafx.h | 1 - 9 files changed, 19 insertions(+), 20 deletions(-) (limited to 'plugins/MirandaG15/src/LCDFramework') diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index 1ca9bd4378..2a121c22c1 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -101,7 +101,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx) int iLine = m_iLinePosition; int iEndLine = m_iLinePosition + m_iLineCount; int iLen = 0; - TCHAR *pcOffset = NULL; + wchar_t *pcOffset = NULL; while(iLine < iEndLine && iLine < m_vLineOffsets.size()) { // Calculate the text length @@ -115,7 +115,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx) else iLen = (int)m_strText.length() - m_vLineOffsets[iLine].iOffset; // Draw the text - pcOffset = (TCHAR*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset; + pcOffset = (wchar_t*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset; DrawTextEx(pGfx->GetHDC(), (LPTSTR)pcOffset, iLen, @@ -380,7 +380,7 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam) { #ifdef _UNICODE - TCHAR output[4]; + wchar_t output[4]; #else unsigned char output[2]; #endif @@ -419,9 +419,9 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam) return 1; if(m_bInsert || m_strText[m_Marker[0].iPosition] == '\r') - m_strText.insert(m_Marker[0].iPosition,(TCHAR*)output,res); + m_strText.insert(m_Marker[0].iPosition,(wchar_t*)output,res); else - m_strText.replace(m_Marker[0].iPosition,res,(TCHAR*)output); + m_strText.replace(m_Marker[0].iPosition,res,(wchar_t*)output); scroll = 1; size = res; @@ -601,7 +601,7 @@ void CLCDInput::UpdateOffsets(int iModified) // Initialize variables int iLen = (int)m_strText.length(); int *piWidths = new int[iLen]; - TCHAR *pszText = (TCHAR*)m_strText.c_str(); + wchar_t *pszText = (wchar_t*)m_strText.c_str(); tstring::size_type pos = 0; int iMaxChars = 0; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp index 2c0a0bd866..e416be2810 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp @@ -150,7 +150,7 @@ void CLCDLabel::UpdateCutOffIndex() if(m_bWordWrap && GetWidth() > 0) { int *piExtents = new int[m_strText.length()]; - TCHAR *szString = (TCHAR*)m_strText.c_str(); + wchar_t *szString = (wchar_t*)m_strText.c_str(); int iMaxChars = 0; tstring::size_type pos = 0; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp index f0c30b78cf..bbb9b689df 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp @@ -304,7 +304,7 @@ void CLCDTextLog::WrapMessage(CLogEntry *pEntry) SIZE sizeLine = {0, 0}; int *piExtents = new int[strString.length()]; - TCHAR *szString = (TCHAR*)strString.c_str(); + wchar_t *szString = (wchar_t*)strString.c_str(); int iMaxChars = 0; tstring::size_type pos = 0; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index 56c2d9f68c..236cefc71b 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -108,7 +108,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) memset(&lf, 0, sizeof(lf)); GetObject(m_hFont, sizeof(LOGFONT), &lf); - _tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE); + wcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE); SetFont(lf); } diff --git a/plugins/MirandaG15/src/LCDFramework/debug.cpp b/plugins/MirandaG15/src/LCDFramework/debug.cpp index abca919bfe..1eb18013c7 100644 --- a/plugins/MirandaG15/src/LCDFramework/debug.cpp +++ b/plugins/MirandaG15/src/LCDFramework/debug.cpp @@ -25,9 +25,9 @@ } #endif -void _trace(TCHAR *fmt, ...) +void _trace(wchar_t *fmt, ...) { - TCHAR out[1024]; + wchar_t out[1024]; va_list body; va_start(body, fmt); #ifdef _UNICODE diff --git a/plugins/MirandaG15/src/LCDFramework/debug.h b/plugins/MirandaG15/src/LCDFramework/debug.h index 55bb8719e5..b9d49bf17f 100644 --- a/plugins/MirandaG15/src/LCDFramework/debug.h +++ b/plugins/MirandaG15/src/LCDFramework/debug.h @@ -12,7 +12,7 @@ extern void UnInitDebug(); #include "ConStream.h" #endif #define TRACE _trace -extern void _trace(TCHAR *fmt, ...); +extern void _trace(wchar_t *fmt, ...); #else inline void _trace(LPCTSTR, ...) { } #define TRACE 1 ? (void)0 : _trace diff --git a/plugins/MirandaG15/src/LCDFramework/misc.cpp b/plugins/MirandaG15/src/LCDFramework/misc.cpp index 968bb5ce6c..339b88e393 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.cpp +++ b/plugins/MirandaG15/src/LCDFramework/misc.cpp @@ -7,7 +7,7 @@ tstring tstringprintf(tstring strFormat,...) { va_start(vlist, strFormat); int mlen = (int)strFormat.length()+128; - TCHAR *text = (TCHAR*)malloc(mlen*sizeof(TCHAR)); + wchar_t *text = (wchar_t*)malloc(mlen*sizeof(wchar_t)); _vsntprintf(text,mlen,strFormat.c_str(),vlist); va_end(vlist); @@ -122,7 +122,7 @@ tstring Utf8_Decode(const char *str) size_t len = mir_strlen(str); - if ((wszTemp = (WCHAR *) malloc(sizeof(TCHAR) * (len + 2))) == NULL) + if ((wszTemp = (WCHAR *) malloc(sizeof(wchar_t) * (len + 2))) == NULL) return strRes; p = (char *) str; @@ -140,7 +140,7 @@ tstring Utf8_Decode(const char *str) wszTemp[i++] |= (*(p++) & 0x3f); } } - wszTemp[i] = (TCHAR)'\0'; + wszTemp[i] = (wchar_t)'\0'; strRes = wszTemp; free(wszTemp); diff --git a/plugins/MirandaG15/src/LCDFramework/misc.h b/plugins/MirandaG15/src/LCDFramework/misc.h index 0dd4494f0c..c5f2bb4f06 100644 --- a/plugins/MirandaG15/src/LCDFramework/misc.h +++ b/plugins/MirandaG15/src/LCDFramework/misc.h @@ -30,11 +30,11 @@ inline std::string toNarrowString( const std::string& str ) #ifdef _UNICODE #define tstring wstring - inline TCHAR toTchar( char ch ) + inline wchar_t toTchar( char ch ) { return (wchar_t)ch ; } - inline TCHAR toTchar( wchar_t ch ) + inline wchar_t toTchar( wchar_t ch ) { return ch ; } @@ -61,11 +61,11 @@ inline std::string toNarrowString( const std::string& str ) extern string Utf8_Encode(const WCHAR *str); #else #define tstring string - inline TCHAR toTchar( char ch ) + inline wchar_t toTchar( char ch ) { return ch ; } - inline TCHAR toTchar( wchar_t ch ) + inline wchar_t toTchar( wchar_t ch ) { return (ch >= 0 && ch <= 0xFF) ? (char)ch : '?' ; } diff --git a/plugins/MirandaG15/src/LCDFramework/stdafx.h b/plugins/MirandaG15/src/LCDFramework/stdafx.h index 2195cdf02e..2ae74c24b1 100644 --- a/plugins/MirandaG15/src/LCDFramework/stdafx.h +++ b/plugins/MirandaG15/src/LCDFramework/stdafx.h @@ -6,7 +6,6 @@ #define ASSERT assert #include -#include #include #include #include -- cgit v1.2.3