summaryrefslogtreecommitdiff
path: root/plugins/SimpleStatusMsg/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-28 16:22:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-28 16:22:41 +0000
commitc370af60855db957c5b200914bf0bde743845528 (patch)
tree0bd2ef127097c9e937c2650e8b202c3f09453323 /plugins/SimpleStatusMsg/src
parent7f082bd5d4865c30b313661b7a02f048b4b137be (diff)
mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleStatusMsg/src')
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp14
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp6
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp28
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp2
-rw-r--r--plugins/SimpleStatusMsg/src/utils.cpp6
5 files changed, 28 insertions, 28 deletions
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index 20c14a01d6..4060d798f9 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -86,14 +86,14 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
if (dat->hSeq) {
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
}
else {
- mir_sntprintf(str, _countof(str), TranslateT("Failed to retrieve %s message."), status);
+ mir_sntprintf(str, TranslateT("Failed to retrieve %s message."), status);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
}
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
contactName = (TCHAR *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, contactName);
+ mir_sntprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
if (!dat->hSeq)
DestroyWindow(hwndDlg);
@@ -348,7 +348,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
IcoLib_ReleaseIcon(hIcon);
}
@@ -359,13 +359,13 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (!iHidden && szMsg != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
}
else Menu_ShowItem(hCopyMsgMenuItem, false);
if (!iHidden && szMsg != NULL && StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
else Menu_ShowItem(hGoToURLMenuItem, false);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index d164f846bd..3032ecf36c 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -258,7 +258,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (ran_to > ran_from)
{
- mir_sntprintf(substituteStr, _countof(substituteStr), _T("%d"), GetRandom(ran_from, ran_to));
+ mir_sntprintf(substituteStr, _T("%d"), GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
if (mir_tstrlen(substituteStr) > k - i)
@@ -1360,14 +1360,14 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
if (iCurrentStatus < ID_STATUS_ONLINE)
continue;
- mir_snprintf(szBuffer, _countof(szBuffer), "FCur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
if (db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
continue;
tszMsg = InsertVarsIntoMsg(dbv.ptszVal, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
db_free(&dbv);
- mir_snprintf(szBuffer, _countof(szBuffer), "Cur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
if (!db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
{
if (tszMsg && dbv.ptszVal && !mir_tstrcmp(tszMsg, dbv.ptszVal) || !tszMsg && !dbv.ptszVal)
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index b767cd4a9d..5c448a8195 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -643,7 +643,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel)
char text[16], buff2[80];
for (i = 1; i <= data->max_hist_msgs; i++) {
- mir_snprintf(text, _countof(text), "SMsg%d", i);
+ mir_snprintf(text, "SMsg%d", i);
db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
@@ -657,7 +657,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel)
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(buff2, "Last%sMsg", accounts->pa[i]->szModuleName);
db_set_s(NULL, "SimpleStatusMsg", buff2, "");
}
db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs);
@@ -696,7 +696,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg)
lines++;
}
}
- mir_sntprintf(status_text, _countof(status_text), TranslateT("OK (%d)"), len - (lines - 1));
+ mir_sntprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1));
SetDlgItemText(hwndDlg, IDC_OK, status_text);
}
@@ -780,7 +780,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
TCHAR szTitle[256], szProtoName[128];
BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND);
- mir_sntprintf(szProtoName, _countof(szProtoName), msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global"));
+ mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global"));
if (iStatus == ID_STATUS_CURRENT) {
if (msgbox_data->m_bOnStartup)
mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName);
@@ -905,7 +905,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
TranslateDialogDefault(hwndDlg);
init_data = (struct MsgBoxInitData *)lParam;
GetWindowText(hwndDlg, szFormat, _countof(szFormat));
- mir_sntprintf(szProtoName, _countof(szProtoName), init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global"));
+ mir_sntprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global"));
if (init_data->m_iStatus == ID_STATUS_CURRENT) {
if (init_data->m_bOnStartup)
@@ -1099,7 +1099,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
}
else {
TCHAR str[64];
- mir_sntprintf(str, _countof(str), TranslateT("Closing in %d"), msgbox_data->m_iCountdown);
+ mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown);
SetDlgItemText(hwndDlg, IDC_OK, str);
}
msgbox_data->m_iCountdown--;
@@ -1179,10 +1179,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (!mir_tstrcmp(dbv.ptszVal, tszMsg)) {
found = TRUE;
if (msgbox_data->m_szProto) {
- mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto);
db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
- mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else {
@@ -1200,10 +1200,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName);
db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
- mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
@@ -1227,10 +1227,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg);
if (msgbox_data->m_szProto) {
- mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto);
db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
- mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto);
+ mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else {
@@ -1248,10 +1248,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName);
db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
- mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName);
+ mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index 5e40cd08c5..de55dcabb2 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -1346,7 +1346,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (i = 1; i <= max_hist_msgs; i++) {
- mir_snprintf(text, _countof(text), "SMsg%d", i);
+ mir_snprintf(text, "SMsg%d", i);
db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp
index 81770581a9..d27b1ad5ae 100644
--- a/plugins/SimpleStatusMsg/src/utils.cpp
+++ b/plugins/SimpleStatusMsg/src/utils.cpp
@@ -42,7 +42,7 @@ void IconsInit(void)
HICON LoadIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
return IcoLib_GetIcon(szSettingName);
}
@@ -58,14 +58,14 @@ HANDLE GetIconHandle(int iconId)
void ReleaseIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
IcoLib_Release(szSettingName);
}
HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc)
{
char szProtoEvent[MAXMODULELABELLENGTH];
- mir_snprintf(szProtoEvent, _countof(szProtoEvent), "%s%s", szModule, szEvent);
+ mir_snprintf(szProtoEvent, "%s%s", szModule, szEvent);
HANDLE res = HookEventParam(szProtoEvent, hookProc, (LPARAM)szModule);
arProtoHooks.insert(res);
return res;