From a15cd68f0412e1b211e746a2e4d5682e96f5a113 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Aug 2015 13:52:01 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14911 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YahooGroups/src/YahooGroups.cpp | 4 ++-- plugins/YahooGroups/src/hooked_events.cpp | 4 +--- plugins/YahooGroups/src/list.cpp | 2 +- plugins/YahooGroups/src/list.h | 2 +- plugins/YahooGroups/src/services.cpp | 6 +++--- plugins/YahooGroups/src/utils.cpp | 24 ++++++++---------------- 6 files changed, 16 insertions(+), 26 deletions(-) (limited to 'plugins/YahooGroups') diff --git a/plugins/YahooGroups/src/YahooGroups.cpp b/plugins/YahooGroups/src/YahooGroups.cpp index d907e2aa75..cf2d09b11c 100644 --- a/plugins/YahooGroups/src/YahooGroups.cpp +++ b/plugins/YahooGroups/src/YahooGroups.cpp @@ -41,7 +41,7 @@ PLUGININFOEX pluginInfo = { {0x2f3fe8b9, 0x7327, 0x4008, {0xa6, 0x0d, 0x93, 0xf0, 0xf4, 0xf7, 0xf0, 0xf1}} }; -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) { return &pluginInfo; } @@ -70,7 +70,7 @@ extern "C" int __declspec(dllexport) Unload() return 0; } -bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID) { hInstance = hinstDLL; if (fdwReason == DLL_PROCESS_ATTACH) diff --git a/plugins/YahooGroups/src/hooked_events.cpp b/plugins/YahooGroups/src/hooked_events.cpp index bc2341f748..19efd4ffda 100644 --- a/plugins/YahooGroups/src/hooked_events.cpp +++ b/plugins/YahooGroups/src/hooked_events.cpp @@ -40,13 +40,11 @@ int UnhookEvents() return 0; } -int OnModulesLoaded(WPARAM wParam, LPARAM lParam) +int OnModulesLoaded(WPARAM, LPARAM) { int autoMove = db_get_b(NULL, ModuleName, "MoveAutomatically", 0); if (autoMove) - { YahooGroupsMoveService(0,0); - } return 0; } diff --git a/plugins/YahooGroups/src/list.cpp b/plugins/YahooGroups/src/list.cpp index 94b0ac40d4..491867af2d 100644 --- a/plugins/YahooGroups/src/list.cpp +++ b/plugins/YahooGroups/src/list.cpp @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -CGroupsList &availableGroups = CGroupsList(); +CGroupsList availableGroups; void CGroupsList::Enlarge(int amount) { diff --git a/plugins/YahooGroups/src/list.h b/plugins/YahooGroups/src/list.h index a2931a94ec..87ff6b93a6 100644 --- a/plugins/YahooGroups/src/list.h +++ b/plugins/YahooGroups/src/list.h @@ -48,6 +48,6 @@ class CGroupsList char *operator [](int index); }; -extern CGroupsList &availableGroups; +extern CGroupsList availableGroups; #endif //M_VIUPLOADER_LIST_H \ No newline at end of file diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp index 71252f42d5..16e58a2add 100644 --- a/plugins/YahooGroups/src/services.cpp +++ b/plugins/YahooGroups/src/services.cpp @@ -151,7 +151,7 @@ void ProcessContacts(void (*callback)(MCONTACT, char *), char *protocol) callback(hContact, protocol); } -void YahooMoveCallback(MCONTACT hContact, char *unused) +void YahooMoveCallback(MCONTACT hContact, char*) { char protocol[128] = {0}; GetContactProtocol(hContact, protocol, sizeof(protocol)); @@ -180,13 +180,13 @@ void ResetGroupCallback(MCONTACT hContact, char *protocol) } } -INT_PTR YahooGroupsMoveService(WPARAM wParam, LPARAM lParam) +INT_PTR YahooGroupsMoveService(WPARAM, LPARAM) { ProcessContacts(YahooMoveCallback, NULL); return 0; } -INT_PTR YahooGroupsResetService(WPARAM wParam, LPARAM lParam) +INT_PTR YahooGroupsResetService(WPARAM, LPARAM) { ProcessContacts(ResetGroupCallback, NULL); return 0; diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 383d001007..a811bc5e64 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -226,18 +226,13 @@ TCHAR *GetContactName(MCONTACT hContact, char *szProto) //_debug_message(" contact name %s", ctInfo.pszVal); TCHAR *buffer; if (!ret) - { - buffer = _tcsdup(ctInfo.pszVal); - } + buffer = _tcsdup(ctInfo.pszVal); + mir_free(ctInfo.pszVal); if (!ret) - { - return buffer; - } - else{ - return NULL; - } - return buffer; + return buffer; + + return NULL; } void GetContactProtocol(MCONTACT hContact, char *szProto, int size) @@ -306,12 +301,9 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) } mir_free(ctInfo.pszVal); if (!ret) - { - return buffer; - } - else{ - return NULL; - } + return buffer; + + return NULL; } MCONTACT GetContactFromID(TCHAR *szID, char *szProto) -- cgit v1.2.3