diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-12-09 08:31:44 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-12-09 08:31:44 +0000 |
commit | d9b26ea2f38f0ac9554f999bc9d9806d4762d3d7 (patch) | |
tree | d98f59a89cf1a463edcf28472253b417fbb7a150 /plugins | |
parent | 36472b00443e23acf28b0dd26ddc2c2e6216d909 (diff) |
code cleanup (by Mataes)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11296 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_blind/src/commonheaders.h | 2 | ||||
-rw-r--r-- | plugins/Clist_blind/src/init.cpp | 18 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 3 |
3 files changed, 10 insertions, 13 deletions
diff --git a/plugins/Clist_blind/src/commonheaders.h b/plugins/Clist_blind/src/commonheaders.h index 47cb30cb48..c8e98db991 100644 --- a/plugins/Clist_blind/src/commonheaders.h +++ b/plugins/Clist_blind/src/commonheaders.h @@ -62,5 +62,3 @@ extern CLIST_INTERFACE coreCli; * easy search and replace
*/
-
-#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]) )
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 369a665175..c72c5912a1 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -442,13 +442,13 @@ TCHAR *GetStatusName(struct ClcContact *item) return status_name;
// Get XStatusName
- MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, MAX_REGS(status_name), NULL);
+ MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, SIZEOF(status_name), NULL);
if (status_name[0] != _T('\0'))
return status_name;
// Get status name
status = db_get_w(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE);
- mir_tstrncpy(status_name, pcli->pfnGetStatusModeDescription(status, GSMDF_TCHAR), MAX_REGS(status_name));
+ mir_tstrncpy(status_name, pcli->pfnGetStatusModeDescription(status, GSMDF_TCHAR), SIZEOF(status_name));
return status_name;
}
@@ -462,12 +462,12 @@ TCHAR *GetStatusMessage(struct ClcContact *item) return status_message;
// Get XStatusMsg
- MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, MAX_REGS(status_message), NULL);
+ MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, SIZEOF(status_message), NULL);
if (status_message[0] != _T('\0'))
return status_message;
// Get status message
- MyDBGetContactSettingTString(item->hContact, "CList", "StatusMsg", status_message, MAX_REGS(status_message), NULL);
+ MyDBGetContactSettingTString(item->hContact, "CList", "StatusMsg", status_message, SIZEOF(status_message), NULL);
return status_message;
}
@@ -484,7 +484,7 @@ TCHAR *GetProtoName(struct ClcContact *item) proto_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
{
- mir_tstrncpy(proto_name, TranslateT("Unknown Protocol"), MAX_REGS(proto_name));
+ mir_tstrncpy(proto_name, TranslateT("Unknown Protocol"), SIZEOF(proto_name));
return proto_name;
}
@@ -501,7 +501,7 @@ TCHAR *GetProtoName(struct ClcContact *item) return proto_name;
}
- mir_tstrncpy(proto_name, acc->tszAccountName, MAX_REGS(proto_name));
+ mir_tstrncpy(proto_name, acc->tszAccountName, SIZEOF(proto_name));
return proto_name;
}
@@ -542,7 +542,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) group = &dat->list;
group->scanIndex = 0;
text = tmp;
- size = MAX_REGS(tmp);
+ size = SIZEOF(tmp);
while(1)
{
if (group->scanIndex == group->cl.count)
@@ -588,7 +588,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) count[0] = _T('\0');
}
- txt = ParseText(template_group, t, MAX_REGS(t), v, MAX_REGS(v));
+ txt = ParseText(template_group, t, SIZEOF(t), v, SIZEOF(v));
if (txt != NULL)
mir_tstrncpy(text, txt, (int)size);
mir_free(txt);
@@ -610,7 +610,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) GetStatusMessage(item)
};
- TCHAR *txt = ParseText(template_contact, t, MAX_REGS(t), v, MAX_REGS(v));
+ TCHAR *txt = ParseText(template_contact, t, SIZEOF(t), v, SIZEOF(v));
if (txt != NULL)
mir_tstrncpy(text, txt, (int)size);
mir_free(txt);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index a41827ce05..9712a49f0c 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -44,12 +44,11 @@ static int g_status_events[] = { };
static int g_status_events_size = 0;
-#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]))
bool TSAPI IsStatusEvent(int eventType)
{
if (g_status_events_size == 0)
- g_status_events_size = MAX_REGS(g_status_events);
+ g_status_events_size = SIZEOF(g_status_events);
for (int i = 0; i < g_status_events_size; i++) {
if (eventType == g_status_events[i])
|