From 793f40e582ece4a85887f4ede78280f9fa0e81bc Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 10 Jan 2025 21:14:00 -0500 Subject: [PATCH] chore: remove basic_types.h --- src/lib/arch/IArchString.h | 2 +- src/lib/base/Event.h | 2 +- src/lib/base/IEventQueueBuffer.h | 2 +- src/lib/base/Unicode.h | 2 +- src/lib/base/log_outputters.h | 2 +- src/lib/client/HelloBack.h | 2 +- src/lib/common/CMakeLists.txt | 1 - src/lib/common/basic_types.h | 95 -------------------- src/lib/common/common.h | 8 ++ src/lib/common/ipc.h | 2 +- src/lib/deskflow/Chunk.h | 2 +- src/lib/deskflow/ClipboardChunk.h | 2 +- src/lib/deskflow/FileChunk.h | 2 +- src/lib/deskflow/clipboard_types.h | 2 +- src/lib/deskflow/key_types.h | 2 +- src/lib/mt/CondVar.h | 2 +- src/lib/net/XSocket.h | 2 +- src/lib/platform/XWindowsClipboard.cpp | 2 +- src/test/unittests/client/HelloBackTests.cpp | 2 +- 19 files changed, 24 insertions(+), 112 deletions(-) delete mode 100644 src/lib/common/basic_types.h diff --git a/src/lib/arch/IArchString.h b/src/lib/arch/IArchString.h index 6f7bd74dc..c8e4d0cbc 100644 --- a/src/lib/arch/IArchString.h +++ b/src/lib/arch/IArchString.h @@ -19,7 +19,7 @@ #pragma once #include "common/IInterface.h" -#include "common/basic_types.h" +#include "common/common.h" #include diff --git a/src/lib/base/Event.h b/src/lib/base/Event.h index 3907ea38e..d8a5259f7 100644 --- a/src/lib/base/Event.h +++ b/src/lib/base/Event.h @@ -18,7 +18,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include "common/stdmap.h" class EventData diff --git a/src/lib/base/IEventQueueBuffer.h b/src/lib/base/IEventQueueBuffer.h index d63bda1b4..cb259f5fd 100644 --- a/src/lib/base/IEventQueueBuffer.h +++ b/src/lib/base/IEventQueueBuffer.h @@ -19,7 +19,7 @@ #pragma once #include "common/IInterface.h" -#include "common/basic_types.h" +#include "common/common.h" class Event; class EventQueueTimer; diff --git a/src/lib/base/Unicode.h b/src/lib/base/Unicode.h index 27d565b6d..054d2eb51 100644 --- a/src/lib/base/Unicode.h +++ b/src/lib/base/Unicode.h @@ -19,7 +19,7 @@ #pragma once #include "arch/IArchString.h" -#include "common/basic_types.h" +#include "common/common.h" #include //! Unicode utility functions diff --git a/src/lib/base/log_outputters.h b/src/lib/base/log_outputters.h index d795bae7e..92c81ae5e 100644 --- a/src/lib/base/log_outputters.h +++ b/src/lib/base/log_outputters.h @@ -19,7 +19,7 @@ #pragma once #include "base/ILogOutputter.h" -#include "common/basic_types.h" +#include "common/common.h" #include "common/stddeque.h" #include "mt/Thread.h" diff --git a/src/lib/client/HelloBack.h b/src/lib/client/HelloBack.h index 2c7679446..11e882f41 100644 --- a/src/lib/client/HelloBack.h +++ b/src/lib/client/HelloBack.h @@ -7,7 +7,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include "deskflow/protocol_types.h" #include "io/IStream.h" diff --git a/src/lib/common/CMakeLists.txt b/src/lib/common/CMakeLists.txt index 2648f7f7b..ec26b3c0b 100644 --- a/src/lib/common/CMakeLists.txt +++ b/src/lib/common/CMakeLists.txt @@ -6,7 +6,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) configure_file(constants.h.in constants.h @ONLY) add_library(common INTERFACE - basic_types.h common.h IInterface.h ipc.h diff --git a/src/lib/common/basic_types.h b/src/lib/common/basic_types.h deleted file mode 100644 index ab1c85fef..000000000 --- a/src/lib/common/basic_types.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * Copyright (C) 2012-2016 Symless Ltd. - * Copyright (C) 2002 Chris Schoeneman - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "common.h" - -// VC++ has built-in sized types -// moved from common.h (why was it there?) -#if defined(_MSC_VER) -#include -#define TYPE_OF_SIZE_1 __int8 -#define TYPE_OF_SIZE_2 __int16 -#define TYPE_OF_SIZE_4 __int32 -#endif - -// -// pick types of particular sizes -// - -#if !defined(TYPE_OF_SIZE_1) -#if SIZEOF_CHAR == 1 -#define TYPE_OF_SIZE_1 char -#endif -#endif - -#if !defined(TYPE_OF_SIZE_2) -#if SIZEOF_INT == 2 -#define TYPE_OF_SIZE_2 int -#else -#define TYPE_OF_SIZE_2 short -#endif -#endif - -#if !defined(TYPE_OF_SIZE_4) -// Carbon defines SInt32 and UInt32 in terms of long -#if SIZEOF_INT == 4 && !defined(__APPLE__) -#define TYPE_OF_SIZE_4 int -#else -#define TYPE_OF_SIZE_4 long -#endif -#endif - -// -// verify existence of required types -// - -#if !defined(TYPE_OF_SIZE_1) -#error No 1 byte integer type -#endif -#if !defined(TYPE_OF_SIZE_2) -#error No 2 byte integer type -#endif -#if !defined(TYPE_OF_SIZE_4) -#error No 4 byte integer type -#endif - -// -// make typedefs -// -// except for SInt8 and UInt8 these types are only guaranteed to be -// at least as big as indicated (in bits). that is, they may be -// larger than indicated. -// - -// Added this because it doesn't compile on OS X 10.6 because they are already -// defined in Carbon -#if !defined(__MACTYPES__) -#if defined(__APPLE__) -#include -#else -#endif -#endif -// -// clean up -// - -#undef TYPE_OF_SIZE_1 -#undef TYPE_OF_SIZE_2 -#undef TYPE_OF_SIZE_4 diff --git a/src/lib/common/common.h b/src/lib/common/common.h index a2e5fc512..3b4a0c997 100644 --- a/src/lib/common/common.h +++ b/src/lib/common/common.h @@ -36,6 +36,14 @@ #include #include +// defined in Carbon +#if !defined(__MACTYPES__) +#if defined(__APPLE__) +#include +#else +#endif +#endif + enum { kExitSuccess = 0, // successful completion diff --git a/src/lib/common/ipc.h b/src/lib/common/ipc.h index d5a857cf1..b97148910 100644 --- a/src/lib/common/ipc.h +++ b/src/lib/common/ipc.h @@ -17,7 +17,7 @@ #pragma once -#include "basic_types.h" +#include "common.h" enum class IpcMessageType : uint8_t { diff --git a/src/lib/deskflow/Chunk.h b/src/lib/deskflow/Chunk.h index 2d2725197..7d3020a21 100644 --- a/src/lib/deskflow/Chunk.h +++ b/src/lib/deskflow/Chunk.h @@ -17,7 +17,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include class Chunk : public EventData diff --git a/src/lib/deskflow/ClipboardChunk.h b/src/lib/deskflow/ClipboardChunk.h index fcaab3c72..5b5c45194 100644 --- a/src/lib/deskflow/ClipboardChunk.h +++ b/src/lib/deskflow/ClipboardChunk.h @@ -17,7 +17,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include "deskflow/Chunk.h" #include "deskflow/clipboard_types.h" diff --git a/src/lib/deskflow/FileChunk.h b/src/lib/deskflow/FileChunk.h index d3613090a..17121f9a3 100644 --- a/src/lib/deskflow/FileChunk.h +++ b/src/lib/deskflow/FileChunk.h @@ -17,7 +17,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include "deskflow/Chunk.h" #include diff --git a/src/lib/deskflow/clipboard_types.h b/src/lib/deskflow/clipboard_types.h index c3dad4e4c..b3334a236 100644 --- a/src/lib/deskflow/clipboard_types.h +++ b/src/lib/deskflow/clipboard_types.h @@ -18,7 +18,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" //! Clipboard ID /*! diff --git a/src/lib/deskflow/key_types.h b/src/lib/deskflow/key_types.h index 4cba6d62e..a64753945 100644 --- a/src/lib/deskflow/key_types.h +++ b/src/lib/deskflow/key_types.h @@ -18,7 +18,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" //! Key ID /*! diff --git a/src/lib/mt/CondVar.h b/src/lib/mt/CondVar.h index 3ebbdf818..25b3d96a0 100644 --- a/src/lib/mt/CondVar.h +++ b/src/lib/mt/CondVar.h @@ -18,7 +18,7 @@ #pragma once -#include "common/basic_types.h" +#include "common/common.h" #include "mt/Mutex.h" class Stopwatch; diff --git a/src/lib/net/XSocket.h b/src/lib/net/XSocket.h index 820fcb3bb..83d315cd9 100644 --- a/src/lib/net/XSocket.h +++ b/src/lib/net/XSocket.h @@ -19,7 +19,7 @@ #pragma once #include "base/XBase.h" -#include "common/basic_types.h" +#include "common/common.h" #include "io/XIO.h" //! Generic socket exception diff --git a/src/lib/platform/XWindowsClipboard.cpp b/src/lib/platform/XWindowsClipboard.cpp index 07da9003e..0853bc49e 100644 --- a/src/lib/platform/XWindowsClipboard.cpp +++ b/src/lib/platform/XWindowsClipboard.cpp @@ -21,7 +21,7 @@ #include "arch/Arch.h" #include "base/Log.h" #include "base/Stopwatch.h" -#include "common/basic_types.h" +#include "common/common.h" #include "common/stdvector.h" #include "platform/XWindowsClipboardBMPConverter.h" #include "platform/XWindowsClipboardHTMLConverter.h" diff --git a/src/test/unittests/client/HelloBackTests.cpp b/src/test/unittests/client/HelloBackTests.cpp index 99bfe9832..82c1c483a 100644 --- a/src/test/unittests/client/HelloBackTests.cpp +++ b/src/test/unittests/client/HelloBackTests.cpp @@ -7,7 +7,7 @@ #include "client/HelloBack.h" -#include "common/basic_types.h" +#include "common/common.h" #include "mock/io/MockStream.h" #include