summaryrefslogtreecommitdiff
path: root/src/core/stduserinfo
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/core/stduserinfo
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/core/stduserinfo')
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp16
-rw-r--r--src/core/stduserinfo/src/stdinfo.cpp14
2 files changed, 15 insertions, 15 deletions
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 301371a4ef..b06a8c795d 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -277,7 +277,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.pszText = TranslateT("Primary");
}
else {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ mir_snprintf(idstr, "e-mail%d", i);
if (db_get_ts(hContact, szProto, idstr, &dbv))
break;
@@ -292,7 +292,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;;i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
+ mir_snprintf(idstr, "Mye-mail%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;; i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
+ mir_snprintf(idstr, "MyPhone%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -464,7 +464,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
break;
for (int i=0;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
db_free(&dbv);
}
@@ -477,13 +477,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char idstr[33];
DBVARIANT dbv;
for (i = lvi.lParam;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
+ mir_snprintf(idstr, szIdTemplate, i+1);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_set_s(hContact, "UserInfo", idstr, dbv.pszVal);
db_free(&dbv);
}
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_unset(hContact, "UserInfo", idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
@@ -491,7 +491,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//edit
char szText[256], idstr[33];
DBVARIANT dbv;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
+ mir_snprintf(idstr, szIdTemplate, lvi.lParam);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
mir_strncpy(szText, dbv.pszVal, SIZEOF(szText));
db_free(&dbv);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp
index 3b6e387dd0..197d24440c 100644
--- a/src/core/stduserinfo/src/stdinfo.cpp
+++ b/src/core/stduserinfo/src/stdinfo.cpp
@@ -97,7 +97,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
if (dbv.cVal == -100) unspecified = 1;
else {
pstr = str;
- mir_snprintf(str, SIZEOF(str), dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
+ mir_snprintf(str, dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
}
}
else {
@@ -406,11 +406,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
+ mir_snprintf(idstr, "Past%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
+ mir_snprintf(idstr, "Past%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -425,11 +425,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i);
+ mir_snprintf(idstr, "Affiliation%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
+ mir_snprintf(idstr, "Affiliation%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -451,11 +451,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
+ mir_snprintf(idstr, "Interest%dCat", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
+ mir_snprintf(idstr, "Interest%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;