blob: eb1e476a80c8055e8bf2356bb7739120baf7d0e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
const uint8 u8_min = 0;
const uint8 u8_max = 255;
const int8 i8_min = -128;
const int8 i8_max = 127;
const uint16 u16_max = 65535;
const int16 i16_min = -32768;
const int16 i16_max = 32767;
const uint32 u32_max = 4294967295;
const int32 i32_min = -2147483648;
const int32 i32_max = 2147483647;
const uint64 u64_max = 18446744073709551615;
const int64 i64_min = -9223372036854775808;
const int64 i64_max = 9223372036854775807;
const uint8 u8_min_overflow = u8_min - 1; // == u8_max
const int8 i8_min_overflow = i8_min - 1; // == i8_max
const uint8 u8_max_overflow = u8_max + 1; // == 0
const int8 i8_max_overflow = i8_max + 1; // == i8_min
const uint8 u8_max_negate = ~u8_max; // == 0
const int8 i8_max_negate = ~i8_max; // == i8_min
const uint8 u8_e1 = 2;
const uint8 u8_e2 = u8_e1 + 2;
const uint8 u8_e3 = u8_e2 * 3;
const uint8 u8_e4 = u8_e3 / 4;
const uint8 u8_e5 = u8_e4 | 5;
const uint8 u8_e6 = u8_e5 ^ 6;
const uint8 u8_e7 = u8_e6 & 7;
const uint8 u8_e8 = u8_e7 << 4;
const uint8 u8_e9 = u8_e8 >> 1;
const int8 i8_e1 = -2;
const int8 i8_e2 = i8_e1 - -6;
const int8 i8_e3 = i8_e2 * 3;
const int8 i8_e4 = i8_e3 / 4;
const int8 i8_e5 = i8_e4 | 5;
const int8 i8_e6 = i8_e5 ^ 6;
const int8 i8_e7 = i8_e6 & 7;
const int8 i8_e8 = i8_e7 << 4;
const int8 i8_e9 = i8_e8 >> 1;
struct StructWithInts {
uint8 u8;
int8 i8;
uint16 u16;
int16 i16;
uint32 u32;
int32 i32;
uint64 u64;
int64 i64;
};
union UnionOverU8 switch (uint8) {
case 0:
uint8 u8;
case 1:
int8 i8;
};
union UnionOverI8 switch (int8) {
case 0:
uint8 u8;
case 1:
int8 i8;
};
|