From b7c74cd5b22618d544a3f4ae124985d4837e3a22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:12:13 +0000 Subject: new mir_snprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/extraicons/extraicons.cpp | 10 +++++----- src/modules/extraicons/options_ei.cpp | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/modules/extraicons') diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp index 90ac2c35b2..4df022e512 100644 --- a/src/modules/extraicons/extraicons.cpp +++ b/src/modules/extraicons/extraicons.cpp @@ -133,16 +133,16 @@ static void LoadGroups(LIST &groups) int count = db_get_w(NULL, MODULE_NAME "Groups", "Count", 0); for (int i=0; i < count; i++) { char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "%d_count", i); + mir_snprintf(setting, "%d_count", i); unsigned int items = db_get_w(NULL, MODULE_NAME "Groups", setting, 0); if (items < 1) continue; - mir_snprintf(setting, SIZEOF(setting), "__group_%d", i); + mir_snprintf(setting, "__group_%d", i); ExtraIconGroup *group = new ExtraIconGroup(setting); for (unsigned int j = 0; j < items; j++) { - mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j); + mir_snprintf(setting, "%d_%d", i, j); ptrA szIconName(db_get_sa(NULL, MODULE_NAME "Groups", setting)); if (IsEmpty(szIconName)) continue; @@ -408,10 +408,10 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam) } char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "Position_%s", ei->name); + mir_snprintf(setting, "Position_%s", ei->name); extra->setPosition(db_get_w(NULL, MODULE_NAME, setting, 1000)); - mir_snprintf(setting, SIZEOF(setting), "Slot_%s", ei->name); + mir_snprintf(setting, "Slot_%s", ei->name); int slot = db_get_w(NULL, MODULE_NAME, setting, 1); if (slot == (WORD)-1) slot = -1; diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 2b51b9e718..28d0bf553d 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -342,7 +342,7 @@ public: } else { char name[128]; - mir_snprintf(name, SIZEOF(name), "__group_%d", groups.getCount()); + mir_snprintf(name, "__group_%d", groups.getCount()); ExtraIconGroup *group = new ExtraIconGroup(name); @@ -365,10 +365,10 @@ public: BaseExtraIcon *extra = registeredExtraIcons[i]; char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "Position_%s", extra->getName()); + mir_snprintf(setting, "Position_%s", extra->getName()); db_set_w(NULL, MODULE_NAME, setting, extra->getPosition()); - mir_snprintf(setting, SIZEOF(setting), "Slot_%s", extra->getName()); + mir_snprintf(setting, "Slot_%s", extra->getName()); db_set_w(NULL, MODULE_NAME, setting, extra->getSlot()); } @@ -378,13 +378,13 @@ public: ExtraIconGroup *group = groups[k]; char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "%d_count", k); + mir_snprintf(setting, "%d_count", k); db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.getCount()); for (int j = 0; j < group->items.getCount(); j++) { BaseExtraIcon *extra = group->items[j]; - mir_snprintf(setting, SIZEOF(setting), "%d_%d", k, j); + mir_snprintf(setting, "%d_%d", k, j); db_set_s(NULL, MODULE_NAME "Groups", setting, extra->getName()); } } @@ -419,10 +419,10 @@ public: ImageList_Destroy(m_tree.GetImageList(TVSIL_NORMAL)); } - virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) - { - if (msg == WM_NOTIFY) { - LPNMHDR lpnmhdr = (LPNMHDR)lParam; + virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) + { + if (msg == WM_NOTIFY) { + LPNMHDR lpnmhdr = (LPNMHDR)lParam; if (lpnmhdr->idFrom == IDC_EXTRAORDER && lpnmhdr->code == NM_RCLICK) { HTREEITEM hSelected = m_tree.GetDropHilight(); if (hSelected != NULL && !m_tree.IsSelected(hSelected)) { @@ -450,8 +450,8 @@ public: } } - return CDlgBase::DlgProc(msg, wParam, lParam); - } + return CDlgBase::DlgProc(msg, wParam, lParam); + } }; ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3