From 37a022d37e79dbe9892f376ef7c3b6b8878c4aff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 18 May 2018 20:40:44 +0300 Subject: hLangpack variable began migration inside CMPluginBase it remains existing for now, but as reference to g_plugin.m_hLang --- src/core/stdautoaway/src/main.cpp | 2 +- src/core/stdaway/src/main.cpp | 2 +- src/core/stdclist/src/init.cpp | 2 +- src/core/stdcrypt/src/main.cpp | 2 +- src/core/stdemail/src/main.cpp | 2 +- src/core/stdfile/src/main.cpp | 2 +- src/core/stdidle/src/main.cpp | 2 +- src/core/stdmsg/src/srmm.cpp | 2 +- src/core/stdssl/src/main.cpp | 2 +- src/core/stduihist/src/main.cpp | 2 +- src/core/stduserinfo/src/main.cpp | 2 +- src/core/stduseronline/src/main.cpp | 2 +- src/mir_app/src/CMPluginBase.cpp | 4 ++++ src/mir_app/src/miranda.cpp | 2 +- src/mir_core/src/icons.cpp | 4 ++-- src/mir_core/src/miranda.cpp | 1 - src/mir_core/src/modules.cpp | 2 ++ 17 files changed, 21 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/core/stdautoaway/src/main.cpp b/src/core/stdautoaway/src/main.cpp index cae20cf28f..e3270fd02d 100644 --- a/src/core/stdautoaway/src/main.cpp +++ b/src/core/stdautoaway/src/main.cpp @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadAutoAwayModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdaway/src/main.cpp b/src/core/stdaway/src/main.cpp index 4ea617bc4e..8d05a682fd 100644 --- a/src/core/stdaway/src/main.cpp +++ b/src/core/stdaway/src/main.cpp @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadAwayMsgModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index 63bf340448..7ac6277971 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CMPlugin g_plugin; CLIST_INTERFACE* pcli = nullptr, coreCli; HIMAGELIST himlCListClc = nullptr; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); ///////////////////////////////////////////////////////////////////////////////////////// // external functions diff --git a/src/core/stdcrypt/src/main.cpp b/src/core/stdcrypt/src/main.cpp index 9633341f8c..4a295603fa 100644 --- a/src/core/stdcrypt/src/main.cpp +++ b/src/core/stdcrypt/src/main.cpp @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadEncryptionModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdemail/src/main.cpp b/src/core/stdemail/src/main.cpp index b767444bda..6da780ed8b 100644 --- a/src/core/stdemail/src/main.cpp +++ b/src/core/stdemail/src/main.cpp @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadSendRecvEMailModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdfile/src/main.cpp b/src/core/stdfile/src/main.cpp index 36ef0dcfdc..3e50600c14 100644 --- a/src/core/stdfile/src/main.cpp +++ b/src/core/stdfile/src/main.cpp @@ -26,7 +26,7 @@ int LoadSendRecvFileModule(void); CMPlugin g_plugin; CLIST_INTERFACE* pcli; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); ITaskbarList3 * pTaskbarInterface; diff --git a/src/core/stdidle/src/main.cpp b/src/core/stdidle/src/main.cpp index fa6340963f..0131b4a427 100644 --- a/src/core/stdidle/src/main.cpp +++ b/src/core/stdidle/src/main.cpp @@ -26,7 +26,7 @@ void UnloadIdleModule(void); CMPlugin g_plugin; CLIST_INTERFACE* pcli; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 6d283102d6..183e2bcf08 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -27,7 +27,7 @@ void SplitmsgShutdown(void); CMPlugin g_plugin; CLIST_INTERFACE *pcli; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stdssl/src/main.cpp b/src/core/stdssl/src/main.cpp index 6fb8898d70..5fab770f9f 100644 --- a/src/core/stdssl/src/main.cpp +++ b/src/core/stdssl/src/main.cpp @@ -25,7 +25,7 @@ int LoadSslModule(void); void UnloadSslModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stduihist/src/main.cpp b/src/core/stduihist/src/main.cpp index c56c0bdabe..bcf31573ce 100644 --- a/src/core/stduihist/src/main.cpp +++ b/src/core/stduihist/src/main.cpp @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadHistoryModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stduserinfo/src/main.cpp b/src/core/stduserinfo/src/main.cpp index ac767568d5..6e8b25f981 100644 --- a/src/core/stduserinfo/src/main.cpp +++ b/src/core/stduserinfo/src/main.cpp @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadUserInfoModule(void); CMPlugin g_plugin; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/core/stduseronline/src/main.cpp b/src/core/stduseronline/src/main.cpp index 3273f7f579..027eba4d7b 100644 --- a/src/core/stduseronline/src/main.cpp +++ b/src/core/stduseronline/src/main.cpp @@ -25,7 +25,7 @@ int LoadUserOnlineModule(void); CMPlugin g_plugin; CLIST_INTERFACE* pcli; -int hLangpack; +int &hLangpack(g_plugin.m_hLang); PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 3c6cc3da85..6fc1b0c689 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -47,6 +47,8 @@ void CMPluginBase::tryOpenLog() m_hLogger = mir_createLog(m_szModuleName, nullptr, path, 0); } +///////////////////////////////////////////////////////////////////////////////////////// + void CMPluginBase::debugLogA(LPCSTR szFormat, ...) { if (m_hLogger == nullptr) @@ -69,6 +71,8 @@ void CMPluginBase::debugLogW(LPCWSTR wszFormat, ...) va_end(args); } +///////////////////////////////////////////////////////////////////////////////////////// + void CMPluginBase::RegisterProtocol(int type, pfnInitProto fnInit, pfnUninitProto fnUninit) { if (type == PROTOTYPE_PROTOCOL && fnInit != nullptr) diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index ddb648ad60..bf212c1c76 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -55,7 +55,7 @@ bool bModulesLoadedFired = false, bMirandaTerminated = false; int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY; CMPlugin g_plugin; -int hLangpack = 0; +int &hLangpack(g_plugin.m_hLang); ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 5488fd645d..df3f14af9b 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, char *prefix, int _hLang) +MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, const char *prefix, int _hLang) { wchar_t szFile[MAX_PATH]; GetModuleFileName(hInst, szFile, MAX_PATH); @@ -48,7 +48,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte } } -MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, char *prefix, int _hLang) +MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, const char *prefix, int _hLang) { wchar_t szFile[MAX_PATH]; GetModuleFileName(hInst, szFile, MAX_PATH); diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index fda0f29a80..e4f0b50fe8 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -40,7 +40,6 @@ void InitMetaContacts(); void InitTimeZones(); void InitWinver(); -int hLangpack = 0; HINSTANCE g_hInst = nullptr; HCURSOR g_hCursorNS, g_hCursorWE; diff --git a/src/mir_core/src/modules.cpp b/src/mir_core/src/modules.cpp index 086e584de9..6af89cbab2 100644 --- a/src/mir_core/src/modules.cpp +++ b/src/mir_core/src/modules.cpp @@ -702,6 +702,8 @@ struct CMPlugin : public CMPluginBase {} } g_plugin; +int &hLangpack(g_plugin.m_hLang); + LIST pluginListAddr(10, HandleKeySortT); MIR_CORE_DLL(void) RegisterModule(CMPluginBase *pPlugin) -- cgit v1.2.3