diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
commit | cddcd7483a7c472598af098e759e5d309024f606 (patch) | |
tree | b0a227d6e087c41958cc84d27bc323353248aae5 /plugins/Ping | |
parent | 1039b2829a264280493ba0fa979214fe024dc70c (diff) |
DWORD -> uint32_t
Diffstat (limited to 'plugins/Ping')
-rw-r--r-- | plugins/Ping/src/icmp.cpp | 4 | ||||
-rw-r--r-- | plugins/Ping/src/options.cpp | 8 | ||||
-rw-r--r-- | plugins/Ping/src/pinggraph.cpp | 6 | ||||
-rw-r--r-- | plugins/Ping/src/pinglist.cpp | 2 | ||||
-rw-r--r-- | plugins/Ping/src/pingthread.cpp | 14 | ||||
-rw-r--r-- | plugins/Ping/src/rawping.cpp | 4 | ||||
-rw-r--r-- | plugins/Ping/src/stdafx.h | 4 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 6 |
8 files changed, 24 insertions, 24 deletions
diff --git a/plugins/Ping/src/icmp.cpp b/plugins/Ping/src/icmp.cpp index 26e7379845..6081ecf21f 100644 --- a/plugins/Ping/src/icmp.cpp +++ b/plugins/Ping/src/icmp.cpp @@ -58,10 +58,10 @@ bool ICMP::ping(char *host, ICMP_ECHO_REPLY &reply) if (hIP == INVALID_HANDLE_VALUE)
return false;
- DWORD rep_cnt = IcmpSendEcho2(hIP, nullptr, nullptr, nullptr, address, data, sizeof(data), nullptr, buff, BUFFER_SIZE, timeout);
+ uint32_t rep_cnt = IcmpSendEcho2(hIP, nullptr, nullptr, nullptr, address, data, sizeof(data), nullptr, buff, BUFFER_SIZE, timeout);
if (rep_cnt == 0)
{
- DWORD code = GetLastError();
+ uint32_t code = GetLastError();
if (code != 11010)
{
char winmsg[512], msg[1024];
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 0c672435a8..676a864ea0 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -110,11 +110,11 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA BOOL trans_success;
- DWORD new_ping_period = GetDlgItemInt(hwndDlg, IDC_PPM, &trans_success, FALSE);
+ uint32_t new_ping_period = GetDlgItemInt(hwndDlg, IDC_PPM, &trans_success, FALSE);
if (trans_success) {
options.ping_period = new_ping_period;
}
- DWORD new_ping_timeout = GetDlgItemInt(hwndDlg, IDC_PT, &trans_success, FALSE);
+ uint32_t new_ping_timeout = GetDlgItemInt(hwndDlg, IDC_PT, &trans_success, FALSE);
if (trans_success) {
options.ping_timeout = new_ping_timeout;
}
@@ -130,7 +130,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA options.indent = SendDlgItemMessage(hwndDlg, IDC_SP_INDENT, UDM_GETPOS, 0, 0);
options.row_height = SendDlgItemMessage(hwndDlg, IDC_SP_ROWHEIGHT, UDM_GETPOS, 0, 0);
- DWORD new_retries = GetDlgItemInt(hwndDlg, IDC_RPT, &trans_success, FALSE);
+ uint32_t new_retries = GetDlgItemInt(hwndDlg, IDC_RPT, &trans_success, FALSE);
if (trans_success) {
options.retries = new_retries;
}
@@ -547,7 +547,7 @@ void SaveOptions() { g_plugin.setWord("Indent", options.indent);
g_plugin.setWord("RowHeight", options.row_height);
- g_plugin.setDword("Retries", (DWORD)options.retries);
+ g_plugin.setDword("Retries", (uint32_t)options.retries);
CallService(MODULENAME "/SetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 9731a9ecd5..3a4e509e94 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -5,7 +5,7 @@ HistoryMap history_map; #define ID_REPAINT_TIMER 10101
struct WindowData {
- DWORD item_id;
+ uint32_t item_id;
HistoryList list;
HWND hwnd_chk_grid;
HWND hwnd_chk_stat;
@@ -254,7 +254,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
char buff[30];
- mir_snprintf(buff, "WindowHandle%d", (DWORD)wParam);
+ mir_snprintf(buff, "WindowHandle%d", (uint32_t)wParam);
HWND hGraphWnd = (HWND)g_plugin.getDword(buff, 0);
if (hGraphWnd) {
ShowWindow(hGraphWnd, SW_SHOW);
@@ -288,7 +288,7 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { 0, 0, 800, 600, parent, nullptr, g_plugin.getInst(), nullptr);
WindowData *wd = new WindowData;
- wd->item_id = (DWORD)wParam; // wParam is destination id
+ wd->item_id = (uint32_t)wParam; // wParam is destination id
wd->hwnd_chk_grid = nullptr;
wd->hwnd_chk_stat = nullptr;
wd->show_grid = g_plugin.getByte("ShowGridLines", 0) ? true : false;
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index 485aabe51f..bf6c9c59df 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -4,7 +4,7 @@ PINGLIST list_items; mir_cs list_cs;
HANDLE reload_event_handle;
-DWORD NextID = 1;
+uint32_t NextID = 1;
BOOL clist_handle_changing = FALSE;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index e1e32665fc..8f866bb8b9 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -294,7 +294,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) }
}
-DWORD context_point;
+uint32_t context_point;
bool context_point_valid = false;
LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -409,7 +409,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar ScreenToClient(list_hwnd, &pt);
PINGADDRESS itemData;
- DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
+ uint32_t item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
bool found = false;
if (HIWORD(item) == 0) {
int count = LOWORD(item);
@@ -546,7 +546,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break;
#ifdef WS_EX_LAYERED
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE)&WS_EX_LAYERED) {
- DWORD thisTick, startTick;
+ uint32_t thisTick, startTick;
int sourceAlpha, destAlpha;
if (wParam) {
sourceAlpha = 0;
@@ -584,7 +584,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (context_point_valid) {
uint16_t x = LOWORD(context_point), y = HIWORD(context_point);
GetWindowRect(list_hwnd, &r);
- DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
+ uint32_t item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
if (HIWORD(item) == 0) {
int count = LOWORD(item);
bool found = false;
@@ -606,7 +606,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (context_point_valid) {
uint16_t x = LOWORD(context_point), y = HIWORD(context_point);
GetWindowRect(list_hwnd, &r);
- DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
+ uint32_t item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
if (HIWORD(item) == 0) {
int count = LOWORD(item);
@@ -623,7 +623,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (context_point_valid) {
uint16_t x = LOWORD(context_point), y = HIWORD(context_point);
GetWindowRect(list_hwnd, &r);
- DWORD item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
+ uint32_t item = SendMessage(list_hwnd, LB_ITEMFROMPOINT, 0, MAKELPARAM(x - r.left, y - r.top));
PINGADDRESS *temp = nullptr;
if (HIWORD(item) == 0) {
int count = LOWORD(item);
@@ -671,7 +671,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar PINGADDRESS *pItemData = (PINGADDRESS *)lp;
if (pItemData) {
- DWORD item_id = pItemData->item_id;
+ uint32_t item_id = pItemData->item_id;
int wake = CallService(MODULENAME "/DblClick", (WPARAM)item_id, 0);
InvalidateRect(list_hwnd, nullptr, FALSE);
diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp index 7e66a7450e..a2c59aef81 100644 --- a/plugins/Ping/src/rawping.cpp +++ b/plugins/Ping/src/rawping.cpp @@ -107,7 +107,7 @@ extern int raw_ping(char *host, int timeout) bool use_hi_res = false;
LARGE_INTEGER hr_freq = { 0 }, hr_send_time = { 0 };
- DWORD send_time;
+ uint32_t send_time;
if (QueryPerformanceFrequency(&hr_freq)) {
use_hi_res = true;
QueryPerformanceCounter(&hr_send_time);
@@ -128,7 +128,7 @@ extern int raw_ping(char *host, int timeout) int fromlen = sizeof(source);
IPHeader *reply_header = (IPHeader *)recv_buff;
ICMPHeader *reply;
- DWORD start, current_time;
+ uint32_t start, current_time;
LARGE_INTEGER hr_start = { 0 }, hr_current_time = { 0 }, hr_timeout = { 0 };
if (use_hi_res) {
hr_timeout.QuadPart = (timeout * hr_freq.QuadPart / 1000LL);
diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h index 7fbb838d85..7dfa5e5b09 100644 --- a/plugins/Ping/src/stdafx.h +++ b/plugins/Ping/src/stdafx.h @@ -90,7 +90,7 @@ typedef LinkedList< HistPair > HistoryList; struct PINGADDRESS {
int cbSize; //size in bytes of this structure
- DWORD item_id;
+ uint32_t item_id;
wchar_t pszName[MAX_PINGADDRESS_STRING_LENGTH]; //IP address or domain name
wchar_t pszLabel[MAX_PINGADDRESS_STRING_LENGTH];
bool responding;
@@ -111,7 +111,7 @@ struct PINGADDRESS { #include "options.h"
-typedef Map<DWORD, HistoryList> HistoryMap;
+typedef Map<uint32_t, HistoryList> HistoryMap;
typedef std::list<PINGADDRESS> PINGLIST;
typedef std::list<PINGADDRESS>::iterator pinglist_it;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 43c777f315..3eedce7b9e 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -130,7 +130,7 @@ INT_PTR ToggleEnabled(WPARAM wParam, LPARAM) { PINGLIST pl;
CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
- if (i->item_id == (DWORD)wParam) {
+ if (i->item_id == (uint32_t)wParam) {
if (i->status == PS_DISABLED)
i->status = PS_NOTRESPONDING;
@@ -152,7 +152,7 @@ INT_PTR EditContact(WPARAM wParam, LPARAM) CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
- if (i->item_id == (DWORD)wParam) {
+ if (i->item_id == (uint32_t)wParam) {
add_edit_addr = *i;
@@ -171,7 +171,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM) { PINGLIST pl;
CallService(MODULENAME "/GetPingList", 0, (LPARAM)&pl);
for (pinglist_it i = pl.begin(); i != pl.end(); ++i) {
- if (i->item_id == (DWORD)wParam) {
+ if (i->item_id == (uint32_t)wParam) {
if (mir_wstrlen(i->pszCommand)) {
ShellExecute(nullptr, L"open", i->pszCommand, i->pszParams, nullptr, SW_SHOW);
}
|