diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-10-28 08:31:49 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-10-28 08:31:49 +0000 |
commit | c8e2953e01de65ce2baffe84d72366f6a6efebc1 (patch) | |
tree | 6a3c2f9380674fc01e1230cff33fef2382daacac /protocols | |
parent | 8934ae2caa8cdc2cc70baf0047a8812b0538963f (diff) |
Optimize EV_PROTO_DBSETTINGSCHANGED functions to not use mir_strcmp() but just strcmp()
It's not needed to user mir_* for checking null pointers when we're comparing const strings with DBCONTACTWRITESETTING values which should be always initialized correctly.
git-svn-id: http://svn.miranda-ng.org/main/trunk@15629 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/AimOscar/src/services.cpp | 6 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 10 | ||||
-rw-r--r-- | protocols/IRCG/src/services.cpp | 4 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_servlist.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 8 | ||||
-rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 8 | ||||
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 4 | ||||
-rw-r--r-- | protocols/Yahoo/src/util.cpp | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index a4e6b7050f..c4be0f3401 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -112,8 +112,8 @@ int CAimProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if (mir_strcmp(cws->szModule, MOD_KEY_CL) == 0 && m_state == 1 && hContact) {
- if (mir_strcmp(cws->szSetting, AIM_KEY_NL) == 0) {
+ if (strcmp(cws->szModule, MOD_KEY_CL) == 0 && m_state == 1 && hContact) {
+ if (strcmp(cws->szSetting, AIM_KEY_NL) == 0) {
if (cws->value.type == DBVT_DELETED) {
DBVARIANT dbv;
if (!db_get_utf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0]) {
@@ -124,7 +124,7 @@ int CAimProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) add_contact_to_group(hContact, AIM_DEFAULT_GROUP);
}
}
- else if (mir_strcmp(cws->szSetting, "MyHandle") == 0) {
+ else if (strcmp(cws->szSetting, "MyHandle") == 0) {
char *name;
switch (cws->value.type) {
case DBVT_DELETED:
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index d62836ca5e..e9b7bb0e04 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1334,14 +1334,14 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) return 0;
// If contact has been blocked
- if (!mir_strcmp(cws->szModule, m_szModuleName) && !mir_strcmp(cws->szSetting, GG_KEY_BLOCK))
+ if (!strcmp(cws->szModule, m_szModuleName) && !mir_strcmp(cws->szSetting, GG_KEY_BLOCK))
{
notifyuser(hContact, 1);
return 0;
}
// Contact is being renamed
- if (gc_enabled && !mir_strcmp(cws->szModule, m_szModuleName) && !mir_strcmp(cws->szSetting, GG_KEY_NICK)){
+ if (gc_enabled && !strcmp(cws->szModule, m_szModuleName) && !strcmp(cws->szSetting, GG_KEY_NICK)){
TCHAR* ptszVal = sttSettingToTchar(&(cws->value));
if(ptszVal==NULL) return 0;
@@ -1372,10 +1372,10 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) }
// Contact list changes
- if (!mir_strcmp(cws->szModule, "CList"))
+ if (!strcmp(cws->szModule, "CList"))
{
// If name changed... change nick
- if (!mir_strcmp(cws->szSetting, "MyHandle")){
+ if (!strcmp(cws->szSetting, "MyHandle")){
TCHAR* ptszVal = sttSettingToTchar(&(cws->value));
if(ptszVal==NULL) return 0;
setTString(hContact, GG_KEY_NICK, ptszVal);
@@ -1383,7 +1383,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) }
// If not on list changed
- if (!mir_strcmp(cws->szSetting, "NotOnList"))
+ if (!strcmp(cws->szSetting, "NotOnList"))
{
if (db_get_b(hContact, "CList", "Hidden", 0))
return 0;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 97ddbe1b3f..e98d69993a 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -958,13 +958,13 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
- if (mir_strcmp(cws->szModule, "CList"))
+ if (strcmp(cws->szModule, "CList"))
return 0;
if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
return 0;
- if (!mir_strcmp(cws->szSetting, "NotOnList")) {
+ if (!strcmp(cws->szSetting, "NotOnList")) {
DBVARIANT dbv;
if (!getTString(hContact, "Nick", &dbv)) {
if (getByte("MirVerAutoRequest", 1))
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 8f2b8ba7bb..5229455a4c 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -2268,20 +2268,20 @@ int CIcqProto::ServListDbSettingChanged(WPARAM hContact, LPARAM lParam) if (!icqOnline() || !m_bSsiEnabled || bIsSyncingCL)
return 0;
- if (!mir_strcmp(cws->szModule, "CList")) {
+ if (!strcmp(cws->szModule, "CList")) {
// Has contact been renamed?
- if (!mir_strcmp(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
+ if (!strcmp(cws->szSetting, "MyHandle") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
servlistUpdateContact(hContact); // Update contact's details in server-list
// Has contact been moved to another group?
- if (!mir_strcmp(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) {
+ if (!strcmp(cws->szSetting, "Group") && getByte("StoreServerDetails", DEFAULT_SS_STORE)) {
char* szNewGroup = getContactCListGroup(hContact); // Read group from DB
SAFE_FREE(&szNewGroup);
}
}
- else if (!mir_strcmp(cws->szModule, "UserInfo")) {
+ else if (!strcmp(cws->szModule, "UserInfo")) {
// Update contact's details in server-list
- if (!mir_strcmp(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
+ if (!strcmp(cws->szSetting, "MyNotes") && getByte("StoreServerDetails", DEFAULT_SS_STORE))
servlistUpdateContact(hContact);
}
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 1eb848004c..83d5f286b4 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -162,14 +162,14 @@ int __cdecl CJabberProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
- if (mir_strcmp(cws->szModule, "CList"))
+ if (strcmp(cws->szModule, "CList"))
return 0;
- if (!mir_strcmp(cws->szSetting, "Group"))
+ if (!strcmp(cws->szSetting, "Group"))
OnRenameGroup(cws, hContact);
- else if (!mir_strcmp(cws->szSetting, "MyHandle"))
+ else if (!strcmp(cws->szSetting, "MyHandle"))
OnRenameContact(cws, hContact);
- else if (!mir_strcmp(cws->szSetting, "NotOnList"))
+ else if (!strcmp(cws->szSetting, "NotOnList"))
OnAddContactForever(cws, hContact);
return 0;
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index d08aa5bf7b..773bb04b57 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -453,8 +453,8 @@ int CMsnProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
if (hContact == NULL) {
- if (MyOptions.SlowSend && mir_strcmp(cws->szSetting, "MessageTimeout") == 0 &&
- (mir_strcmp(cws->szModule, "SRMM") == 0 || mir_strcmp(cws->szModule, "SRMsg") == 0)) {
+ if (MyOptions.SlowSend && strcmp(cws->szSetting, "MessageTimeout") == 0 &&
+ (strcmp(cws->szModule, "SRMM") == 0 || strcmp(cws->szModule, "SRMsg") == 0)) {
if (cws->value.dVal < 60000)
MessageBox(NULL, TranslateT("MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value."),
TranslateT("MSN Protocol"), MB_OK | MB_ICONINFORMATION);
@@ -462,7 +462,7 @@ int CMsnProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
}
- if (!mir_strcmp(cws->szSetting, "ApparentMode")) {
+ if (!strcmp(cws->szSetting, "ApparentMode")) {
char tEmail[MSN_MAX_EMAIL_LEN];
if (!db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail)) ||
!db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail))) {
@@ -479,7 +479,7 @@ int CMsnProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) }
}
- if (!mir_strcmp(cws->szSetting, "MyHandle") && !mir_strcmp(cws->szModule, "CList")) {
+ if (!strcmp(cws->szSetting, "MyHandle") && !strcmp(cws->szModule, "CList")) {
bool isMe = MSN_IsMeByContact(hContact);
if (!isMe || !nickChg) {
char szContactID[100];
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index e77cf5b26f..51e5bdd360 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -710,12 +710,12 @@ int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact != NULL)
return 0;
- if (mir_strcmp(cws->szModule, "ListeningTo"))
+ if (strcmp(cws->szModule, "ListeningTo"))
return 0;
CMStringA szListeningTo(m_szModuleName);
szListeningTo += "Enabled";
- if (!mir_strcmp(cws->szSetting, szListeningTo)) {
+ if (!strcmp(cws->szSetting, szListeningTo)) {
MusicSendMetod iOldMusicSendMetod = (MusicSendMetod)getByte("OldMusicSendMetod", sendBroadcastAndStatus);
if (cws->value.bVal == 0)
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index d1318c182f..c4c5e692a2 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -159,7 +159,7 @@ int __cdecl CYahooProto::OnSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if (!mir_strcmp(cws->szSetting, "ApparentMode")) {
+ if (!strcmp(cws->szSetting, "ApparentMode")) {
debugLogA("DB Setting changed. YAHOO user's visible setting changed.");
DBVARIANT dbv;
|