diff options
author | George Hazan <george.hazan@gmail.com> | 2016-04-08 16:33:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-04-08 16:33:41 +0000 |
commit | 05636e0ffc35b0f1b6c9337573914ce246afa775 (patch) | |
tree | 9eb207a492a1d8a05a3df23e5dbc1fa7b928fe24 /plugins/Variables | |
parent | 7f9ac17cace4b3e3746b7a853c18577bcc90daaf (diff) |
code clesning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16615 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables')
-rw-r--r-- | plugins/Variables/src/contact.cpp | 2 | ||||
-rw-r--r-- | plugins/Variables/src/contact.h | 2 | ||||
-rw-r--r-- | plugins/Variables/src/parse_metacontacts.cpp | 6 | ||||
-rw-r--r-- | plugins/Variables/src/parse_miranda.cpp | 12 | ||||
-rw-r--r-- | plugins/Variables/src/variables.cpp | 4 |
5 files changed, 14 insertions, 12 deletions
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index e4b681c1dd..7ab46f484e 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -310,7 +310,7 @@ MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch return (MCONTACT)arResults[rand() % arResults.getCount()];
// cache the found result
- if (count == 1) {
+ if (count == 0) {
mir_cslock lck(csContactCache);
CONTACTCE *cce = new CONTACTCE();
diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h index f5968d2e03..3eacabbbee 100644 --- a/plugins/Variables/src/contact.h +++ b/plugins/Variables/src/contact.h @@ -89,6 +89,8 @@ // (contact details).
#define CI_UNIQUEID 0x00000040 // Search unique ids of the contac, e.g.
// UIN.
+#define CI_ALLFLAGS 0x7FFFFFFF // All possible combinations of previous flags
+
#define CI_CNFINFO 0x40000000 // Searches one of the CNF_* flags (set
// flags to CI_CNFINFO|CNF_X), only one
// CNF_ type possible
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index abbfff5df8..5e9c6a4db4 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -24,7 +24,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -52,7 +52,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -80,7 +80,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 4e3251e123..e6431a19cb 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -109,7 +109,7 @@ static TCHAR* parseContactInfo(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -183,7 +183,7 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai) MCONTACT hContact = NULL;
if (mir_tstrlen(ai->targv[1]) > 0) {
- hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
}
@@ -211,7 +211,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai) if (ai->argc <= 1)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -253,7 +253,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai) if (ai->argc <= 1)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -296,7 +296,7 @@ static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
@@ -570,7 +570,7 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai) break;
}
- MCONTACT hContact = getContactFromString(ai->targv[1], 0xFFFFFFFF);
+ MCONTACT hContact = getContactFromString(ai->targv[1], CI_ALLFLAGS);
if (hContact == INVALID_CONTACT_ID)
return NULL;
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 5d823b942e..1111ddae0c 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -339,7 +339,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM) orgFormat = fi->tszFormat; orgSource = fi->tszExtraText; - if (!(fi->flags&FIF_TCHAR)) { + if (!(fi->flags & FIF_TCHAR)) { copied = TRUE; log_debugA("mir_a2t (%s)", fi->szExtraText); tszFormat = fi->szFormat != NULL ? mir_a2t(fi->szFormat) : NULL; @@ -359,7 +359,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM) tRes = formatString(fi); - if (!(fi->flags&FIF_TCHAR)) { + if (!(fi->flags & FIF_TCHAR)) { res = (INT_PTR)mir_u2a(tRes); mir_free(tRes); } |