Skip to content

Commit b8989dd

Browse files
committed
Fix PSDL_Mutex, PSDL_Sem and PSDL_Cond definitions
Previously, these types were aliases to the un-typed pointer type, which meant that any pointer value could be assigned to them. They are now declared as distinct pointer types.
1 parent 4fe2132 commit b8989dd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

units/sdlmutex.inc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// based on "sdl_mutex.h" (2.0.14)
2-
{ TODO : Add type definitions (see todos below). }
32

43
{**
54
* Synchronization functions which can time out return this value
@@ -20,7 +19,7 @@ const
2019
type
2120
{*The SDL mutex structure, defined in SDL_sysmutex.c *}
2221
PPSDL_Mutex = ^PSDL_Mutex;
23-
PSDL_Mutex = Pointer; //todo!
22+
PSDL_Mutex = Type Pointer;
2423

2524
{**
2625
* Create a mutex, initialized unlocked.
@@ -71,7 +70,7 @@ procedure SDL_DestroyMutex(mutex: PSDL_Mutex); cdecl;
7170
type
7271
{* The SDL semaphore structure, defined in SDL_sem.c *}
7372
PPSDL_Sem = ^PSDL_Sem;
74-
PSDL_Sem = Pointer; //todo!
73+
PSDL_Sem = Type Pointer;
7574

7675
{**
7776
* Create a semaphore, initialized with value, returns NULL on failure.
@@ -128,15 +127,13 @@ function SDL_SemPost(sem: PSDL_Sem): cint; cdecl;
128127
function SDL_SemValue(sem: PSDL_Sem): cuint32; cdecl;
129128
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SemValue' {$ENDIF} {$ENDIF};
130129

131-
{*Semaphore functions*}
132-
133130
{**
134131
* Condition variable functions
135132
* }
136133
type
137134
{* The SDL condition variable structure, defined in SDL_cond.c *}
138135
PPSDL_Cond = ^PSDL_Cond;
139-
PSDL_Cond = Pointer; //todo!!
136+
PSDL_Cond = Type Pointer;
140137

141138
{**
142139
* Create a condition variable.

0 commit comments

Comments
 (0)