|
1 | 1 | /***************************************************************************** |
2 | 2 | * |
3 | | - * PROJECT: Multi Theft Auto v1.0 |
| 3 | + * PROJECT: Multi Theft Auto |
4 | 4 | * LICENSE: See LICENSE in the top level directory |
| 5 | + * FILE: Shared/sdk/SharedUtil.IntTypes.h |
5 | 6 | * |
6 | | - * Multi Theft Auto is available from http://www.multitheftauto.com/ |
| 7 | + * Multi Theft Auto is available from https://multitheftauto.com/ |
7 | 8 | * |
8 | 9 | *****************************************************************************/ |
9 | 10 |
|
| 11 | +#include <cstdint> |
| 12 | + |
10 | 13 | /************************************************************************* |
11 | 14 | Simplification of some 'unsigned' types |
12 | 15 | *************************************************************************/ |
13 | 16 | // VS GCC |
14 | 17 | // 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 |
19 | 22 |
|
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 |
24 | 27 |
|
25 | 28 | // 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 |
30 | 33 |
|
31 | 34 | // 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 |
36 | 39 |
|
37 | 40 | // Type: considerations: |
38 | 41 | // a) long (and therefore DWORD) is 64 bits when compiled using 64 bit GCC |
|
0 commit comments