From 8ea20cf6daf85c2e86aa7df625acc90ee6b03aae Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 10 Jan 2025 18:42:34 -0500 Subject: [PATCH] refactor: replace SInt8 with int8_t --- src/lib/client/ServerProxy.cpp | 6 +++--- src/lib/common/basic_types.h | 1 - src/lib/platform/OSXScreen.h | 2 +- src/lib/platform/OSXScreen.mm | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index 5f65806d6..1bbeb9f15 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -652,7 +652,7 @@ void ServerProxy::mouseDown() flushCompressedMouse(); // parse - SInt8 id; + int8_t id; ProtocolUtil::readf(m_stream, kMsgDMouseDown + 4, &id); LOG((CLOG_DEBUG1 "recv mouse down id=%d", id)); @@ -666,7 +666,7 @@ void ServerProxy::mouseUp() flushCompressedMouse(); // parse - SInt8 id; + int8_t id; ProtocolUtil::readf(m_stream, kMsgDMouseUp + 4, &id); LOG((CLOG_DEBUG1 "recv mouse up id=%d", id)); @@ -752,7 +752,7 @@ void ServerProxy::mouseWheel() void ServerProxy::screensaver() { // parse - SInt8 on; + int8_t on; ProtocolUtil::readf(m_stream, kMsgCScreenSaver + 4, &on); LOG((CLOG_DEBUG1 "recv screen saver on=%d", on)); diff --git a/src/lib/common/basic_types.h b/src/lib/common/basic_types.h index 90ec2c0f4..665fcc5bd 100644 --- a/src/lib/common/basic_types.h +++ b/src/lib/common/basic_types.h @@ -84,7 +84,6 @@ #if defined(__APPLE__) #include #else -using SInt8 = signed TYPE_OF_SIZE_1; using SInt16 = signed TYPE_OF_SIZE_2; using SInt32 = signed TYPE_OF_SIZE_4; using UInt8 = unsigned TYPE_OF_SIZE_1; diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h index 1a28dd967..32d112d67 100644 --- a/src/lib/platform/OSXScreen.h +++ b/src/lib/platform/OSXScreen.h @@ -236,7 +236,7 @@ private: void overwrite(UInt32 buttons); bool test(UInt32 button) const; - SInt8 getFirstButtonDown() const; + int8_t getFirstButtonDown() const; private: std::bitset m_buttons; diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index 94bda0254..c9d86a5ef 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -468,7 +468,7 @@ void OSXScreen::postMouseEvent(CGPoint &pos) const CGEventType type = kCGEventMouseMoved; - SInt8 button = m_buttonState.getFirstButtonDown(); + int8_t button = m_buttonState.getFirstButtonDown(); if (button != -1) { MouseButtonEventMapType thisButtonType = MouseButtonEventMap[button]; type = thisButtonType[kMouseButtonDragged]; @@ -1883,7 +1883,7 @@ bool OSXScreen::MouseButtonState::test(UInt32 button) const return m_buttons.test(button); } -SInt8 OSXScreen::MouseButtonState::getFirstButtonDown() const +int8_t OSXScreen::MouseButtonState::getFirstButtonDown() const { if (m_buttons.any()) { for (unsigned short button = 0; button < m_buttons.size(); button++) {