From 05c989e58aeffcfb59cebaca6797cb69dd25cb1e Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sat, 16 Jun 2012 14:33:30 +0000 Subject: another portion of "#ifdef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/parse_system.cpp | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'plugins/Variables/parse_system.cpp') diff --git a/plugins/Variables/parse_system.cpp b/plugins/Variables/parse_system.cpp index 5bc927bd93..65e75ffc9a 100644 --- a/plugins/Variables/parse_system.cpp +++ b/plugins/Variables/parse_system.cpp @@ -498,11 +498,9 @@ static TCHAR *parseProcessRunning(ARGUMENTSINFO *ai) { if (ai->argc != 2) { return NULL; } -#ifdef UNICODE + szProc = ref = u2a(ai->targv[1]); -#else - szProc = ref = _strdup(ai->argv[1]); -#endif + EnumProcs((PROCENUMPROC) MyProcessEnumerator, (LPARAM)&szProc); if (szProc != NULL) { ai->flags |= AIF_FALSE; @@ -692,11 +690,9 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { SetFilePointer(hFile, 0, NULL, FILE_BEGIN); } else { -#ifndef UNICODE - return NULL; -#else + csz = sizeof(TCHAR); -#endif + } totalReadSz = 0; lineCount = 1; @@ -713,7 +709,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { return NULL; } CloseHandle(hFile); -#ifdef UNICODE + if (tUC) { res = (TCHAR *)pBuf; } @@ -721,9 +717,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { res = a2u((char *)pBuf); free(pBuf); } -#else - res = (char*)pBuf; -#endif + return res; } @@ -837,7 +831,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { else { *(char *)pCur = '\0'; } -#ifdef UNICODE + if (tUC) { res = (TCHAR *)pBuf; } @@ -845,15 +839,13 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { res = a2u((char *)pBuf); free(pBuf); } -#else - res = (char *)pBuf; -#endif + return res; } } if ( ((DWORD)(linePos+(pCur-pBuf)) == fileSz) ) { // eof CloseHandle(hFile); -#ifdef UNICODE + if (tUC) { res = (TCHAR *)pBuf; } @@ -861,9 +853,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) { res = a2u((char *)pBuf); free(pBuf); } -#else - res = (char *)pBuf; -#endif + return res; } if (readSz == bufSz-csz) { @@ -964,11 +954,9 @@ static TCHAR *parseClipboard(ARGUMENTSINFO *ai) { HANDLE hData = NULL; TCHAR* tszText = NULL; int len = 0; -#ifdef _UNICODE + hData = GetClipboardData(CF_UNICODETEXT); -#else - hData = GetClipboardData(CF_TEXT); -#endif + if (hData != NULL) { tszText = (TCHAR*)GlobalLock(hData); len = _tcslen(tszText); -- cgit v1.2.3