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/Ping/src/pinggraph.cpp | 8 ++++---- plugins/Ping/src/pingthread.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/Ping') diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 3dd8c82452..1947ada7bf 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -190,19 +190,19 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TCHAR buff[64]; if (wd->show_grid) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d ms"), MARK_TIME); + mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME); TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_tstrlen(buff)); } if (wd->show_stat) { SetTextColor(hdc, RGB(255, 0, 0)); - mir_sntprintf(buff, SIZEOF(buff), TranslateT("AVG %.1lf ms"), avg); + mir_sntprintf(buff, TranslateT("AVG %.1lf ms"), avg); TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_tstrlen(buff)); if (max_value != avg) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT("MAX %hd ms"), max_value); + mir_sntprintf(buff, TranslateT("MAX %hd ms"), max_value); TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff)); - mir_sntprintf(buff, SIZEOF(buff), TranslateT("MIN %hd ms"), min_value); + mir_sntprintf(buff, TranslateT("MIN %hd ms"), min_value); TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff)); } } diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 16dde60f03..f5191a64e7 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -66,7 +66,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) { if (options.logging) { TCHAR buf[1024]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status); + mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status); CallService(PLUG "/Log", (WPARAM)buf, 0); } CallProtoService(pszProto, PS_SETSTATUS, new_status, 0); @@ -198,7 +198,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) } if (pa.miss_count == -1 - options.retries && options.logging) { TCHAR buf[512]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time); + mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time); CallService(PLUG "/Log", (WPARAM)buf, 0); } SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status); @@ -214,7 +214,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) } if (pa.miss_count == 1 + options.retries && options.logging) { TCHAR buf[512]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - timeout"), pa.pszLabel); + mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel); CallService(PLUG "/Log", (WPARAM)buf, 0); } } @@ -410,12 +410,12 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (itemData.status != PS_DISABLED) { TCHAR buf[256]; if (itemData.responding) { - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%d ms"), itemData.round_trip_time); + mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time); GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize); TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf)); } else if (itemData.miss_count > 0) { - mir_sntprintf(buf, SIZEOF(buf), _T("[%d]"), itemData.miss_count); + mir_sntprintf(buf, _T("[%d]"), itemData.miss_count); GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize); TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf)); } @@ -777,7 +777,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (options.logging) { TCHAR buf[1024]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s - %s"), pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked"))); + mir_sntprintf(buf, _T("%s - %s"), pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked"))); CallService(PLUG "/Log", (WPARAM)buf, 0); } -- cgit v1.2.3