diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
commit | 05c989e58aeffcfb59cebaca6797cb69dd25cb1e (patch) | |
tree | 460bde28df51ea7b01109b56818b5880ac47ba66 /plugins/Variables/parse_system.cpp | |
parent | ac7bf920f219a7aed7eb163c8b3195e66c12e4da (diff) |
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/parse_system.cpp')
-rw-r--r-- | plugins/Variables/parse_system.cpp | 36 |
1 files changed, 12 insertions, 24 deletions
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);
|