diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
commit | ca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch) | |
tree | 554ad80633528d530057fc61035b15f901860ed2 /protocols/Steam | |
parent | e0799755b3966d1d6d8275ee5127242ec029a4e6 (diff) |
code cleaning:
- in conformance to C++'11 rules, we don't declare a method as virtual if it's declared as override;
- cause this code isn't visible in Pascal anymore, there's no need to use __cdecl calling convention for virtual methods;
- since PROTO_INTERFACE is a regular C++ class, there's no need to use old style service declarations for virtual methods like OnModulesLoaded / OnShutdown
Diffstat (limited to 'protocols/Steam')
-rw-r--r-- | protocols/Steam/src/steam_events.cpp | 3 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 18 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 28 |
3 files changed, 19 insertions, 30 deletions
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index 23a418f9e5..b74dc8305b 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -int CSteamProto::OnModulesLoaded(WPARAM, LPARAM) +void CSteamProto::OnModulesLoaded() { Clist_GroupCreate(0, m_defaultGroup); @@ -16,7 +16,6 @@ int CSteamProto::OnModulesLoaded(WPARAM, LPARAM) dbEventType.eventType = EVENTTYPE_STEAM_CHATSTATES; dbEventType.descr = "Chat state notifications"; DbEvent_RegisterType(&dbEventType); - return 0; } INT_PTR CSteamProto::OnAccountManagerInit(WPARAM, LPARAM lParam) diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 6ca91ace53..ec77254b02 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -187,7 +187,7 @@ int CSteamProto::AuthRequest(MCONTACT hContact, const wchar_t*) return 1; } -DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT) +INT_PTR CSteamProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -199,7 +199,7 @@ DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT) case PFLAGNUM_5: return PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR)Translate("SteamID"); + return (INT_PTR)Translate("SteamID"); default: return 0; } @@ -341,12 +341,9 @@ HANDLE CSteamProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1; } -int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) +int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM) { switch (eventType) { - case EV_PROTO_ONLOAD: - return OnModulesLoaded(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: if (IsOnline()) { MCONTACT hContact = (MCONTACT)wParam; @@ -356,17 +353,10 @@ int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) ptrA sessionId(getStringA("SessionID")); ptrA steamId(getStringA("SteamID")); char *who = getStringA(hContact, "SteamID"); - PushRequest( - new RemoveFriendRequest(token, sessionId, steamId, who), - &CSteamProto::OnFriendRemoved, - (void*)who); + PushRequest(new RemoveFriendRequest(token, sessionId, steamId, who), &CSteamProto::OnFriendRemoved, (void*)who); } } return 0; - - case EV_PROTO_ONMENU: - //OnInitStatusMenu(); - break; } return 1; diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 7638b0d73e..ef971cb2e9 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -55,25 +55,27 @@ public: ~CSteamProto();
// PROTO_INTERFACE
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthRecv(MCONTACT, PROTORECVEVENT*);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthRecv(MCONTACT, PROTORECVEVENT*) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetStatus(int iNewStatus) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
// menus
static void InitMenus();
@@ -223,11 +225,9 @@ protected: HICON GetXStatusIcon(int status, UINT flags);
int GetContactXStatus(MCONTACT hContact);
- HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
void __cdecl GetAwayMsgThread(void *arg);
// events
- int OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnIdleChanged(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
|