From 62a186697df33c96dc1a6dac0f4dfc38652fb96f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 16:39:04 +0300 Subject: BYTE -> uint8_t --- plugins/Ping/src/ping.cpp | 2 +- plugins/Ping/src/pingthread.cpp | 18 +++++++++--------- plugins/Ping/src/rawping.h | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins/Ping/src') diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 7ae9fadf9b..1cf633c8d9 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -119,7 +119,7 @@ static IconItem iconList[] = int CMPlugin::Load() { use_raw_ping = false; - g_plugin.setByte("UsingRawSockets", (BYTE)use_raw_ping); + g_plugin.setByte("UsingRawSockets", (uint8_t)use_raw_ping); hWakeEvent = CreateEvent(nullptr, FALSE, FALSE, L"Local\\ThreadWaitEvent"); diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 9921eff5d2..cef01fc117 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -467,7 +467,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); #endif #ifdef LWA_ALPHA - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); #endif } } @@ -490,7 +490,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT)) { KillTimer(hwnd, TM_AUTOALPHA); #ifdef LWA_ALPHA - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); #endif transparentFocus = 1; } @@ -501,7 +501,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT)) { if (!transparentFocus && GetForegroundWindow() != hwnd) { #ifdef LWA_ALPHA - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); #endif transparentFocus = 1; SetTimer(hwnd, TM_AUTOALPHA, 250, nullptr); @@ -528,8 +528,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (inwnd != transparentFocus) { //change transparentFocus = inwnd; #ifdef LWA_ALPHA - if (transparentFocus) SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); - else SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA); + if (transparentFocus) SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT), LWA_ALPHA); + else SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA); #endif } if (!transparentFocus) KillTimer(hwnd, TM_AUTOALPHA); @@ -550,7 +550,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar int sourceAlpha, destAlpha; if (wParam) { sourceAlpha = 0; - destAlpha = (BYTE)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT); + destAlpha = (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT); #ifdef LWA_ALPHA SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA); #endif @@ -559,18 +559,18 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar noRecurse = 0; } else { - sourceAlpha = (BYTE)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT); + sourceAlpha = (uint8_t)db_get_b(0, "CList", "Alpha", SETTING_AUTOALPHA_DEFAULT); destAlpha = 0; } for (startTick = GetTickCount();;) { thisTick = GetTickCount(); if (thisTick >= startTick + 200) break; #ifdef LWA_ALPHA - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)(sourceAlpha + (destAlpha - sourceAlpha)*(int)(thisTick - startTick) / 200), LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)(sourceAlpha + (destAlpha - sourceAlpha)*(int)(thisTick - startTick) / 200), LWA_ALPHA); #endif } #ifdef LWA_ALPHA - SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)destAlpha, LWA_ALPHA); + SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)destAlpha, LWA_ALPHA); #endif } else AnimateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE)); diff --git a/plugins/Ping/src/rawping.h b/plugins/Ping/src/rawping.h index 59751d8c7a..23aee401cf 100644 --- a/plugins/Ping/src/rawping.h +++ b/plugins/Ping/src/rawping.h @@ -20,14 +20,14 @@ // The IP header struct IPHeader { - BYTE h_len : 4; // Length of the header in dwords - BYTE version : 4; // Version of IP - BYTE tos; // Type of service + uint8_t h_len : 4; // Length of the header in dwords + uint8_t version : 4; // Version of IP + uint8_t tos; // Type of service USHORT total_len; // Length of the packet in dwords USHORT ident; // unique identifier USHORT flags; // Flags - BYTE ttl; // Time to live - BYTE proto; // Protocol number (TCP, UDP etc) + uint8_t ttl; // Time to live + uint8_t proto; // Protocol number (TCP, UDP etc) USHORT checksum; // IP checksum ULONG source_ip; ULONG dest_ip; @@ -35,8 +35,8 @@ struct IPHeader { // ICMP header struct ICMPHeader { - BYTE type; // ICMP packet type - BYTE code; // Type sub code + uint8_t type; // ICMP packet type + uint8_t code; // Type sub code USHORT checksum; USHORT id; USHORT seq; -- cgit v1.2.3