From 7b8beb41cf4d9649cc039f25d7be94366188bb42 Mon Sep 17 00:00:00 2001 From: G-Moris Date: Sun, 2 Mar 2025 11:35:23 +0300 Subject: [PATCH 1/2] Update SharedUtil.IntTypes.h --- Shared/sdk/SharedUtil.IntTypes.h | 39 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/Shared/sdk/SharedUtil.IntTypes.h b/Shared/sdk/SharedUtil.IntTypes.h index 2462590cc53..5fad877b057 100644 --- a/Shared/sdk/SharedUtil.IntTypes.h +++ b/Shared/sdk/SharedUtil.IntTypes.h @@ -1,38 +1,41 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory + * FILE: Shared/sdk/SharedUtil.IntTypes.h * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ +#include + /************************************************************************* Simplification of some 'unsigned' types *************************************************************************/ // VS GCC // Actual sizes: 32bit 64bit 64bit -typedef unsigned long ulong; // 32 32 64 -typedef unsigned int uint; // 32 -typedef unsigned short ushort; // 16 -typedef unsigned char uchar; // 8 +using ulong = unsigned long; // 32 32 64 +using uint = std::uint32_t; // 32 +using ushort = std::uint16_t; // 16 +using uchar = std::uint8_t; // 8 -typedef unsigned long long uint64; // 64 -typedef unsigned int uint32; // 32 -typedef unsigned short uint16; // 16 -typedef unsigned char uint8; // 8 +using uint64 = std::uint64_t; // 64 +using uint32 = std::uint32_t; // 32 +using uint16 = std::uint16_t; // 16 +using uint8 = std::uint8_t; // 8 // signed types -typedef signed long long int64; // 64 -typedef signed int int32; // 32 -typedef signed short int16; // 16 -typedef signed char int8; // 8 +using int64 = std::int64_t; // 64 +using int32 = std::int32_t; // 32 +using int16 = std::int16_t; // 16 +using int8 = std::int8_t; // 8 // Windowsesq types -typedef unsigned char BYTE; // 8 -typedef unsigned short WORD; // 16 -typedef unsigned long DWORD; // 32 32 64 -typedef float FLOAT; // 32 +using BYTE = std::uint8_t; // 8 +using WORD = std::uint16_t; // 16 +using DWORD = unsigned long; // 32 32 64 +using FLOAT = float; // 32 // Type: considerations: // a) long (and therefore DWORD) is 64 bits when compiled using 64 bit GCC From 5c41e09939912181e47d2ba93d4ea4eb23a0cd5a Mon Sep 17 00:00:00 2001 From: G-Moris Date: Sun, 2 Mar 2025 11:56:46 +0300 Subject: [PATCH 2/2] Update sha2.h --- Shared/sdk/sha2.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Shared/sdk/sha2.h b/Shared/sdk/sha2.h index 2c0e59b20e5..a8c4878f750 100644 --- a/Shared/sdk/sha2.h +++ b/Shared/sdk/sha2.h @@ -31,6 +31,8 @@ * SUCH DAMAGE. */ +#include + #ifndef SHA2_H #define SHA2_H @@ -46,9 +48,9 @@ #ifndef SHA2_TYPES #define SHA2_TYPES -typedef unsigned char uint8; -typedef unsigned int uint32; -typedef unsigned long long uint64; +using uint8 = std::uint8_t; +using uint32 = std::uint32_t; +using uint64 = std::uint64_t; #endif #ifdef __cplusplus