From d9da7f147fbe91d2e70721de96907ae1d273b591 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jun 2012 08:54:36 +0000 Subject: - langpack returned back; - fixes for the 64-bit compilation issues git-svn-id: http://svn.miranda-ng.org/main/trunk@651 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/lib/mir_core.lib | Bin 23510 -> 23732 bytes bin10/lib/mir_core64.lib | Bin 23010 -> 23226 bytes include/m_core.h | 1 + plugins/AVS/avs_10.vcxproj | 2 +- .../fingerprint_mod_vs2010.vcxproj | 4 ++-- plugins/Mir_core/langpack.cpp | 12 +++++++++++- plugins/Mir_core/miranda.h | 1 - plugins/TipperYM/tipper_ym_10.vcxproj | 2 +- protocols/Yahoo/options.cpp | 2 +- protocols/Yahoo/user_info.cpp | 2 +- src/core/modules.cpp | 4 ++-- src/modules/fonts/services.cpp | 7 ++++++- src/modules/langpack/lpservices.cpp | 6 ++++-- 13 files changed, 30 insertions(+), 13 deletions(-) diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib index 54190681aa..c1edf06753 100644 Binary files a/bin10/lib/mir_core.lib and b/bin10/lib/mir_core.lib differ diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib index 22ab1784af..baa9532c93 100644 Binary files a/bin10/lib/mir_core64.lib and b/bin10/lib/mir_core64.lib differ diff --git a/include/m_core.h b/include/m_core.h index d1122460d7..99321a1e5a 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -114,6 +114,7 @@ MIR_CORE_DLL(int) LangPackGetDefaultCodePage( void ); MIR_CORE_DLL(int) LangPackGetDefaultLocale(void); MIR_CORE_DLL(TCHAR*) LangPackPcharToTchar(const char* pszStr); +MIR_CORE_DLL(int) LoadLangPackModule(void); MIR_CORE_DLL(int) LoadLangPack(const TCHAR *szLangPack); MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr); diff --git a/plugins/AVS/avs_10.vcxproj b/plugins/AVS/avs_10.vcxproj index 4cedba910d..2530deed9d 100644 --- a/plugins/AVS/avs_10.vcxproj +++ b/plugins/AVS/avs_10.vcxproj @@ -107,7 +107,7 @@ Disabled ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;UNICODE;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + WIN64;_DEBUG;_WINDOWS;UNICODE;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL diff --git a/plugins/FingerPrintModPlus/fingerprint_mod_vs2010.vcxproj b/plugins/FingerPrintModPlus/fingerprint_mod_vs2010.vcxproj index 6d02028081..1645c14abf 100644 --- a/plugins/FingerPrintModPlus/fingerprint_mod_vs2010.vcxproj +++ b/plugins/FingerPrintModPlus/fingerprint_mod_vs2010.vcxproj @@ -130,7 +130,7 @@ true Use Level3 - FULL;_FULL;_WIN64;NDEBUG;_WINDOWS;_USRDLL;FINGERPRINT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + FULL;_FULL;WIN64;NDEBUG;_WINDOWS;_USRDLL;FINGERPRINT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) global.h true @@ -152,7 +152,7 @@ Disabled ..\..\include;..\ExternalAPI;res;%(AdditionalIncludeDirectories) - FULL;_FULL;_WIN64;_DEBUG;_WINDOWS;_USRDLL;FINGERPRINT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + FULL;_FULL;WIN64;_DEBUG;_WINDOWS;_USRDLL;FINGERPRINT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL diff --git a/plugins/Mir_core/langpack.cpp b/plugins/Mir_core/langpack.cpp index d38dd6807d..140efb823a 100644 --- a/plugins/Mir_core/langpack.cpp +++ b/plugins/Mir_core/langpack.cpp @@ -133,6 +133,16 @@ MIR_CORE_DLL(unsigned int) mir_hash(const void * key, unsigned int len) return h; } +static unsigned int __fastcall hashstrW(const char * key) +{ + if (key == NULL) return 0; + const unsigned int len = (unsigned int)wcslen((const wchar_t*)key); + char* buf = (char*)alloca(len + 1); + for (unsigned i = 0; i <= len ; ++i) + buf[i] = key[i << 1]; + return mir_hash(buf, len); +} + static int SortLangPackHashesProc(LangPackEntry *arg1, LangPackEntry *arg2) { if (arg1->englishHash < arg2->englishHash) return -1; @@ -397,7 +407,7 @@ static char *LangPackTranslateString(LangPackMuuid* pUuid, const char *szEnglish return (char*)szEnglish; LangPackEntry key, *entry; - key.englishHash = W ? mir_hashstrW((WCHAR*)szEnglish) : mir_hashstr(szEnglish); + key.englishHash = W ? hashstrW(szEnglish) : mir_hashstr(szEnglish); entry = (LangPackEntry*)bsearch(&key, langPack.entry, langPack.entryCount, sizeof(LangPackEntry), (int(*)(const void*, const void*))SortLangPackHashesProc2); if (entry == NULL) return (char*)szEnglish; diff --git a/plugins/Mir_core/miranda.h b/plugins/Mir_core/miranda.h index 8a03e4111c..9faa569eff 100644 --- a/plugins/Mir_core/miranda.h +++ b/plugins/Mir_core/miranda.h @@ -34,7 +34,6 @@ MIR_CORE_DLL(int) LangPackMarkPluginLoaded(PLUGININFOEX* pInfo); MIR_CORE_DLL(LangPackMuuid*) LangPackLookupUuid(WPARAM wParam); -int LoadLangPackModule(void); void UnloadLangPackModule(void); int InitialiseModularEngine(void); diff --git a/plugins/TipperYM/tipper_ym_10.vcxproj b/plugins/TipperYM/tipper_ym_10.vcxproj index c1848e171a..9f1780e597 100644 --- a/plugins/TipperYM/tipper_ym_10.vcxproj +++ b/plugins/TipperYM/tipper_ym_10.vcxproj @@ -100,7 +100,7 @@ Disabled ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;%(PreprocessorDefinitions) + WIN64;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL diff --git a/protocols/Yahoo/options.cpp b/protocols/Yahoo/options.cpp index 8ed3168650..bfd5b00ab2 100644 --- a/protocols/Yahoo/options.cpp +++ b/protocols/Yahoo/options.cpp @@ -367,7 +367,7 @@ static INT_PTR CALLBACK DlgProcYahooOptsIgnore(HWND hwndDlg, UINT msg, WPARAM wP * YahooOptInit - initialize/register our Options w/ Miranda. */ -INT_PTR __cdecl CYahooProto::OnOptionsInit(WPARAM wParam,LPARAM lParam) +int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; diff --git a/protocols/Yahoo/user_info.cpp b/protocols/Yahoo/user_info.cpp index 4447506397..d17ca165c7 100644 --- a/protocols/Yahoo/user_info.cpp +++ b/protocols/Yahoo/user_info.cpp @@ -111,7 +111,7 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc( HWND hwndDlg, UINT msg, WPARAM wPa ///////////////////////////////////////////////////////////////////////////////////////// // OnInfoInit - initializes user info option dialogs -INT_PTR __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam ) +int __cdecl CYahooProto::OnUserInfoInit( WPARAM wParam, LPARAM lParam ) { //if ( !JCallService( MS_PROTO_ISPROTOCOLLOADED, 0, ( LPARAM )m_szModuleName )) // return 0; diff --git a/src/core/modules.cpp b/src/core/modules.cpp index 11e93f1354..8dbbf54e63 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -36,7 +36,7 @@ int LoadNewPluginsModule(void); // core: N.O. plugins int LoadSslModule(void); int LoadNetlibModule(void); // core: network void NetlibInitSsl(void); -int LoadLangPackModule(void); // core: translation +int LoadLangpackModule(void); // core: translation int LoadProtocolsModule(void); // core: protocol manager int LoadAccountsModule(void); // core: account manager int LoadIgnoreModule(void); // protocol filter: ignore @@ -97,7 +97,7 @@ int LoadDefaultModules(void) { //load order is very important for these if ( LoadSystemModule()) return 1; - if ( LoadLangPackModule()) return 1; // langpack will be a system module in the new order so this is moved here + if ( LoadLangpackModule()) return 1; // langpack will be a system module in the new order so this is moved here ParseCommandLine(); // IDD_WAITRESTART need langpack so this is moved here if ( LoadUtilsModule()) return 1; //order not important for this, but no dependencies and no point in pluginising if ( LoadIcoTabsModule()) return 1; diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index adc5d216f2..3774cafe9f 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -299,8 +299,9 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack) DBWriteContactSettingDword(0, font_id->dbSettingsGroup, idstr, font_id->flags); FontInternal* newItem = new FontInternal; - memset(newItem, 0, sizeof(FontIDW)); + memset(newItem, 0, sizeof(FontInternal)); memcpy(newItem, font_id, font_id->cbSize); + newItem->hLangpack = hLangpack; if ( !lstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) { LOGFONT lf; @@ -387,7 +388,9 @@ static INT_PTR sttRegisterColourWorker(ColourIDW* colour_id, int hLangpack) } ColourInternal* newItem = new ColourInternal; + memset(newItem, 0, sizeof(ColourInternal)); memcpy(newItem, colour_id, sizeof(ColourIDW)); + newItem->hLangpack = hLangpack; UpdateColourSettings(colour_id, &newItem->value); colour_id_list.insert(newItem); return 0; @@ -462,7 +465,9 @@ static INT_PTR sttRegisterEffectWorker(EffectIDW* effect_id, int hLangpack) } EffectInternal* newItem = new EffectInternal; + memset(newItem, 0, sizeof(EffectInternal)); memcpy(newItem, effect_id, sizeof(EffectIDW)); + newItem->hLangpack = hLangpack; UpdateEffectSettings(effect_id, &newItem->value); effect_id_list.insert(newItem); return 0; diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp index b346a6a277..e828a85c6a 100644 --- a/src/modules/langpack/lpservices.cpp +++ b/src/modules/langpack/lpservices.cpp @@ -88,9 +88,11 @@ INT_PTR srvReloadLangpack(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// -int LoadLangPackModule(void) +MIR_CORE_DLL(int) LoadLangPackModule(void); + +int LoadLangpackModule(void) { - ReloadLangpack(NULL); + LoadLangPackModule(); CreateServiceFunction(MS_LANGPACK_TRANSLATESTRING, srvTranslateString); CreateServiceFunction(MS_LANGPACK_TRANSLATEMENU, srvTranslateMenu); -- cgit v1.2.3