summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
commit62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch)
tree1437d0906218fae8827aed384026f2b7e656f4ac /plugins/MirandaG15/src/LCDFramework
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'plugins/MirandaG15/src/LCDFramework')
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp16
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h4
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp16
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDGfx.h2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDInput.h2
5 files changed, 20 insertions, 20 deletions
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
index 890f1b9bb0..33ed23a2e9 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp
@@ -323,11 +323,11 @@ bool CLCDConnectionLogitech::Shutdown()
//************************************************************************
// Reads data from the keyboard HID device
//************************************************************************
-bool CLCDConnectionLogitech::HIDReadData(BYTE* data)
+bool CLCDConnectionLogitech::HIDReadData(uint8_t* data)
{
static OVERLAPPED olRead;
static HANDLE hReadEvent = CreateEvent(nullptr, false, true, L"ReadEvent");
- static BYTE privateBuffer[9];
+ static uint8_t privateBuffer[9];
DWORD TransBytes;
if (!m_bConnected) {
@@ -339,7 +339,7 @@ bool CLCDConnectionLogitech::HIDReadData(BYTE* data)
if (dwRes == WAIT_OBJECT_0) {
bool bRes = false;
if (GetOverlappedResult(m_hHIDDeviceHandle, &olRead, &TransBytes, false)) {
- memcpy(data, privateBuffer, 9 * sizeof(BYTE));
+ memcpy(data, privateBuffer, 9 * sizeof(uint8_t));
bRes = true;
}
@@ -427,7 +427,7 @@ bool CLCDConnectionLogitech::Update()
}
}
- BYTE buffer[9];
+ uint8_t buffer[9];
if (HIDReadData(buffer)) {
int button = 0;
// mr key
@@ -892,7 +892,7 @@ SG15LightStatus CLCDConnectionLogitech::GetLightStatus()
m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return status;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x02;
@@ -936,7 +936,7 @@ void CLCDConnectionLogitech::SetMKeyLight(bool bM1, bool bM2, bool bM3, bool bMR
m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x04;
data[2] = 0x00;
@@ -962,7 +962,7 @@ void CLCDConnectionLogitech::SetLCDBacklight(ELCDBrightness eBrightness)
m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x02;
@@ -980,7 +980,7 @@ void CLCDConnectionLogitech::SetKBDBacklight(EKBDBrightness eBrightness)
m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15)
return;
- BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength];
+ uint8_t *data = new uint8_t[m_HIDCapabilities.FeatureReportByteLength];
data[0] = 0x02;
data[1] = 0x01;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h
index c3bf9f78c5..916b0f9110 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h
@@ -114,7 +114,7 @@ private:
// HID functions
bool HIDInit();
bool HIDDeInit();
- bool HIDReadData(BYTE* data);
+ bool HIDReadData(uint8_t* data);
// Keyboard hook
HHOOK m_hKeyboardHook;
@@ -131,7 +131,7 @@ private:
tstring m_strAppletName;
bool m_bConnected;
lgLcdBitmap m_lcdBitmap;
- BYTE *m_pPixels;
+ uint8_t *m_pPixels;
int m_iPixels;
int m_hDevice;
int m_hConnection;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
index 241ddddd30..7d994666a7 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp
@@ -65,7 +65,7 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pLcdBitmapB
}
int nBMISize = sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD);
- m_pBitmapInfo = (BITMAPINFO *) new BYTE[nBMISize];
+ m_pBitmapInfo = (BITMAPINFO *) new uint8_t[nBMISize];
if (nullptr == m_pBitmapInfo) {
TRACE(L"CLCDGfx::Initialize(): failed to allocate bitmap info.\n");
Shutdown();
@@ -87,9 +87,9 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pLcdBitmapB
if (m_nBPP == 1) {
for (int nColor = 0; nColor < 256; ++nColor) {
- m_pBitmapInfo->bmiColors[nColor].rgbRed = (BYTE)((nColor > 128) ? 255 : 0);
- m_pBitmapInfo->bmiColors[nColor].rgbGreen = (BYTE)((nColor > 128) ? 255 : 0);
- m_pBitmapInfo->bmiColors[nColor].rgbBlue = (BYTE)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbRed = (uint8_t)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbGreen = (uint8_t)((nColor > 128) ? 255 : 0);
+ m_pBitmapInfo->bmiColors[nColor].rgbBlue = (uint8_t)((nColor > 128) ? 255 : 0);
m_pBitmapInfo->bmiColors[nColor].rgbReserved = 0;
}
}
@@ -217,7 +217,7 @@ void CLCDGfx::SetPixel(int nX, int nY, COLORREF color)
::SetPixel(m_hDC, nX, nY, color);
}
-void CLCDGfx::SetPixel(int nX, int nY, BYTE r, BYTE g, BYTE b)
+void CLCDGfx::SetPixel(int nX, int nY, uint8_t r, uint8_t g, uint8_t b)
{
COLORREF ref;
if (m_nBPP == 1) {
@@ -721,13 +721,13 @@ void CLCDGfx::StartTransition(ETransitionType eType, LPRECT rect)
if (m_bTransition) {
EndTransition();
- memcpy(m_pBitmapBits, m_pLcdBitmapBits, sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
+ memcpy(m_pBitmapBits, m_pLcdBitmapBits, sizeof(uint8_t)*m_nWidth*m_nHeight*m_nBPP);
}
if (m_pSavedBitmapBits == nullptr)
- m_pSavedBitmapBits = (BYTE*)malloc(sizeof(BYTE)*m_nWidth*m_nHeight*m_nBPP);
+ m_pSavedBitmapBits = (uint8_t*)malloc(sizeof(uint8_t)*m_nWidth*m_nHeight*m_nBPP);
- memcpy(m_pSavedBitmapBits, m_pBitmapBits, sizeof(BYTE)* m_nWidth * m_nHeight * m_nBPP);
+ memcpy(m_pSavedBitmapBits, m_pBitmapBits, sizeof(uint8_t)* m_nWidth * m_nHeight * m_nBPP);
m_dwTransitionStart = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h
index b4e7c3c8e0..2246064e43 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h
@@ -26,7 +26,7 @@ public:
void ClearScreen(void);
COLORREF GetPixel(int nX, int nY);
void SetPixel(int nX, int nY, COLORREF color);
- void SetPixel(int nX, int nY, BYTE r, BYTE g, BYTE b);
+ void SetPixel(int nX, int nY, uint8_t r, uint8_t g, uint8_t b);
void DrawLine(int nX1, int nY1, int nX2, int nY2);
void DrawFilledRect(int nX, int nY, int nWidth, int nHeight);
void DrawRect(int iX, int iY, int iWidth, int iHeight);
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.h b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h
index 9fa746ff42..d580658cfd 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.h
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h
@@ -97,7 +97,7 @@ protected:
// Input variables
static CLCDInput* m_pInput;
HHOOK m_hKBHook = nullptr;
- BYTE m_acKeyboardState[256];
+ uint8_t m_acKeyboardState[256];
// Scrollbar
CLCDBar *m_pScrollbar = nullptr;