Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Twilight
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15*/
16#pragma once
17#include <cstdint>
18
42
46
47// Smallest variables unsigned
48using uvar8s = std::uint_least8_t;
49using uvar16s = std::uint_least16_t;
50using uvar32s = std::uint_least32_t;
51using uvar64s = std::uint_least64_t;
52
53// Smallest variables signed
54using svar8s = std::int_least8_t;
55using svar16s = std::int_least16_t;
56using svar32s = std::int_least32_t;
57using svar64s = std::int_least64_t;
58
59// Fastest variables unsigned
60using uvar8f = std::uint_fast8_t;
61using uvar16f = std::uint_fast16_t;
62using uvar32f = std::uint_fast32_t;
63using uvar64f = std::uint_fast64_t;
64
65// Fastest variables signed
66using svar8f = std::int_fast8_t;
67using svar16f = std::int_fast16_t;
68using svar32f = std::int_fast32_t;
69using svar64f = std::int_fast64_t;
70
71// Exact variables unsigned
72using uvar8e = std::uint8_t;
73using uvar16e = std::uint16_t;
74using uvar32e = std::uint32_t;
75using uvar64e = std::uint64_t;
76
77// Exact variables signed
78using svar8e = std::int8_t;
79using svar16e = std::int16_t;
80using svar32e = std::int32_t;
81using svar64e = std::int64_t;
82
86
87// Smallest variables default signing (Unsigned)
88using var8s = uvar8s;
89using var16s = uvar16s;
90using var32s = uvar32s;
91using var64s = uvar64s;
92
93// Fastest variables default signing (Unsigned)
94using var8f = uvar8f;
95using var16f = uvar16f;
96using var32f = uvar32f;
97using var64f = uvar64f;
98
99// Exact variables default signing (Unsigned)
100using var8e = uvar8e;
104
108
109using svar8 = svar8e;
113
114using uvar8 = uvar8e;
118
119// Default ratio (Smallest) variables default signing
120// In a different project a small bug was determined with pointers
121// When using "fastest" it often may choose "32-bit" whereby
122// An 8-bit pointer becomes a 32-bit pointer mistakenly but labeled as an
123// 8-bit pointer causing many potential bugs.
124using var8 = var8e;
125using var16 = var16e;
126using var32 = var32e;
127using var64 = var64e;
std::int16_t svar16e
Signed, exactly 16-bit (platform must support it).
Definition types.h:79
svar32e svar32
Signed, exactly 32-bit (shorthand for svar32e).
Definition types.h:111
uvar8e var8e
Exactly 8-bit, default (unsigned) signing.
Definition types.h:100
svar64e svar64
Signed, exactly 64-bit (shorthand for svar64e).
Definition types.h:112
std::uint16_t uvar16e
Unsigned, exactly 16-bit (platform must support it).
Definition types.h:73
uvar16f var16f
Fastest >=16-bit, default (unsigned) signing.
Definition types.h:95
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition types.h:124
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:125
uvar32f var32f
Fastest >=32-bit, default (unsigned) signing.
Definition types.h:96
std::int64_t svar64e
Signed, exactly 64-bit (platform must support it).
Definition types.h:81
std::int_least64_t svar64s
Signed, at least 64-bit, smallest such type.
Definition types.h:57
uvar32s var32s
Smallest >=32-bit, default (unsigned) signing.
Definition types.h:90
uvar64e uvar64
Unsigned, exactly 64-bit (shorthand for uvar64e).
Definition types.h:117
std::int_fast64_t svar64f
Signed, at least 64-bit, fastest such type.
Definition types.h:69
std::uint_least16_t uvar16s
Unsigned, at least 16-bit, smallest such type.
Definition types.h:49
var32e var32
Everyday 32-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:126
std::int_least8_t svar8s
Signed, at least 8-bit, smallest such type.
Definition types.h:54
svar16e svar16
Signed, exactly 16-bit (shorthand for svar16e).
Definition types.h:110
uvar64s var64s
Smallest >=64-bit, default (unsigned) signing.
Definition types.h:91
uvar8s var8s
Shorthand with default assumptions.
Definition types.h:88
uvar32e uvar32
Unsigned, exactly 32-bit (shorthand for uvar32e).
Definition types.h:116
uvar32e var32e
Exactly 32-bit, default (unsigned) signing.
Definition types.h:102
std::uint_least8_t uvar8s
Fully Detailed.
Definition types.h:48
std::int_least16_t svar16s
Signed, at least 16-bit, smallest such type.
Definition types.h:55
var64e var64
Everyday 64-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:127
std::uint8_t uvar8e
Unsigned, exactly 8-bit (platform must support it).
Definition types.h:72
uvar16e var16e
Exactly 16-bit, default (unsigned) signing.
Definition types.h:101
std::uint_least64_t uvar64s
Unsigned, at least 64-bit, smallest such type.
Definition types.h:51
std::uint_fast8_t uvar8f
Unsigned, at least 8-bit, fastest such type.
Definition types.h:60
std::int_fast8_t svar8f
Signed, at least 8-bit, fastest such type.
Definition types.h:66
std::int8_t svar8e
Signed, exactly 8-bit (platform must support it).
Definition types.h:78
svar8e svar8
Smaller Shorthand with most default assumptions.
Definition types.h:109
std::uint_least32_t uvar32s
Unsigned, at least 32-bit, smallest such type.
Definition types.h:50
uvar64e var64e
Exactly 64-bit, default (unsigned) signing.
Definition types.h:103
std::uint_fast16_t uvar16f
Unsigned, at least 16-bit, fastest such type.
Definition types.h:61
uvar64f var64f
Fastest >=64-bit, default (unsigned) signing.
Definition types.h:97
std::uint_fast32_t uvar32f
Unsigned, at least 32-bit, fastest such type.
Definition types.h:62
std::uint64_t uvar64e
Unsigned, exactly 64-bit (platform must support it).
Definition types.h:75
std::int_fast32_t svar32f
Signed, at least 32-bit, fastest such type.
Definition types.h:68
uvar8e uvar8
Unsigned, exactly 8-bit (shorthand for uvar8e).
Definition types.h:114
std::int_fast16_t svar16f
Signed, at least 16-bit, fastest such type.
Definition types.h:67
uvar8f var8f
Fastest >=8-bit, default (unsigned) signing.
Definition types.h:94
std::uint32_t uvar32e
Unsigned, exactly 32-bit (platform must support it).
Definition types.h:74
std::int_least32_t svar32s
Signed, at least 32-bit, smallest such type.
Definition types.h:56
uvar16s var16s
Smallest >=16-bit, default (unsigned) signing.
Definition types.h:89
std::int32_t svar32e
Signed, exactly 32-bit (platform must support it).
Definition types.h:80
std::uint_fast64_t uvar64f
Unsigned, at least 64-bit, fastest such type.
Definition types.h:63
uvar16e uvar16
Unsigned, exactly 16-bit (shorthand for uvar16e).
Definition types.h:115