diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-10 17:12:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-10 17:12:48 +0300 |
commit | 97887ae1f32e496483f3c6ac38b8da2faa39d04f (patch) | |
tree | e9b44d7ab8ad670b6a7225e134fb8f13ef245828 /src | |
parent | b6b318877484792e4a28416751be4627f13ce570 (diff) |
code cleaning
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/menu_clist.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index e4e6b06464..983b3ccbc8 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -45,7 +45,6 @@ void InitTrayMenus(void); int hMainMenuObject = 0, hContactMenuObject = 0, hStatusMenuObject = 0;
int currentStatusMenuItem;
-int statustopos(int status);
void Proto_SetStatus(const char *szProto, unsigned status);
OBJLIST<MenuProto> g_menuProtos(1);
@@ -70,6 +69,15 @@ MStatus g_statuses[MAX_STATUS_COUNT] = { ID_STATUS_OUTTOLUNCH, SKINICON_STATUS_OUTTOLUNCH, PF2_OUTTOLUNCH },
};
+static int statustopos(int status)
+{
+ for (auto &it : g_statuses)
+ if (status == it.iStatus)
+ return int(&it - g_statuses);
+
+ return -1;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// service functions
@@ -899,15 +907,6 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-int statustopos(int status)
-{
- for (int j = 0; j < _countof(g_statuses); j++)
- if (status == g_statuses[j].iStatus)
- return j;
-
- return -1;
-}
-
static int MenuProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)lParam;
|