From 8ae3679aa1339ce9abee53adb69902bd6b7513dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Jul 2016 10:31:04 +0000 Subject: hello, Unix. phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/src/log.cpp | 10 +++++----- plugins/Ping/src/options.cpp | 4 ++-- plugins/Ping/src/ping.cpp | 6 +++--- plugins/Ping/src/pinggraph.cpp | 10 +++++----- plugins/Ping/src/pingthread.cpp | 28 ++++++++++++++-------------- plugins/Ping/src/rawping.cpp | 20 ++++++++++---------- plugins/Ping/src/stdafx.h | 2 +- plugins/Ping/src/utils.cpp | 4 ++-- 8 files changed, 42 insertions(+), 42 deletions(-) (limited to 'plugins/Ping/src') diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index cce8d2e61c..59538f577e 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -15,13 +15,13 @@ INT_PTR Log(WPARAM wParam, LPARAM) { TCHAR *line = (TCHAR *)wParam; - FILE *f = _tfopen(buf, _T("a+")); + FILE *f = _tfopen(buf, L"a+"); if (f) { if (options.log_csv) { - _ftprintf(f, _T("%s, %s, %s\n"), dbuf, tbuf, line); + _ftprintf(f, L"%s, %s, %s\n", dbuf, tbuf, line); } else { - _ftprintf(f, _T("%s, %s: %s\n"), dbuf, tbuf, line); + _ftprintf(f, L"%s, %s: %s\n", dbuf, tbuf, line); } fclose(f); } @@ -34,7 +34,7 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { TCHAR *filename = (TCHAR *)lParam; if (db_get_ts(0, PLUG, "LogFilename", &dbv)) { CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename); - mir_tstrncat(filename, _T("\\ping_log.txt"), wParam - mir_tstrlen(filename)); + mir_tstrncat(filename, L"\\ping_log.txt", wParam - mir_tstrlen(filename)); } else { mir_tstrncpy(filename, dbv.ptszVal, wParam); @@ -54,6 +54,6 @@ INT_PTR SetLogFilename(WPARAM, LPARAM lParam) { INT_PTR ViewLogData(WPARAM wParam, LPARAM) { TCHAR buf[MAX_PATH]; CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf); - return (INT_PTR)ShellExecute((HWND)wParam, _T("edit"), buf, _T(""), _T(""), SW_SHOW); + return (INT_PTR)ShellExecute((HWND)wParam, L"edit", buf, L"", L"", SW_SHOW); } diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 6d270c713a..56e501ee40 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_LOGBROWSE: { TCHAR filter[MAX_PATH]; - mir_sntprintf(filter, _T("%s%c*.txt%c%s%c*.*%c"), TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0); + mir_sntprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0); OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); ofn.lpstrFile = options.log_filename; @@ -150,7 +150,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA RefreshWindow(0, 0); - if (options.logging) CallService(PLUG "/Log", (WPARAM)_T("options changed"), 0); + if (options.logging) CallService(PLUG "/Log", (WPARAM)L"options changed", 0); if (hWakeEvent) SetEvent(hWakeEvent); return TRUE; } diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 63972b536f..9533ff3d83 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -115,7 +115,7 @@ int OnModulesLoaded(WPARAM, LPARAM) graphs_init(); - if (options.logging) CallService(PLUG "/Log", (WPARAM)_T("start"), 0); + if (options.logging) CallService(PLUG "/Log", (WPARAM)L"start", 0); return 0; } @@ -137,7 +137,7 @@ extern "C" __declspec(dllexport) int Load(void) db_set_b(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0); - hWakeEvent = CreateEvent(NULL, FALSE, FALSE, _T("Local\\ThreadWaitEvent")); + hWakeEvent = CreateEvent(NULL, FALSE, FALSE, L"Local\\ThreadWaitEvent"); // create services before loading options - so we can have the 'getlogfilename' service! CreatePluginServices(); @@ -166,7 +166,7 @@ extern "C" __declspec(dllexport) int Unload(void) CloseHandle(mainThread); - if (options.logging) CallService(PLUG "/Log", (WPARAM)_T("stop"), 0); + if (options.logging) CallService(PLUG "/Log", (WPARAM)L"stop", 0); return 0; } diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 5cf5d38093..bb9b2f94b3 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -45,11 +45,11 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar WindowData *wd = (WindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); if (wd->hwnd_chk_grid == 0) { - wd->hwnd_chk_grid = CreateWindow(_T("BUTTON"), TranslateT("Show grid lines"), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 0, 0, 0, 0, hwnd, 0, hInst, 0); + wd->hwnd_chk_grid = CreateWindow(L"BUTTON", TranslateT("Show grid lines"), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 0, 0, 0, 0, hwnd, 0, hInst, 0); SendMessage(wd->hwnd_chk_grid, BM_SETCHECK, wd->show_grid ? BST_CHECKED : BST_UNCHECKED, 0); } if (wd->hwnd_chk_stat == 0) { - wd->hwnd_chk_stat = CreateWindow(_T("BUTTON"), TranslateT("Show stats"), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 0, 0, 0, 0, hwnd, 0, hInst, 0); + wd->hwnd_chk_stat = CreateWindow(L"BUTTON", TranslateT("Show stats"), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 0, 0, 0, 0, hwnd, 0, hInst, 0); SendMessage(wd->hwnd_chk_stat, BM_SETCHECK, wd->show_stat ? BST_CHECKED : BST_UNCHECKED, 0); } KillTimer(hwnd, ID_REPAINT_TIMER); @@ -272,18 +272,18 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = _T(PLUG) _T("GraphWindow"); + wndclass.lpszClassName = _T(PLUG) L"GraphWindow"; RegisterClass(&wndclass); TCHAR title[256]; mir_tstrncpy(title, TranslateT("Ping Graph"), _countof(title)); if (lParam) { - mir_tstrncat(title, _T(" - "), _countof(title) - mir_tstrlen(title)); + mir_tstrncat(title, L" - ", _countof(title) - mir_tstrlen(title)); mir_tstrncat(title, (TCHAR *)lParam, _countof(title) - mir_tstrlen(title)); } HWND parent = 0; - hGraphWnd = CreateWindowEx(0, _T(PLUG) _T("GraphWindow"), title, + hGraphWnd = CreateWindowEx(0, _T(PLUG) L"GraphWindow", title, (WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN) & ~CS_VREDRAW & ~CS_HREDRAW, 0, 0, 800, 600, parent, NULL, hInst, NULL); diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 1a09b4feb8..16a160387b 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -259,7 +259,7 @@ int FillList(WPARAM, LPARAM) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("ping address list reload"), 0); + CallService(PLUG "/Log", (WPARAM)L"ping address list reload", 0); PINGLIST pl; CallService(PLUG "/GetPingList", 0, (LPARAM)&pl); @@ -308,9 +308,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { TCHAR TBcapt[255]; if (total > 0) - mir_sntprintf(TBcapt, _T("Ping (%d/%d)"), upCount, total); + mir_sntprintf(TBcapt, L"Ping (%d/%d)", upCount, total); else - mir_sntprintf(TBcapt, _T("Ping")); + mir_sntprintf(TBcapt, L"Ping"); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt); CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt); @@ -395,7 +395,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar 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, _T("[%d]"), itemData.miss_count); + mir_sntprintf(buf, L"[%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)); } @@ -477,7 +477,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return DefWindowProc(hwnd, msg, wParam, lParam); case WM_CREATE: - list_hwnd = CreateWindow(_T("LISTBOX"), _T(""), + list_hwnd = CreateWindow(L"LISTBOX", L"", //(WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT| LBS_STANDARD | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY) (WS_VISIBLE | WS_CHILD | LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_NOTIFY) & ~WS_BORDER, 0, 0, 0, 0, hwnd, NULL, hInst, 0); @@ -717,7 +717,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (options.logging) { TCHAR buf[1024]; - mir_sntprintf(buf, _T("%s - %s"), pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked"))); + mir_sntprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked"))); CallService(PLUG "/Log", (WPARAM)buf, 0); } } @@ -875,11 +875,11 @@ void InitList() wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = _T(PLUG) _T("WindowClass"); + wndclass.lpszClassName = _T(PLUG) L"WindowClass"; RegisterClass(&wndclass); if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { - hpwnd = CreateWindow(_T(PLUG) _T("WindowClass"), _T("Ping"), (WS_BORDER | WS_CHILD | WS_CLIPCHILDREN), 0, 0, 0, 0, hwnd_clist, NULL, hInst, NULL); + hpwnd = CreateWindow(_T(PLUG) L"WindowClass", L"Ping", (WS_BORDER | WS_CHILD | WS_CLIPCHILDREN), 0, 0, 0, 0, hwnd_clist, NULL, hInst, NULL); CLISTFrame frame = { 0 }; frame.name = PLUG; @@ -893,7 +893,7 @@ void InitList() frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); } else { - hpwnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T(PLUG) _T("WindowClass"), _T("Ping"), + hpwnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T(PLUG) L"WindowClass", L"Ping", (WS_POPUPWINDOW | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_CLIPCHILDREN), 0, 0, 400, 300, hwnd_clist, NULL, hInst, NULL); @@ -921,21 +921,21 @@ void InitList() mir_tstrncpy(font_id.name, LPGENT("List"), _countof(font_id.name)); mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup)); mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix)); - mir_tstrncpy(font_id.backgroundGroup, _T("Ping"), _countof(font_id.backgroundGroup)); - mir_tstrncpy(font_id.backgroundName, _T("Background"), _countof(font_id.backgroundName)); + mir_tstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup)); + mir_tstrncpy(font_id.backgroundName, L"Background", _countof(font_id.backgroundName)); font_id.order = 0; font_id.flags = FIDF_DEFAULTVALID; font_id.deffontsettings.charset = DEFAULT_CHARSET; font_id.deffontsettings.size = -14; font_id.deffontsettings.style = 0; font_id.deffontsettings.colour = RGB(255, 255, 255); - mir_tstrncpy(font_id.deffontsettings.szFace, _T("Tahoma"), _countof(font_id.deffontsettings.szFace)); + mir_tstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace)); FontRegisterT(&font_id); bk_col_id.cbSize = sizeof(ColourIDT); - mir_tstrncpy(bk_col_id.group, _T("Ping"), _countof(bk_col_id.group)); - mir_tstrncpy(bk_col_id.name, _T("Background"), _countof(bk_col_id.name)); + mir_tstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group)); + mir_tstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name)); mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup)); mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting)); bk_col_id.defcolour = RGB(0, 0, 0); diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp index 8b7918280a..bc7de84224 100644 --- a/plugins/Ping/src/rawping.cpp +++ b/plugins/Ping/src/rawping.cpp @@ -95,7 +95,7 @@ extern int raw_ping(char *host, int timeout) } else { // Not a recognized hostname either! - if (options.logging) CallService(PLUG "/Log", (WPARAM)_T("rawping error: unrecognised host"), 0); + if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unrecognised host", 0); return -1; } } @@ -119,7 +119,7 @@ extern int raw_ping(char *host, int timeout) // send packet int bwrote = sendto(sd, (char*)packet, sizeof(ICMPHeader), 0, (sockaddr*)&dest, sizeof(dest)); if (bwrote == SOCKET_ERROR) { - if (options.logging) CallService(PLUG "/Log", (WPARAM)_T("rawping error: unable to send"), 0); + if (options.logging) CallService(PLUG "/Log", (WPARAM)L"rawping error: unable to send", 0); return -1; } @@ -151,39 +151,39 @@ extern int raw_ping(char *host, int timeout) if (bread == SOCKET_ERROR) { if (WSAGetLastError() != WSAETIMEDOUT) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: socket error...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: socket error...cycling", 0); } continue; } if (reply_header->proto != ICMP_PROTO) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: packet not ICMP...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: packet not ICMP...cycling", 0); continue; } if (reply_header->tos != 0) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: TOS not 0...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: TOS not 0...cycling", 0); continue; } reply = (ICMPHeader *)(recv_buff + reply_header->h_len * 4); if ((unsigned)bread < reply_header->h_len * 4 + sizeof(ICMPHeader)) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: short header"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: short header", 0); continue; } if (reply->id != (USHORT)GetCurrentProcessId()) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: wrong ID...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong ID...cycling", 0); continue; } if (reply->type != PT_ICMP_ECHO_REPLY && reply->type != PT_ICMP_SOURCE_QUENCH) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: wrong type...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong type...cycling", 0); continue; } @@ -191,7 +191,7 @@ extern int raw_ping(char *host, int timeout) //if(reply->seq > seq_no) return -1; if (reply->seq != seq_no) { if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: wrong sequence number...cycling"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: wrong sequence number...cycling", 0); continue; } @@ -210,7 +210,7 @@ extern int raw_ping(char *host, int timeout) return current_time - send_time; } if (options.logging) - CallService(PLUG "/Log", (WPARAM)_T("rawping error: timeout"), 0); + CallService(PLUG "/Log", (WPARAM)L"rawping error: timeout", 0); return -1; } diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h index 34b45bfdef..746a2d596b 100644 --- a/plugins/Ping/src/stdafx.h +++ b/plugins/Ping/src/stdafx.h @@ -46,7 +46,7 @@ #define DEFAULT_SHOW_POPUP2 false #define DEFAULT_BLOCK_REPS true #define DEFAULT_LOGGING_ENABLED false -#define DEFAULT_LOG_FILENAME _T("ping_log.txt") +#define DEFAULT_LOG_FILENAME L"ping_log.txt" #define DEFAULT_NO_TEST_ICON true #define DEFAULT_ATTACH_TO_CLIST false diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 5421275577..dedd9cf470 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -51,7 +51,7 @@ void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags) QueueUserAPC(sttMainThreadCallback, mainThread, (ULONG_PTR)ppd); } else{ - MessageBox(NULL, line2, _T(PLUG) _T(" Message"), MB_OK | MB_ICONINFORMATION); + MessageBox(NULL, line2, _T(PLUG) L" Message", MB_OK | MB_ICONINFORMATION); return; } } @@ -206,7 +206,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM) { for (pinglist_it i = pl.begin(); i != pl.end(); ++i) { if (i->item_id == (DWORD)wParam) { if (mir_tstrlen(i->pszCommand)) { - ShellExecute(0, _T("open"), i->pszCommand, i->pszParams, 0, SW_SHOW); + ShellExecute(0, L"open", i->pszCommand, i->pszParams, 0, SW_SHOW); } else { return CallService(PLUG "/ToggleEnabled", wParam, 0); -- cgit v1.2.3