-
Notifications
You must be signed in to change notification settings - Fork 20
Commit eb961b9
Remove empty record types
SDL's API contains a lot of opaque data types, where the user is given
a pointer and is expected to never dereference it. Until now, we used
empty records to denote such types, and then defined pointer types to
said empty records. This commit removes all(*) the opaque types and
instead declares pointer types using the "type Pointer" notation.
This makes it clear that the user is expected not to use the "raw"
types, only pointer types, while maintaining type safety.
Check the discussion in the link below for more details
about the rationale behind this change.
#63
(*) units/sdl2_net.pas still contains some empty records.
However, that file is very messy right now and needs a proper rewrite.1 parent ce2065a commit eb961b9
File tree
13 files changed
+17
-35
lines changed- units
13 files changed
+17
-35
lines changedLines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 | - | ||
170 | - | ||
169 | + | ||
171 | 170 |
| |
172 | 171 |
| |
173 | 172 |
| |
| |||
241 | 240 |
| |
242 | 241 |
| |
243 | 242 |
| |
244 | - | ||
243 | + | ||
245 | 244 |
| |
246 | 245 |
| |
247 | 246 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
178 | - | ||
179 | - | ||
178 | + | ||
180 | 179 |
| |
181 | 180 |
| |
182 | 181 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
942 | 942 |
| |
943 | 943 |
| |
944 | 944 |
| |
945 | - | ||
946 | - | ||
945 | + | ||
947 | 946 |
| |
948 | 947 |
| |
949 | 948 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 | - | ||
19 | - | ||
18 | + | ||
20 | 19 |
| |
21 | 20 |
| |
22 | 21 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 | - | ||
97 | - | ||
96 | + | ||
98 | 97 |
| |
99 | 98 |
| |
100 | 99 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 | - | ||
46 | - | ||
45 | + | ||
47 | 46 |
| |
48 | 47 |
| |
49 | 48 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 | - | ||
34 | - | ||
33 | + | ||
35 | 34 |
| |
36 | 35 |
| |
37 | 36 |
| |
|
Lines changed: 2 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 | - | ||
95 | - | ||
96 | - | ||
94 | + | ||
97 | 95 |
| |
98 | 96 |
| |
99 | 97 |
| |
100 | 98 |
| |
101 | 99 |
| |
102 | - | ||
103 | - | ||
104 | - | ||
100 | + | ||
105 | 101 |
| |
106 | 102 |
| |
107 | 103 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 | - | ||
14 | - | ||
13 | + | ||
15 | 14 |
| |
16 | 15 |
| |
17 | 16 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
685 | 685 |
| |
686 | 686 |
| |
687 | 687 |
| |
688 | - | ||
689 | - | ||
688 | + | ||
690 | 689 |
| |
691 | 690 |
| |
692 | 691 |
| |
|
0 commit comments