From 20d1480ed78c9395749d5b4e198d8687f95220e6 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 31 Mar 2009 05:32:30 +0000 Subject: x64 port git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@450 4f64403b-2f21-0410-a795-97e2b3489a10 --- meta2/api.cpp | 15 +++--- meta2/collection.h | 4 +- meta2/core_functions.cpp | 4 +- meta2/edit_meta.cpp | 4 +- meta2/import.cpp | 7 --- meta2/menu.cpp | 9 ++-- meta2/meta2.cpp | 4 +- meta2/meta2.vcproj | 137 ++++++++++++++++++++++++----------------------- meta2/proto.cpp | 4 +- meta2/select_meta.cpp | 2 +- 10 files changed, 89 insertions(+), 101 deletions(-) diff --git a/meta2/api.cpp b/meta2/api.cpp index 4eae79c..b64b23f 100644 --- a/meta2/api.cpp +++ b/meta2/api.cpp @@ -26,7 +26,7 @@ INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) { if(metaMap.exists(hMeta) == false || metaMap[hMeta].size() == 0) return 0; int def = DBGetContactSettingByte(hMeta, MODULE, "Default", -1); - if(def < 0 || def >= metaMap[hMeta].size()) return 0; + if(def < 0 || def >= (int)metaMap[hMeta].size()) return 0; return (INT_PTR)metaMap[hMeta][def].handle(); } @@ -78,7 +78,7 @@ INT_PTR MetaAPI_GetNumContacts(WPARAM wParam, LPARAM lParam) { //returns a handle to the specified subcontact INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) { HANDLE hMeta = (HANDLE)wParam; - if(metaMap.exists(hMeta) && lParam >= 0 && metaMap[hMeta].size() > lParam) return (int)metaMap[hMeta][lParam].handle(); + if(metaMap.exists(hMeta) && lParam >= 0 && metaMap[hMeta].size() > lParam) return (INT_PTR)metaMap[hMeta][lParam].handle(); return 0; } @@ -130,8 +130,8 @@ INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) { //returns 0 on success INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) { HANDLE hMeta = (HANDLE)wParam; - int contact_num = (int)lParam; - if(!hMeta || metaMap.exists(hMeta) == false || contact_num < 0 || contact_num >= metaMap[hMeta].size() || DBGetContactSettingByte(hMeta, MODULE, "ForceDefault", 0)) + unsigned contact_num = (unsigned)lParam; + if(!hMeta || (int)metaMap.exists(hMeta) == false || contact_num < 0 || contact_num >= metaMap[hMeta].size() || DBGetContactSettingByte(hMeta, MODULE, "ForceDefault", 0)) return 1; HANDLE hSub = metaMap[hMeta][contact_num].handle(); @@ -219,7 +219,7 @@ INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) { // method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :) // wParam=lParam=0 INT_PTR MetaAPI_GetProtoName(WPARAM wParam, LPARAM lParam) { - return (int)MODULE; + return (INT_PTR)MODULE; } // added 0.9.5.0 (22/3/05) @@ -227,7 +227,7 @@ INT_PTR MetaAPI_GetProtoName(WPARAM wParam, LPARAM lParam) { // lParam=0 // convert a given contact into a metacontact INT_PTR MetaAPI_ConvertToMeta(WPARAM wParam, LPARAM lParam) { - return (int)Meta_Convert((HANDLE)wParam); + return (INT_PTR)Meta_Convert((HANDLE)wParam); } // added 0.9.5.0 (22/3/05) @@ -255,13 +255,12 @@ INT_PTR MetaAPI_RemoveFromMeta(WPARAM wParam, LPARAM lParam) { // should be called once in your 'onmodulesloaded' event handler bool meta_group_hack_disabled = false; INT_PTR MetaAPI_DisableHiddenGroup(WPARAM wParam, LPARAM lParam) { - meta_group_hack_disabled = (BOOL)wParam; + meta_group_hack_disabled = wParam != 0; return 0; } int ModulesLoadedAPI(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; HANDLE hMeta; while(hContact != NULL) { DWORD id = DBGetContactSettingDword(hContact, MODULE, "ParentMetaID", (DWORD)-1); diff --git a/meta2/collection.h b/meta2/collection.h index f8709e3..11daa98 100644 --- a/meta2/collection.h +++ b/meta2/collection.h @@ -247,7 +247,7 @@ public: } const bool index_of(const T &val, unsigned long &index) const { - for(int i = 0; i < Collection::count; i++) { + for(int i = 0; i < (int)Collection::count; i++) { if(ar[index] == val) { index = i; return true; @@ -257,7 +257,7 @@ public: } const int index_of(const T &val) const { - for(int i = 0; i < Collection::count; i++) { + for(int i = 0; i < (int)Collection::count; i++) { if(ar[i] == val) { return i; } diff --git a/meta2/core_functions.cpp b/meta2/core_functions.cpp index 38fba2c..a7fae8c 100644 --- a/meta2/core_functions.cpp +++ b/meta2/core_functions.cpp @@ -23,8 +23,6 @@ HANDLE GetMetaHandle(DWORD id) { void Meta_Hide(bool hide_metas) { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; - HANDLE hMeta; while(hContact != NULL) { if(IsMetacontact(hContact)) { DBWriteContactSettingByte(hContact, "CList", "Hidden", hide_metas ? 1 : 0); @@ -187,7 +185,7 @@ void Meta_Remove(HANDLE hSub) { metaMap.remove(hMeta); } else { int def = DBGetContactSettingByte(hMeta, MODULE, "Default", -1); - if(def < 0 || def >= metaMap[hMeta].size()) + if(def < 0 || def >= (int)metaMap[hMeta].size()) DBWriteContactSettingByte(hMeta, MODULE, "Default", 0); } FireSubcontactsChanged(hMeta); diff --git a/meta2/edit_meta.cpp b/meta2/edit_meta.cpp index 839a15a..38edecc 100644 --- a/meta2/edit_meta.cpp +++ b/meta2/edit_meta.cpp @@ -109,7 +109,7 @@ void SetListSelection(HWND hList, int sel) { } void ApplyChanges() { - if(def >= 0 && def < metaMap[hMeta].size()) + if(def >= 0 && def < (int)metaMap[hMeta].size()) MetaAPI_SetDefaultContactNum((WPARAM)hMeta, (LPARAM)def); else MetaAPI_SetDefaultContactNum((WPARAM)hMeta, (LPARAM)0); @@ -189,7 +189,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_BTN_REM: { int index = SendDlgItemMessage(hwndDlg, IDC_LST_CONTACTS, LVM_GETNEXTITEM,-1,LVNI_FOCUSED|LVNI_SELECTED); // return item selected - if(index >= 0 && index < subs.size()) { + if(index >= 0 && index < (int)subs.size()) { subs.remove(subs[index].handle()); if(def >= index && def > 0) def--; changed = true; diff --git a/meta2/import.cpp b/meta2/import.cpp index ac0b073..1b8b2e9 100644 --- a/meta2/import.cpp +++ b/meta2/import.cpp @@ -7,7 +7,6 @@ void CreateNewMetas() { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; HANDLE hMeta; while(hContact != NULL) { DWORD id = DBGetContactSettingDword(hContact, "MetaContacts", "MetaLink", (DWORD)-1); @@ -117,7 +116,6 @@ void CopyHistory(HANDLE hContactFrom, HANDLE hContactTo, int days) { DWORD time_now = time(0); DWORD earliest_time = time_now - days * 24 * 60 * 60; BYTE *buffer = 0; - HWND progress_dialog, prog; if (!hContactFrom || !hContactTo) return; @@ -197,7 +195,6 @@ void ImportSubHistory() { BYTE *buffer = 0; DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); - bool done; int subcount, num_contacts = metaMap.size(), count = 0; for(MetaMap::Iterator i = metaMap.start(); i.has_val(); i.next()) { SendMessage(progress_dialog, WMU_SETPERCENT, (WPARAM)(int)(100.0 * count / num_contacts), 0); @@ -264,7 +261,6 @@ void ImportSubHistory() { void DeleteAllModuleContacts() { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; HANDLE hMeta; while(hContact != NULL) { if(IsMetacontact(hContact)) { @@ -284,7 +280,6 @@ void DeleteAllModuleContacts() { void DeleteOldMetas() { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; HANDLE hMeta; while(hContact != NULL) { if(DBGetContactSettingDword(hContact, "MetaContacts", "MetaID", (DWORD)-1) != (DWORD)-1) { @@ -298,8 +293,6 @@ void DeleteOldMetas() { bool OldMetasExist() { HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; - HANDLE hMeta; while(hContact != NULL) { if(DBGetContactSettingDword(hContact, "MetaContacts", "MetaID", (DWORD)-1) != (DWORD)-1) { return true; diff --git a/meta2/menu.cpp b/meta2/menu.cpp index 8b68ca9..d1cface 100644 --- a/meta2/menu.cpp +++ b/meta2/menu.cpp @@ -67,7 +67,7 @@ INT_PTR ContactMenuDefault(WPARAM wParam, LPARAM lParam) { } // show contact's context menu -DWORD CALLBACK sttMenuFunc( LPVOID param ) +VOID CALLBACK sttMenuFunc( ULONG_PTR param ) { HMENU hMenu; TPMPARAMS tpmp = {0}; @@ -83,16 +83,13 @@ DWORD CALLBACK sttMenuFunc( LPVOID param ) CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(menuRet), MPCF_CONTACTMENU), (LPARAM)hSub); DestroyMenu(hMenu); - - return 0; } INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) { - char buff[1024]; HANDLE hMeta = (HANDLE)wParam; - int contact_num = (int)lParam; + unsigned contact_num = (unsigned)lParam; if(metaMap.exists(hMeta) && contact_num >= 0 && contact_num < metaMap[hMeta].size()) { - QueueUserAPC((PAPCFUNC)sttMenuFunc, metaMainThread, (ULONG)metaMap[hMeta][contact_num].handle()); + QueueUserAPC(sttMenuFunc, metaMainThread, (ULONG_PTR)metaMap[hMeta][contact_num].handle()); } return 0; diff --git a/meta2/meta2.cpp b/meta2/meta2.cpp index 447f681..5f48f27 100644 --- a/meta2/meta2.cpp +++ b/meta2/meta2.cpp @@ -64,7 +64,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { update.szComponentName = pluginInfo.shortName; update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); - update.cpbVersion = strlen((char *)update.pbVersion); + update.cpbVersion = (int)strlen((char *)update.pbVersion); update.szUpdateURL = UPDATER_AUTOREGISTER; @@ -80,7 +80,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_meta2.html"; update.pbBetaVersionPrefix = (BYTE *)"MetaContacts mk2, version "; - update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix); + update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix); CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); } diff --git a/meta2/meta2.vcproj b/meta2/meta2.vcproj index f81fa45..f53a58f 100644 --- a/meta2/meta2.vcproj +++ b/meta2/meta2.vcproj @@ -88,9 +88,9 @@ /> @@ -481,21 +486,19 @@ />