summaryrefslogtreecommitdiff
path: root/plugins/Updater
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 17:42:08 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 17:42:08 +0000
commit5975b2d0903bd5df128d55e20cd27d7c13b4e46c (patch)
tree6696492511c591fa8bf3b65a64864245caa3e7c2 /plugins/Updater
parent8617d7e00546f892c9084f7c382648b23d8bbb63 (diff)
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Updater')
-rw-r--r--plugins/Updater/allocations.h6
-rw-r--r--plugins/Updater/common.h4
-rw-r--r--plugins/Updater/extern.cpp10
-rw-r--r--plugins/Updater/options.cpp11
-rw-r--r--plugins/Updater/scan.cpp10
-rw-r--r--plugins/Updater/updater.cpp35
-rw-r--r--plugins/Updater/utils.cpp2
7 files changed, 16 insertions, 62 deletions
diff --git a/plugins/Updater/allocations.h b/plugins/Updater/allocations.h
index 719b42383a..25d98c21f7 100644
--- a/plugins/Updater/allocations.h
+++ b/plugins/Updater/allocations.h
@@ -53,11 +53,9 @@ __inline static wchar_t *safe_wstrdup(const wchar_t *s) {
return ret;
}
-#ifdef _UNICODE
+
#define safe_tstrdup(x) safe_wstrdup(x)
-#else
-#define sage_tstrdup(x) safe_strdup(x)
-#endif
+
__inline static BYTE *safe_bytedup(BYTE *bytes, int size) {
if (!bytes || size == 0) return 0;
diff --git a/plugins/Updater/common.h b/plugins/Updater/common.h
index d51a1db85b..4b7c930bc2 100644
--- a/plugins/Updater/common.h
+++ b/plugins/Updater/common.h
@@ -127,9 +127,9 @@ void* memmem (const void *buf1, size_t size1, const void *buf2, size_t size2);
void NLog(char *msg);
void NLogF(const char *fmt, ...);
-#ifdef _UNICODE
+
void NLog(wchar_t *msg);
-#endif
+
// clist 'exit' menu item command id
#define ID_ICQ_EXIT 40001
diff --git a/plugins/Updater/extern.cpp b/plugins/Updater/extern.cpp
index 500c11c9de..3e97fc1ec4 100644
--- a/plugins/Updater/extern.cpp
+++ b/plugins/Updater/extern.cpp
@@ -313,17 +313,7 @@ bool ReadTLine(HANDLE hDatFile, TCHAR *line, int bsize, int &offset) {
BOOL bResult;
while((bResult = ReadFile(hDatFile, line + offset, sizeof(TCHAR), &bytes_read, 0)) && offset < bsize && bytes_read == sizeof(TCHAR) && line[offset] && (line[offset] != _T('\n') || (offset > 0 && line[offset - 1] != _T('\r')))) offset++;
-#ifndef _UNICODE
- if(offset == 1 && line[1] == 0) {
- wchar_t wline[MAX_PATH];
- wline[0] = *(wchar_t *)line;
- while((bResult = ReadFile(hDatFile, wline + offset, sizeof(wchar_t), &bytes_read, 0)) && offset < bsize && bytes_read == sizeof(wchar_t) && wline[offset] && (wline[offset] != L'\n' || (offset > 0 && wline[offset - 1] != L'\r'))) offset++;
- if(offset > 0) wline[offset - 1] = 0; // cut off /r/n
-
- WideCharToMultiByte(CP_ACP, 0, wline, -1, line, bsize, 0, 0);
- }
-#endif
if(offset > 0) line[offset - 1] = 0; // cut off /r/n
return true;
}
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp
index 7539ce2047..1c4545d76e 100644
--- a/plugins/Updater/options.cpp
+++ b/plugins/Updater/options.cpp
@@ -389,13 +389,10 @@ int OptInit(WPARAM wParam,LPARAM lParam)
return 0;
}
-#ifdef _UNICODE
+
#define DBGetString DBGetContactSettingTString
#define DBWriteString DBWriteContactSettingTString
-#else
-#define DBGetString DBGetContactSetting
-#define DBWriteString DBWriteContactSettingString
-#endif
+
void InitOptionsMenuItems() {
if(options.restart_menu_item)
@@ -451,9 +448,9 @@ void LoadOptions(void)
{
FOLDERSDATA fd = {0};
fd.cbSize = sizeof(fd);
-#ifdef _UNICODE
+
fd.flags = FF_UNICODE;
-#endif
+
strcpy(fd.szSection, "Updates");
strcpy(fd.szName, "Backups");
diff --git a/plugins/Updater/scan.cpp b/plugins/Updater/scan.cpp
index ad8fa165e2..ddae89dc43 100644
--- a/plugins/Updater/scan.cpp
+++ b/plugins/Updater/scan.cpp
@@ -15,11 +15,9 @@ static const AlternateShortName alternate_shortname_map[] =
{ "Version Informations", "Version Information" },
{ "Jabber Protocol", "JabberG Protocol" },
{ "Jabber Protocol (Unicode)", "JabberG Protocol (Unicode)" },
-#ifdef _UNICODE
+
{ "PopUp Interoperability", "PopUp Plus (Unicode)" },
-#else
- { "PopUp Interoperability", "PopUp Plus" },
-#endif
+
//{ "Messaging Style Conversation", "nConvers++" }, // will this conflict with other nConvers'?
{ "MimQQ-libeva", "MirandaQQ (libeva Version)" },
@@ -35,14 +33,14 @@ char* findAlternateShortName(const char* name)
if (strcmp(name, alternate_shortname_map[i].from) == 0)
return mir_strdup(alternate_shortname_map[i].to);
}
-#ifdef _UNICODE
+
if (!strstr(name, "Unicode"))
{
char *buf = (char*)mir_alloc(256);
mir_snprintf(buf, 256, "%s (Unicode)", name);
return buf;
}
-#endif
+
return NULL;
}
diff --git a/plugins/Updater/updater.cpp b/plugins/Updater/updater.cpp
index 69abd97330..531689e5d1 100644
--- a/plugins/Updater/updater.cpp
+++ b/plugins/Updater/updater.cpp
@@ -86,17 +86,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
update.cpbVersion = strlen((char *)update.pbVersion);
-#ifdef _UNICODE
+
update.szUpdateURL = BETA_HOST_URL_PREFIX "/ver_updater_unicode.zip";
update.szVersionURL = BETA_HOST_URL_PREFIX "/updater_unicode.html";
update.pbVersionPrefix = (BYTE *)"Updater (Unicode) version ";
update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
-#else //!_UNICODE
- update.szUpdateURL = BETA_HOST_URL_PREFIX "/updater.zip";
- update.szVersionURL = BETA_HOST_URL_PREFIX "/ver_updater.html";
- update.pbVersionPrefix = (BYTE *)"Updater version ";
- update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
-#endif //_UNICODE
CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
@@ -115,7 +109,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
update.szBetaChangelogURL = "https://server.scottellis.com.au/wsvn/mim_plugs/updater/?op=log&rev=0&sc=0&isdir=1";
-#ifdef _UNICODE
+
#ifdef REGISTER_AUTO
update.szUpdateURL = UPDATER_AUTOREGISTER;
@@ -134,35 +128,14 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
update.szBetaVersionURL = BETA_HOST_URL_PREFIX "/ver_updater_unicode.html";
update.pbBetaVersionPrefix = (BYTE *)"Updater (Unicode) version ";
update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix);
-#else
-
-#ifdef REGISTER_AUTO
- update.szUpdateURL = UPDATER_AUTOREGISTER;
-#else //!REGISTER_AUTO
- update.szUpdateURL = MIM_DOWNLOAD_URL_PREFIX "2254";
- update.szVersionURL = MIM_VIEW_URL_PREFIX "2254";
- update.pbVersionPrefix = (BYTE *)"<span class=\"fileNameHeader\">Updater ";
- update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
-#endif //REGISTER_AUTO
-#ifdef _WIN64
- update.szBetaUpdateURL = BETA_HOST_URL_PREFIX "/updater_x64.zip";
-#else
- update.szBetaUpdateURL = BETA_HOST_URL_PREFIX "/updater.zip";
-#endif
- update.szBetaVersionURL = BETA_HOST_URL_PREFIX "/ver_updater.html";
- update.pbBetaVersionPrefix = (BYTE *)"Updater version ";
- update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix);
-#endif
CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
#else // !REGISTER_BETA
-#ifdef _UNICODE
+
CallService(MS_UPDATE_REGISTERFL, (WPARAM)2596, (LPARAM)&pluginInfo);
-#else //!_UNICODE
- CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
-#endif //_UNICODE
+
#endif // REGISTER_BETA
diff --git a/plugins/Updater/utils.cpp b/plugins/Updater/utils.cpp
index 6936a905ae..b2d6b8d982 100644
--- a/plugins/Updater/utils.cpp
+++ b/plugins/Updater/utils.cpp
@@ -238,11 +238,9 @@ void NLogF(const char *fmt, ...)
}
-#ifdef _UNICODE
void NLog(wchar_t *msg)
{
char* a = mir_utf8encodeW(msg);
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)a);
mir_free(a);
}
-#endif \ No newline at end of file