summaryrefslogtreecommitdiff
path: root/src/modules/clist
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
commitb7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch)
tree468d9610a590685322ad2159a9bd2d9e2ba83f89 /src/modules/clist
parent7de513f180c429859e246d1033d745b394e1fc28 (diff)
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r--src/modules/clist/clcutils.cpp10
-rw-r--r--src/modules/clist/clistmenus.cpp16
-rw-r--r--src/modules/clist/contacts.cpp4
-rw-r--r--src/modules/clist/genmenuopt.cpp16
4 files changed, 23 insertions, 23 deletions
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 1eddd43662..74207f06e8 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -688,18 +688,18 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
cli.pfnGetDefaultFontSetting(i, lf, colour);
char idstr[20];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
+ mir_snprintf(idstr, "Font%dName", i);
ptrT tszFace(db_get_tsa(NULL, "CLC", idstr));
if (tszFace)
mir_tstrcpy(lf->lfFaceName, tszFace);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
+ mir_snprintf(idstr, "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
+ mir_snprintf(idstr, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, "CLC", idstr, lf->lfHeight);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
+ mir_snprintf(idstr, "Font%dSty", i);
BYTE style = (BYTE)db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
@@ -707,7 +707,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
+ mir_snprintf(idstr, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index f63a86d5c0..b81968aee8 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -283,12 +283,12 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
PMO_IntMenuItem menuHandle = MO_AddNewMenuItem(hContactMenuObject, &tmi);
char buf[256];
if (mi->pszService)
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
else if (mi->ptszName) {
if (tmi.flags & CMIF_UNICODE)
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
else
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
else buf[0] = '\0';
if (buf[0]) MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
@@ -426,7 +426,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
XStatus = 0;
char buf[255];
- mir_snprintf(buf, SIZEOF(buf), "*XStatus%d", XStatus);
+ mir_snprintf(buf, "*XStatus%d", XStatus);
bool check = wildcmp(smep->svc, buf) != 0;
bool reset = wildcmp(smep->svc, "*XStatus0") != 0;
@@ -902,7 +902,7 @@ void RebuildMenuOrder(void)
cli.menuProtoCount++;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "RootProtocolIcon_%s", pa->szModuleName);
+ mir_snprintf(buf, "RootProtocolIcon_%s", pa->szModuleName);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
DestroyIcon(ic);
@@ -936,7 +936,7 @@ void RebuildMenuOrder(void)
hStatusMenuHandles[i].menuhandle[j] = MO_AddNewMenuItem(hStatusMenuObject, &tmi);
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -982,7 +982,7 @@ void RebuildMenuOrder(void)
}
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -1206,7 +1206,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
char buf[MAX_PATH + 64];
char *p = (pRoot) ? mir_t2a(pRoot->mi.ptszName) : NULL;
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
mir_free(p);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp
index 497527bc8d..9995bf219b 100644
--- a/src/modules/clist/contacts.cpp
+++ b/src/modules/clist/contacts.cpp
@@ -350,7 +350,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam)
int offset = tzi->Bias + tzi->StandardBias;
char str[80];
- mir_snprintf(str, SIZEOF(str), offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
+ mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str);
ci->type = CNFT_ASCIIZ;
return 0;
@@ -384,7 +384,7 @@ public:
m_nameOrder(this, IDC_NAMEORDER)
{
m_nameOrder.SetFlags(MTREE_DND);
- m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
+ m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
}
virtual void OnInitDialog()
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 7a2339ed47..6be6805ab2 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -170,7 +170,7 @@ class CGenMenuOptionsPage : public CDlgBase
GetMenuItemName(p, menuItemName, sizeof(menuItemName));
{
DBVARIANT dbv;
- mir_snprintf(buf, SIZEOF(buf), "%s_name", menuItemName);
+ mir_snprintf(buf, "%s_name", menuItemName);
if (!db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
@@ -182,11 +182,11 @@ class CGenMenuOptionsPage : public CDlgBase
PD->pimi = p;
PD->defname = mir_tstrdup(GetMenuItemText(p));
- mir_snprintf(buf, SIZEOF(buf), "%s_visible", menuItemName);
+ mir_snprintf(buf, "%s_visible", menuItemName);
PD->bShow = db_get_b(NULL, MenuNameItems, buf, 1) != 0;
if (bReread) {
- mir_snprintf(buf, SIZEOF(buf), "%s_pos", menuItemName);
+ mir_snprintf(buf, "%s_pos", menuItemName);
PD->pos = db_get_dw(NULL, MenuNameItems, buf, 1);
}
else PD->pos = (PD->pimi) ? PD->pimi->originalPosition : 0;
@@ -323,7 +323,7 @@ public:
int iNewMenuValue = !m_radio1.GetState();
if (iNewMenuValue != iInitMenuValue) {
- db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
+ db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
RebuildProtoMenus(iNewMenuValue);
iInitMenuValue = iNewMenuValue;
@@ -362,7 +362,7 @@ public:
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
m_menuItems.InsertItem(&tvis);
- NotifyChange();
+ NotifyChange();
}
void btnReset_Clicked(CCtrlButton*)
@@ -370,7 +370,7 @@ public:
int MenuObjectID;
if (GetCurrentMenuObjectID(MenuObjectID)) {
BuildTree(MenuObjectID, false);
- NotifyChange();
+ NotifyChange();
}
}
@@ -393,7 +393,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void btnSet_Clicked(CCtrlButton*)
@@ -415,7 +415,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void onMenuObjectChanged(void*)