Skip to content

Commit 7b8beb4

Browse files
authored
Update SharedUtil.IntTypes.h
1 parent 924c920 commit 7b8beb4

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Shared/sdk/SharedUtil.IntTypes.h

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
/*****************************************************************************
22
*
3-
* PROJECT: Multi Theft Auto v1.0
3+
* PROJECT: Multi Theft Auto
44
* LICENSE: See LICENSE in the top level directory
5+
* FILE: Shared/sdk/SharedUtil.IntTypes.h
56
*
6-
* Multi Theft Auto is available from http://www.multitheftauto.com/
7+
* Multi Theft Auto is available from https://multitheftauto.com/
78
*
89
*****************************************************************************/
910

11+
#include <cstdint>
12+
1013
/*************************************************************************
1114
Simplification of some 'unsigned' types
1215
*************************************************************************/
1316
// VS GCC
1417
// Actual sizes: 32bit 64bit 64bit
15-
typedef unsigned long ulong; // 32 32 64
16-
typedef unsigned int uint; // 32
17-
typedef unsigned short ushort; // 16
18-
typedef unsigned char uchar; // 8
18+
using ulong = unsigned long; // 32 32 64
19+
using uint = std::uint32_t; // 32
20+
using ushort = std::uint16_t; // 16
21+
using uchar = std::uint8_t; // 8
1922

20-
typedef unsigned long long uint64; // 64
21-
typedef unsigned int uint32; // 32
22-
typedef unsigned short uint16; // 16
23-
typedef unsigned char uint8; // 8
23+
using uint64 = std::uint64_t; // 64
24+
using uint32 = std::uint32_t; // 32
25+
using uint16 = std::uint16_t; // 16
26+
using uint8 = std::uint8_t; // 8
2427

2528
// signed types
26-
typedef signed long long int64; // 64
27-
typedef signed int int32; // 32
28-
typedef signed short int16; // 16
29-
typedef signed char int8; // 8
29+
using int64 = std::int64_t; // 64
30+
using int32 = std::int32_t; // 32
31+
using int16 = std::int16_t; // 16
32+
using int8 = std::int8_t; // 8
3033

3134
// Windowsesq types
32-
typedef unsigned char BYTE; // 8
33-
typedef unsigned short WORD; // 16
34-
typedef unsigned long DWORD; // 32 32 64
35-
typedef float FLOAT; // 32
35+
using BYTE = std::uint8_t; // 8
36+
using WORD = std::uint16_t; // 16
37+
using DWORD = unsigned long; // 32 32 64
38+
using FLOAT = float; // 32
3639

3740
// Type: considerations:
3841
// a) long (and therefore DWORD) is 64 bits when compiled using 64 bit GCC

0 commit comments

Comments
 (0)