From f8a58bee25b77af07a938cfdf71bdc00c0446b0a Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Mon, 24 Feb 2014 14:53:26 +0000 Subject: removed some unneeded translations git-svn-id: http://svn.miranda-ng.org/main/trunk@8257 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AssocMgr/src/assoclist.cpp | 101 +++++++++------------ plugins/AssocMgr/src/dde.cpp | 41 +++------ plugins/AssocMgr/src/main.cpp | 4 +- plugins/AssocMgr/src/reg.cpp | 35 +++---- plugins/AssocMgr/src/test.cpp | 3 +- plugins/AutoRun/src/main.cpp | 4 +- plugins/BasicHistory/src/ExportManager.cpp | 2 +- plugins/BasicHistory/src/Options.cpp | 2 +- plugins/Clist_modern/src/modern_rowtemplateopt.cpp | 4 +- plugins/CmdLine/MimCmd/src/commands.cpp | 6 +- plugins/CmdLine/src/hooked_events.cpp | 6 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 41 ++++----- plugins/LangMan/src/options.cpp | 26 +++--- plugins/Weather/src/weather.h | 2 +- 14 files changed, 114 insertions(+), 163 deletions(-) (limited to 'plugins') diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 38810f1675..a1dce06bdf 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -171,10 +171,8 @@ void CleanupMimeTypeAddedSettings(void) static UINT nNotifyTimerID; /* protected by csNotifyTimer */ static CRITICAL_SECTION csNotifyTimer; -static void CALLBACK NotifyTimerProc(HWND hwnd, UINT msg, UINT_PTR nTimerID, DWORD dwTime) +static void CALLBACK NotifyTimerProc(HWND hwnd, UINT, UINT_PTR nTimerID, DWORD) { - UNREFERENCED_PARAMETER(msg); - UNREFERENCED_PARAMETER(dwTime); EnterCriticalSection(&csNotifyTimer); KillTimer(hwnd, nTimerID); if(nNotifyTimerID == nTimerID) /* might be stopped previously */ @@ -272,8 +270,10 @@ static int ReplaceImageListAssocIcon(HIMAGELIST himl, const ASSOCDATA *assoc, in static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc) { static TCHAR szDesc[32]; - if(assoc->pszFileExt == NULL) mir_sntprintf(szDesc, SIZEOF(szDesc), TranslateT("%hs:"), assoc->pszClassName); - else mir_sntprintf(szDesc, SIZEOF(szDesc), TranslateT("%hs files"), assoc->pszFileExt); + if(assoc->pszFileExt == NULL) + mir_sntprintf(szDesc, SIZEOF(szDesc), _T("%hs:"), assoc->pszClassName); + else + mir_sntprintf(szDesc, SIZEOF(szDesc), TranslateT("%hs files"), assoc->pszFileExt); return szDesc; } @@ -281,13 +281,12 @@ static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc) static BOOL IsAssocRegistered(const ASSOCDATA *assoc) { BOOL fSuccess = FALSE, fIsUrl, fUseMainCmdLine; - TCHAR *pszRunCmd; fIsUrl = (assoc->pszFileExt == NULL); fUseMainCmdLine = (assoc->pszService == NULL); /* class */ - pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine); + TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine); if(pszRunCmd!= NULL) fSuccess = IsRegClass(assoc->pszClassName, pszRunCmd); mir_free(pszRunCmd); /* does NULL check */ @@ -348,13 +347,13 @@ static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc) static BOOL UnregisterAssoc(const ASSOCDATA *assoc) { BOOL fIsUrl, fUseMainCmdLine; - TCHAR *pszAppFileName, *pszRunCmd; + TCHAR *pszAppFileName; fIsUrl = (assoc->pszFileExt == NULL); fUseMainCmdLine = (assoc->pszService == NULL); /* class might have been registered by another instance */ - pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine); + TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine); if(pszRunCmd!= NULL && !IsRegClass(assoc->pszClassName, pszRunCmd)) { mir_free(pszRunCmd); return TRUE; /* succeed anyway */ @@ -399,11 +398,10 @@ typedef struct { static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, char *pszFileExt, TCHAR *pszVerbDesc, char *pszMimeType) { ASSOCDATA *pAssocListBuf, *assoc; - int index; /* is already in list? */ EnterCriticalSection(&csAssocList); - index = FindAssocItem(pszClassName); + int index = FindAssocItem(pszClassName); if(index!= -1) return FALSE; /* resize storage array */ @@ -447,11 +445,10 @@ static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, static BOOL RemoveAssocItem_Worker(const char *pszClassName) { ASSOCDATA *pAssocListBuf, *assoc; - int index; /* find index */ EnterCriticalSection(&csAssocList); - index = FindAssocItem(pszClassName); + int index = FindAssocItem(pszClassName); if(index == -1) { LeaveCriticalSection(&csAssocList); return FALSE; @@ -509,13 +506,10 @@ static INT_PTR ServiceAddNewFileType(WPARAM, LPARAM lParam) return 3; } -static INT_PTR ServiceRemoveFileType(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceRemoveFileType(WPARAM, LPARAM lParam) { - char *pszClassName; - UNREFERENCED_PARAMETER(wParam); - if ((char*)lParam == NULL) return 2; - pszClassName = MakeFileClassName((char*)lParam); + char *pszClassName = MakeFileClassName((char*)lParam); if(pszClassName!= NULL) if(RemoveAssocItem_Worker(pszClassName)) { mir_free(pszClassName); @@ -525,11 +519,9 @@ static INT_PTR ServiceRemoveFileType(WPARAM wParam, LPARAM lParam) return 3; } -static INT_PTR ServiceAddNewUrlType(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceAddNewUrlType(WPARAM, LPARAM lParam) { const URLTYPEDESC *utd = (URLTYPEDESC*)lParam; - char *pszClassName; - UNREFERENCED_PARAMETER(wParam); if(utd->cbSize < sizeof(URLTYPEDESC)) return 1; @@ -538,7 +530,7 @@ static INT_PTR ServiceAddNewUrlType(WPARAM wParam, LPARAM lParam) if(utd->pszProtoPrefix == NULL || utd->pszProtoPrefix[lstrlenA(utd->pszProtoPrefix)-1]!= ':') return 2; - pszClassName = MakeUrlClassName(utd->pszProtoPrefix); + char *pszClassName = MakeUrlClassName(utd->pszProtoPrefix); if(pszClassName!= NULL) if(AddNewAssocItem_Worker(pszClassName, (TYPEDESCHEAD*)utd, NULL, NULL, NULL)) /* no need to free pszClassName, as its @@ -548,13 +540,10 @@ static INT_PTR ServiceAddNewUrlType(WPARAM wParam, LPARAM lParam) return 3; } -static INT_PTR ServiceRemoveUrlType(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceRemoveUrlType(WPARAM, LPARAM lParam) { - char *pszClassName; - UNREFERENCED_PARAMETER(wParam); - if ((char*)lParam == NULL) return 2; - pszClassName = MakeUrlClassName((char*)lParam); + char *pszClassName = MakeUrlClassName((char*)lParam); if(pszClassName!= NULL) if(RemoveAssocItem_Worker(pszClassName)) { mir_free(pszClassName); @@ -570,17 +559,15 @@ static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam { void *pvParam; char *pszService; - int index; - ASSOCDATA *assoc; /* find it in list */ EnterCriticalSection(&csAssocList); - index = FindAssocItem(pszClassName); + int index = FindAssocItem(pszClassName); if(index == -1) { LeaveCriticalSection(&csAssocList); return FALSE; } - assoc = &pAssocList[index]; + ASSOCDATA *assoc = &pAssocList[index]; /* no service specified? correct registry to use main commandline */ if(assoc->pszService == NULL) { EnsureAssocRegistered(assoc); @@ -606,11 +593,10 @@ static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam INT_PTR InvokeFileHandler(const TCHAR *pszFileName) { char *pszClassName, *pszFileExt; - TCHAR *p; INT_PTR res = CALLSERVICE_NOTFOUND; /* find extension */ - p = (TCHAR*)_tcsrchr(pszFileName, _T('.')); + TCHAR *p = (TCHAR*)_tcsrchr(pszFileName, _T('.')); if(p!= NULL) { pszFileExt = t2a(p); if(pszFileExt!= NULL) { @@ -675,14 +661,14 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara { switch(msg) { case WM_INITDIALOG: - { HWND hwndList; + { HIMAGELIST himl; LVITEM lvi; ASSOCDATA *assoc; int i; TranslateDialogDefault(hwndDlg); CoInitialize(NULL); - hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); + HWND hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); ListView_SetUnicodeFormat(hwndList, TRUE); @@ -778,12 +764,11 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara } case WM_SETTINGCHANGE: case M_REFRESH_ICONS: - { LVITEM lvi; - HIMAGELIST himl; + { + LVITEM lvi; ASSOCDATA *assoc; - HWND hwndList; - hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); - himl = ListView_GetImageList(hwndList, LVSIL_SMALL); + HWND hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); + HIMAGELIST himl = ListView_GetImageList(hwndList, LVSIL_SMALL); /* enum items */ lvi.iSubItem = 0; lvi.mask = LVIF_PARAM|LVIF_IMAGE; @@ -826,12 +811,14 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara return TRUE; case WM_NOTIFY: - { NMHDR *nmhdr = (NMHDR*)lParam; + { + NMHDR *nmhdr = (NMHDR*)lParam; switch(nmhdr->idFrom) { case IDC_ASSOCLIST: switch(nmhdr->code) { case LVN_DELETEITEM: /* also called on WM_DESTROY */ - { LVITEM lvi; + { + LVITEM lvi; lvi.mask = LVIF_PARAM; lvi.iSubItem = 0; lvi.iItem = ((NMLISTVIEW*)lParam)->iItem; @@ -852,7 +839,8 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara * bug should not be present using WinVista and higher */ switch(((NMLVKEYDOWN*)lParam)->wVKey) { case VK_UP: - { LVITEM lvi; + { + LVITEM lvi; lvi.iSubItem = 0; lvi.mask = LVIF_PARAM; lvi.iItem = ListView_GetNextItem(nmhdr->hwndFrom, -1, LVNI_FOCUSED); @@ -868,7 +856,8 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara break; } case VK_PRIOR: - { LVITEM lvi; + { + LVITEM lvi; lvi.iSubItem = 0; lvi.mask = LVIF_PARAM; lvi.iItem = ListView_GetNextItem(nmhdr->hwndFrom, -1, LVNI_FOCUSED); @@ -891,7 +880,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch(nmhdr->code) { case PSN_APPLY: - { HWND hwndList; + { LVITEM lvi; BOOL fEnabled, fRegFailed = FALSE; ASSOCDATA *assoc; @@ -900,7 +889,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara db_set_b(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING)!= 0)); /* save enabled assoc items */ - hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); + HWND hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST); lvi.iSubItem = 0; lvi.mask = LVIF_PARAM; EnterCriticalSection(&csAssocList); @@ -912,8 +901,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara /* re-register registery keys */ if(fEnabled?!EnsureAssocRegistered(assoc):!UnregisterAssoc(assoc)) { - char *pszErr; - pszErr = GetWinErrorDescription(GetLastError()); + char *pszErr = GetWinErrorDescription(GetLastError()); ShowInfoMessage(NIIF_ERROR, Translate("File association error"), Translate("There was an error writing to the registry to modify the file/url associations.\nReason: %s"), (pszErr!= NULL)?pszErr:Translate("Unknown")); mir_free(pszErr); /* does NULL check */ fRegFailed = TRUE; /* just show one time */ @@ -922,11 +910,9 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara LeaveCriticalSection(&csAssocList); NotifyAssocChange(TRUE); PostMessage(hwndDlg, M_REFRESH_ICONS, 0, 0); - if(fRegFailed) { - } /* autostart */ - { TCHAR *pszRunCmd; - pszRunCmd = MakeRunCommand(TRUE, TRUE); + { + TCHAR *pszRunCmd = MakeRunCommand(TRUE, TRUE); fRegFailed = FALSE; if(pszRunCmd!= NULL) { fEnabled = IsDlgButtonChecked(hwndDlg, IDC_AUTOSTART); @@ -951,7 +937,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara return FALSE; } -static int AssocListOptInit(WPARAM wParam, LPARAM lParam) +static int AssocListOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.hInstance = hInst; @@ -992,7 +978,8 @@ void InitAssocList(void) InitializeCriticalSection(&csNotifyTimer); /* register open-with app */ - { TCHAR *pszAppFileName, *pszIconLoc, *pszRunCmd; + { + TCHAR *pszAppFileName, *pszIconLoc, *pszRunCmd; pszIconLoc = MakeIconLocation(NULL, 0); // miranda32.exe @@ -1014,7 +1001,8 @@ void InitAssocList(void) } /* default items */ - { FILETYPEDESC ftd; + { + FILETYPEDESC ftd; ftd.cbSize = sizeof(FILETYPEDESC); ftd.pszFileExt = ".dat"; ftd.pszMimeType = NULL; @@ -1032,7 +1020,6 @@ void UninitAssocList(void) { BYTE fOnlyWhileRunning; ASSOCDATA *assoc; - int i; /* Options */ UnhookEvent(hHookOptInit); @@ -1045,7 +1032,7 @@ void UninitAssocList(void) /* Assoc List */ fOnlyWhileRunning = db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT); - for(i = 0;itype == 0) mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL?TranslateT("column"):TranslateT("line")); else - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s"), TranslateTS(types[cell->type])); + mir_sntprintf(buf, SIZEOF(buf), _T("%s"), TranslateTS(types[cell->type])); } else { if (cell->type == 0) - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s"), cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines")); + mir_sntprintf(buf, SIZEOF(buf), _T("%s"), cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines")); else mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]),cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines")); } diff --git a/plugins/CmdLine/MimCmd/src/commands.cpp b/plugins/CmdLine/MimCmd/src/commands.cpp index f562e8948b..eba3893763 100644 --- a/plugins/CmdLine/MimCmd/src/commands.cpp +++ b/plugins/CmdLine/MimCmd/src/commands.cpp @@ -139,8 +139,7 @@ void HandleHelpCommand(PCommand helpCommand, char *argv[], int argc, PReply repl reply->code = MIMRES_SUCCESS; STRNCPY(reply->message, Translate("Available commands: "), size); - int i; - for (i = 0; i < cKnownCommands - 1; i++) + for (int i = 0; i < cKnownCommands - 1; i++) { strncat(reply->message, knownCommands[i].command, size); strncat(reply->message, ", ", size); @@ -173,8 +172,7 @@ PReply ParseCommand(char *argv[], int argc) void FillSharedDataStruct(PCommand command, char *arguments[], int count) { - int i; - for (i = 0; i < count; i++) + for (int i = 0; i < count; i++) { STRNCPY(sdCmdLine->arguments[i], arguments[i], ARGUMENT_SIZE); } diff --git a/plugins/CmdLine/src/hooked_events.cpp b/plugins/CmdLine/src/hooked_events.cpp index 6ccac9080a..3226b659b4 100644 --- a/plugins/CmdLine/src/hooked_events.cpp +++ b/plugins/CmdLine/src/hooked_events.cpp @@ -66,8 +66,7 @@ int OnShutdown(WPARAM wParam, LPARAM lParam) int QueueAck(ACKDATA *ack) { - int i; - for (i = cAcks - 1; i > 0; i--) + for (int i = cAcks - 1; i > 0; i--) { acks[i] = acks[i - 1]; } @@ -86,8 +85,7 @@ int ClearAckQueue() ACKDATA *GetAck(HANDLE hProcess) { - int i; - for (i = 0; i < cAcks; i++) + for (int i = 0; i < cAcks; i++) { if (acks[i].hProcess == hProcess) { diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 866c319b88..5b4eb32537 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1355,7 +1355,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r if (ParseDatabaseData(&var, buffer, sizeof(buffer), TRUE)) { reply->code = MIMRES_SUCCESS; - mir_snprintf(reply->message, reply->cMessage, Translate("'%s/%s' - %s."), module, key, buffer); + mir_snprintf(reply->message, reply->cMessage, "'%s/%s' - %s.", module, key, buffer); } else{ reply->code = MIMRES_FAILURE; @@ -1397,23 +1397,17 @@ int ParseProxyType(char *type) { proxy = PROXY_SOCKS4; } - else{ - if (strcmp(lower, "socks5") == 0) - { - proxy = PROXY_SOCKS5; - } - else{ - if (strcmp(lower, "http") == 0) - { - proxy = PROXY_HTTP; - } - else{ - if (strcmp(lower, "https") == 0) - { - proxy = PROXY_HTTPS; - } - } - } + else if (strcmp(lower, "socks5") == 0) + { + proxy = PROXY_SOCKS5; + } + else if (strcmp(lower, "http") == 0) + { + proxy = PROXY_HTTP; + } + else if (strcmp(lower, "https") == 0) + { + proxy = PROXY_HTTPS; } return proxy; @@ -1554,11 +1548,9 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe { case 4: { - char host[256]; - int port; - char type[256]; + char host[256], type[256]; GetStringFromDatabase(NULL, module, "NLProxyServer", "", host, sizeof(host)); - port = db_get_w(NULL, module, "NLProxyPort", 0); + int port = db_get_w(NULL, module, "NLProxyPort", 0); PrettyProxyType(db_get_b(NULL, module, "NLProxyType", 0), type, sizeof(type)); reply->code = MIMRES_SUCCESS; @@ -1760,8 +1752,7 @@ DWORD WINAPI OpenMessageWindowThread(void *data) MCONTACT hContact = (MCONTACT) data; if (hContact) { - CallServiceSync(MS_MSG_SENDMESSAGE, hContact, 0); - CallServiceSync("SRMsg/LaunchMessageWindow", hContact, 0); + CallServiceSync(MS_MSG_SENDMESSAGET, hContact, 0); } return 0; @@ -2149,7 +2140,7 @@ void HandleIgnoreCommand(PCommand command, TArgument *argv, int argc, PReply rep if (hContact) { - CallService(block ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, hContact, IGNOREEVENT_ALL); + CallService(block ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, (WPARAM) hContact, IGNOREEVENT_ALL); } } diff --git a/plugins/LangMan/src/options.cpp b/plugins/LangMan/src/options.cpp index 809592c6d8..17a1c321ea 100644 --- a/plugins/LangMan/src/options.cpp +++ b/plugins/LangMan/src/options.cpp @@ -67,8 +67,7 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) HBITMAP hbmMono, hbmPrevMono; RECT rcRadio; COLORREF clrPrevText, clrPrevBk; - HBRUSH hbrBk; - hbrBk = CreateSolidBrush(clrBk); + HBRUSH hbrBk = CreateSolidBrush(clrBk); if (hbrBk!=NULL) { FillRect(hdc, &rc, hbrBk); DeleteObject(hbrBk); @@ -133,7 +132,6 @@ static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) static void CleanupPluginName(char *szShortName) { char *p; - int len; /* strip-off anything in brackets */ for(p = szShortName;*p!='\0';++p) if (*p == '(' || *p == '[') { @@ -141,21 +139,17 @@ static void CleanupPluginName(char *szShortName) break; } /* remove trailing space */ - len = lstrlenA(szShortName); + int len = lstrlenA(szShortName); while(szShortName[0]!='\0' && szShortName[len-1] == ' ') szShortName[--len] = 0; } static void DisplayNotIncludedPlugins(HWND hwndListBox, const LANGPACK_INFO *pack) { - WIN32_FIND_DATA wfd; - HANDLE hFind; TCHAR szSearch[MAX_PATH], szDir[MAX_PATH], *p; - HMODULE hModule; BOOL fNeedsFree; char buf[128]; TCHAR buf2[128]; - DWORD mirandaVersion; PLUGININFOEX *pluginInfo; PLUGININFOEX *(__cdecl *MirandaPluginInfo)(DWORD); @@ -163,10 +157,12 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox, const LANGPACK_INFO *pac if (!(pack->flags&LPF_DEFAULT) && GetModuleFileName(NULL, szDir, SIZEOF(szDir))) { p = _tcsrchr(szDir, _T('\\')); if (p!=NULL) *p = _T('\0'); + TCHAR szSearch[MAX_PATH]; mir_sntprintf(szSearch, SIZEOF(szSearch), _T("%s\\Plugins\\*.dll"), szDir); - hFind = FindFirstFile(szSearch, &wfd); + WIN32_FIND_DATA wfd; + HANDLE hFind = FindFirstFile(szSearch, &wfd); if (hFind!=INVALID_HANDLE_VALUE) { - mirandaVersion = CallService(MS_SYSTEM_GETVERSION, 0, 0); + DWORD mirandaVersion = CallService(MS_SYSTEM_GETVERSION, 0, 0); SendMessage(hwndListBox, LB_SETLOCALE, CallService(MS_LANGPACK_GETLOCALE, 0, 0), 0); /* for sort order */ SendMessage(hwndListBox, LB_INITSTORAGE, 128, lstrlenA(pack->szPluginsIncluded)); /* speed up */ do { @@ -177,15 +173,17 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox, const LANGPACK_INFO *pac p = _tcsrchr(szSearch, _T('.')); if (p!=NULL) *p = _T('\0'); - { char cFileNameA[MAX_PATH]; + { + char cFileNameA[MAX_PATH]; cFileNameA[0] = '\0'; WideCharToMultiByte(CP_ACP, 0, szSearch, -1, cFileNameA, sizeof(cFileNameA), NULL, NULL); - if (IsPluginIncluded(pack, cFileNameA)) continue; + if (IsPluginIncluded(pack, cFileNameA)) + continue; } /* friendly name of the plugin */ mir_sntprintf(szSearch, SIZEOF(szSearch), _T("%s\\Plugins\\%s"), szDir, wfd.cFileName); - hModule = GetModuleHandle(szSearch); + HMODULE hModule = GetModuleHandle(szSearch); fNeedsFree = (hModule == NULL); if (hModule == NULL) { hModule = LoadLibrary(szSearch); @@ -198,7 +196,7 @@ static void DisplayNotIncludedPlugins(HWND hwndListBox, const LANGPACK_INFO *pac if (pluginInfo!=NULL && pluginInfo->cbSize >= sizeof(PLUGININFOEX) && pluginInfo->shortName!=NULL) { lstrcpynA(buf, pluginInfo->shortName, sizeof(buf)); /* buffer safe */ CleanupPluginName(buf); - mir_sntprintf(buf2, SIZEOF(buf2), TranslateT("%hs (%s)"), buf, CharLower(wfd.cFileName)); + mir_sntprintf(buf2, SIZEOF(buf2), _T("%hs (%s)"), buf, CharLower(wfd.cFileName)); SendMessage(hwndListBox, LB_ADDSTRING, 0, (LPARAM)buf2); } } diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 44952fa752..3f1d9fd286 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -148,7 +148,7 @@ along with this program. If not, see . // 505 HTTP Version Not Supported // defaults constants -#define C_DEFAULT TranslateT("%n [%t, %c]") +#define C_DEFAULT _T("%n [%t, %c]") #define N_DEFAULT TranslateT("%c\nTemperature: %t\nFeel-Like: %f\nPressure: %p\nWind: %i %w\nHumidity: %m\nDew Point: %e\nVisibility: %v\n\nSun Rise: %r\nSun Set: %y\n\n5 Days Forecast:\n%[Forecast Day 1]\n%[Forecast Day 2]\n%[Forecast Day 3]\n%[Forecast Day 4]\n%[Forecast Day 5]") #define B_DEFAULT TranslateT("Feel-Like: %f\nPressure: %p\nWind: %i %w\nHumidity: %m\nDew Point: %e\nVisibility: %v\n\nSun Rise: %r\nSun Set: %y\n\n5 Days Forecast:\n%[Forecast Day 1]\n%[Forecast Day 2]\n%[Forecast Day 3]\n%[Forecast Day 4]\n%[Forecast Day 5]") #define b_DEFAULT TranslateT("Weather Condition for %n as of %u") -- cgit v1.2.3