[Frhed-commits] SF.net SVN: frhed:[901] trunk/FRHED
Brought to you by:
kimmov
From: <ge...@us...> - 2010-11-17 14:36:57
|
Revision: 901 http://frhed.svn.sourceforge.net/frhed/?rev=901&view=rev Author: gerundt Date: 2010-11-17 14:36:51 +0000 (Wed, 17 Nov 2010) Log Message: ----------- PATCH: [ 3110477 ] Drop UNICODE preprocessor definition Modified Paths: -------------- trunk/FRHED/AboutDlg.cpp trunk/FRHED/AnsiConvert.h trunk/FRHED/BinTrans.cpp trunk/FRHED/FindDlg.cpp trunk/FRHED/LangArray.cpp trunk/FRHED/PasteDlg.cpp trunk/FRHED/compat.h trunk/FRHED/frhed.vcproj trunk/FRHED/heksedit.vcproj trunk/FRHED/hexwnd.cpp trunk/FRHED/version.h Modified: trunk/FRHED/AboutDlg.cpp =================================================================== --- trunk/FRHED/AboutDlg.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/AboutDlg.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -42,7 +42,7 @@ buf[RTL_NUMBER_OF(buf) - 1] = _T('\0'); _sntprintf(buf, RTL_NUMBER_OF(buf) - 1, GetLangString(IDS_ABOUTFRHEDVER), FRHED_MAJOR_VERSION, FRHED_MINOR_VERSION, FRHED_SUB_RELEASE_NO); -#if defined(UNICODE) && defined(_DEBUG) +#if defined(_DEBUG) _tcscat(buf, _T(" (Unicode Debug)")); #endif SetDlgItemText(hDlg, IDC_ABOUT_VER, buf); Modified: trunk/FRHED/AnsiConvert.h =================================================================== --- trunk/FRHED/AnsiConvert.h 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/AnsiConvert.h 2010-11-17 14:36:51 UTC (rev 901) @@ -73,14 +73,8 @@ typedef MakeWide A2W; typedef MakeAnsi W2A; -#ifdef UNICODE typedef PCWSTR T2W, W2T; typedef MakeAnsi T2A; typedef MakeWide A2T; -#else -typedef PCSTR T2A, A2T; -typedef MakeWide T2W; -typedef MakeAnsi W2T; -#endif #endif Modified: trunk/FRHED/BinTrans.cpp =================================================================== --- trunk/FRHED/BinTrans.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/BinTrans.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -416,16 +416,8 @@ } else { -#ifdef UNICODE di += WideCharToMultiByte( ((charmode == OEM_SET) ? CP_OEMCP : CP_ACP), 0, src +i, 1, (LPSTR) dest + di, 3, NULL, NULL ); -#else - if ( charmode == OEM_SET ) - CharToOem(&src[i], (LPSTR)&dest[di]); - else - dest[di] = (BYTE) src[i]; - di++; -#endif } } } Modified: trunk/FRHED/FindDlg.cpp =================================================================== --- trunk/FRHED/FindDlg.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/FindDlg.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -105,13 +105,8 @@ if (m_pFindCtxt->m_bUnicode) { pcFindstring = (BYTE*) new WCHAR[srclen +1]; -#ifdef UNICODE wcscpy((LPWSTR) pcFindstring, (LPWSTR) m_pFindCtxt->GetText()); destlen = srclen* sizeof (WCHAR); -#else - destlen = MultiByteToWideChar(CP_ACP, 0, m_pFindCtxt->GetText(), - srclen + 1, (WCHAR *)pcFindstring, srclen + 1) * sizeof (WCHAR); -#endif } else { Modified: trunk/FRHED/LangArray.cpp =================================================================== --- trunk/FRHED/LangArray.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/LangArray.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -387,7 +387,6 @@ PTSTR LangArray::TranslateString(int line) { -#ifdef UNICODE BSTR ws = 0; if (line > 0 && line < GetLength()) { @@ -402,41 +401,6 @@ } } return ws; -#else - PTSTR t = 0; - if (line > 0 && line < GetLength()) - { - if (char *s = GetAt(line)) - { - if (int len = strlen(s)) - { - unsigned codepage = GetACP(); - if (m_codepage != codepage) - { - // Attempt to convert to UI codepage - BSTR ws = SysAllocStringLen(0, len); - len = MultiByteToWideChar(m_codepage, 0, s, -1, ws, len + 1); - if (len) - { - SysReAllocStringLen(&ws, ws, len - 1); - len = WideCharToMultiByte(codepage, 0, ws, -1, 0, 0, 0, 0); - if (len) - { - t = (PTSTR)SysAllocStringByteLen(0, len - 1); - WideCharToMultiByte(codepage, 0, ws, -1, t, len, 0, 0); - } - } - SysFreeString(ws); - } - else - { - t = (PTSTR)SysAllocStringByteLen(s, len); - } - } - } - } - return t; -#endif } void LangArray::TranslateDialog(HWND h) Modified: trunk/FRHED/PasteDlg.cpp =================================================================== --- trunk/FRHED/PasteDlg.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/PasteDlg.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -110,19 +110,11 @@ BYTE *pasteData = (BYTE*) pcPastestring; int pasteSize = destlen * sizeof TCHAR; -#ifdef UNICODE if (bPasteAsUnicode) { pasteData = new BYTE[destlen * sizeof WCHAR]; pasteSize = WideCharToMultiByte(CP_ACP, 0, pcPastestring, destlen, (LPSTR) pasteData, destlen, NULL, NULL); -#else - if (!bPasteAsUnicode) - { - pasteData = new BYTE[destlen * sizeof WCHAR]; - pasteSize = MultiByteToWideChar(CP_ACP, 0, pcPastestring, destlen, - (LPWSTR) pasteData, destlen) * sizeof WCHAR; -#endif if ( pasteSize > 0 ) { delete [] pcPastestring; pcPastestring = (TCHAR *) pasteData; // delete me later. Modified: trunk/FRHED/compat.h =================================================================== --- trunk/FRHED/compat.h 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/compat.h 2010-11-17 14:36:51 UTC (rev 901) @@ -89,15 +89,9 @@ LPARAM lParam; } NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW; -#ifdef UNICODE - #define TBN_GETINFOTIP TBN_GETINFOTIPW - #define NMTBGETINFOTIP NMTBGETINFOTIPW - #define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW -#else - #define TBN_GETINFOTIP TBN_GETINFOTIPA - #define NMTBGETINFOTIP NMTBGETINFOTIPA - #define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA -#endif +#define TBN_GETINFOTIP TBN_GETINFOTIPW +#define NMTBGETINFOTIP NMTBGETINFOTIPW +#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW typedef struct _OSVERSIONINFOEXA { DWORD dwOSVersionInfoSize; @@ -121,15 +115,9 @@ WORD wServicePackMinor; WORD wReserved[2]; } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; -#ifdef UNICODE - typedef OSVERSIONINFOEXW OSVERSIONINFOEX; - typedef POSVERSIONINFOEXW POSVERSIONINFOEX; - typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX; -#else - typedef OSVERSIONINFOEXA OSVERSIONINFOEX; - typedef POSVERSIONINFOEXA POSVERSIONINFOEX; - typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX; -#endif // UNICODE +typedef OSVERSIONINFOEXW OSVERSIONINFOEX; +typedef POSVERSIONINFOEXW POSVERSIONINFOEX; +typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX; #endif //__CYGWIN__ Modified: trunk/FRHED/frhed.vcproj =================================================================== --- trunk/FRHED/frhed.vcproj 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/frhed.vcproj 2010-11-17 14:36:51 UTC (rev 901) @@ -48,7 +48,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_UNICODE;_CRT_SECURE_NO_DEPRECATE" RuntimeLibrary="3" UsePrecompiledHeader="0" PrecompiledHeaderThrough="precomp.h" Modified: trunk/FRHED/heksedit.vcproj =================================================================== --- trunk/FRHED/heksedit.vcproj 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/heksedit.vcproj 2010-11-17 14:36:51 UTC (rev 901) @@ -50,7 +50,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="$(ProgramFiles)\Microsoft SDK\include" - PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_UNICODE;_CRT_SECURE_NO_DEPRECATE" RuntimeLibrary="3" UsePrecompiledHeader="0" PrecompiledHeaderThrough="precomp.h" @@ -151,7 +151,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="$(ProgramFiles)\Microsoft SDK\include" - PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_UNICODE;_CRT_SECURE_NO_DEPRECATE" RuntimeLibrary="2" UsePrecompiledHeader="0" PrecompiledHeaderThrough="precomp.h" Modified: trunk/FRHED/hexwnd.cpp =================================================================== --- trunk/FRHED/hexwnd.cpp 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/hexwnd.cpp 2010-11-17 14:36:51 UTC (rev 901) @@ -282,13 +282,7 @@ if (LPWSTR p = LoadStringResource(hinst, uStringID)) { UINT n = (WORD)*p++; -#ifdef UNICODE text = SysAllocStringLen(p, n); -#else - UINT cb = WideCharToMultiByte(CP_ACP, 0, p, n, 0, 0, 0, 0); - text = (PSTR)SysAllocStringByteLen(0, cb); - WideCharToMultiByte(CP_ACP, 0, p, n, text, cb, 0, 0); -#endif if (langArray.m_hLangDll) { int line = 0; Modified: trunk/FRHED/version.h =================================================================== --- trunk/FRHED/version.h 2010-11-12 17:48:47 UTC (rev 900) +++ trunk/FRHED/version.h 2010-11-17 14:36:51 UTC (rev 901) @@ -35,11 +35,7 @@ #define SHARPEN_A(X) #X #define SHARPEN_W(X) L#X -#ifdef UNICODE #define SHARPEN(X) SHARPEN_W(X) -#else -#define SHARPEN(X) SHARPEN_A(X) -#endif #define FRHED_VERSION_1 FRHED_MAJOR_VERSION #define FRHED_VERSION_2 FRHED_MAJOR_VERSION.FRHED_MINOR_VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |