From efd438ad7b533ba2adb4f22a1cb358ee449db825 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:23:03 +0000 Subject: new mir_sntprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 22 +++++++++++----------- plugins/StatusPlugins/StartupStatus/options.cpp | 4 ++-- plugins/StatusPlugins/confirmdialog.cpp | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins/StatusPlugins') diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 668b2cceea..b45f796a4c 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -894,7 +894,7 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s connected from another location"), GetHumanName(lParam)); + mir_sntprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto @@ -903,9 +903,9 @@ static int ProcessPopup(int reason, LPARAM lParam) hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) - mir_sntprintf(text, SIZEOF(text), TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); + mir_sntprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - mir_sntprintf(text, SIZEOF(text), TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + mir_sntprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; @@ -916,9 +916,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { // Указатель на имя модуля. hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); + mir_sntprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); } - else mir_sntprintf(text, SIZEOF(text), TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); + else mir_sntprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** @@ -942,9 +942,9 @@ static int ProcessPopup(int reason, LPARAM lParam) rtrimt(protoInfo); if (retryCount == (maxRetries - 1)) - mir_sntprintf(text, SIZEOF(text), TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); + mir_sntprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); else - mir_sntprintf(text, SIZEOF(text), TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); + mir_sntprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); } break; @@ -953,9 +953,9 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; if (retryCount == maxRetries - 1) - mir_sntprintf(text, SIZEOF(text), TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); + mir_sntprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); else - mir_sntprintf(text, SIZEOF(text), TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); + mir_sntprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes @@ -964,9 +964,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { hIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("Status was set ok")); + mir_sntprintf(text, TranslateT("Status was set ok")); } - else mir_sntprintf(text, SIZEOF(text), TranslateT("Giving up")); + else mir_sntprintf(text, TranslateT("Giving up")); break; } if (hIcon == NULL) diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 64d1a63444..19032f1316 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -322,12 +322,12 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa } else { TCHAR text[128]; - mir_sntprintf(text, SIZEOF(text), TranslateT("size: %d x %d"), + mir_sntprintf(text, TranslateT("size: %d x %d"), db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0), db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0)); SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text); - mir_sntprintf(text, SIZEOF(text), TranslateT("loc: %d x %d"), + mir_sntprintf(text, TranslateT("loc: %d x %d"), db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0), db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0)); SetDlgItemText(hwndDlg, IDC_CURWINLOC, text); diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 543bbc0f20..03b9943ca2 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -127,11 +127,11 @@ static int SetStatusList(HWND hwndDlg) TCHAR* status = pcli->pfnGetStatusModeDescription(actualStatus, 0); switch ((*confirmSettings)[i].status) { case ID_STATUS_LAST: - mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT(""), status); + mir_sntprintf(buf, _T("%s (%s)"), TranslateT(""), status); ListView_SetItemText(hList, lvItem.iItem, 1, buf); break; case ID_STATUS_CURRENT: - mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT(""), status); + mir_sntprintf(buf, _T("%s (%s)"), TranslateT(""), status); ListView_SetItemText(hList, lvItem.iItem, 1, buf); break; default: @@ -210,7 +210,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // start timer if (timeOut > 0) { TCHAR text[32]; - mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut); + mir_sntprintf(text, TranslateT("Closing in %d"), timeOut); SetDlgItemText(hwndDlg, IDC_CLOSE, text); SetTimer(hwndDlg, TIMER_ID, 1000, NULL); } @@ -219,7 +219,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER: { TCHAR text[32]; - mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut - 1); + mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1); SetDlgItemText(hwndDlg, IDC_CLOSE, text); if (timeOut <= 0) { KillTimer(hwndDlg, TIMER_ID); @@ -344,7 +344,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // last TCHAR buf[100]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); + mir_sntprintf(buf, _T("%s (%s)"), TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST); if (proto->status == ID_STATUS_LAST) { @@ -354,7 +354,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // current int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0); - mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); + mir_sntprintf(buf, _T("%s (%s)"), TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT); if (proto->status == ID_STATUS_CURRENT) { -- cgit v1.2.3