]> pd.if.org Git - pdclib/commitdiff
win32: Fix warnings relating to definition of LONG and use of InterlockedCompareExchange
authorOwen Shepherd <owen.shepherd@e43.eu>
Thu, 15 Nov 2012 20:33:02 +0000 (20:33 +0000)
committerOwen Shepherd <owen.shepherd@e43.eu>
Thu, 15 Nov 2012 20:33:02 +0000 (20:33 +0000)
platform/win32/functions/threads/mtx_lock.c
platform/win32/functions/threads/mtx_timedlock.c
platform/win32/functions/threads/mtx_trylock.c
platform/win32/internals/_PDCLIB_threadconfig.h

index 59e716dc0232c0f56e3584b1d867705e1dcbbf64..d16a487b70d26622cb6f6b6eb2dec2340d04e891 100644 (file)
@@ -6,7 +6,7 @@ int mtx_lock(mtx_t *mtx)
 {\r
     DWORD myId = GetCurrentThreadId();\r
 \r
-    if(mtx->_ThreadId == myId) {\r
+    if(mtx->_ThreadId == (long) myId) {\r
         mtx->_NestCount++;\r
         return thrd_success;\r
     }\r
index 07edc0c82e0463c7beedc2b8198f5fb4f9600130..5c1ffb30f41f18dd1f1568243b893a70038a8f36 100644 (file)
@@ -8,7 +8,7 @@ int mtx_timedlock(mtx_t *_PDCLIB_restrict mtx,
 {\r
     DWORD myId = GetCurrentThreadId();\r
 \r
-    if(mtx->_ThreadId == myId) {\r
+    if(mtx->_ThreadId == (long) myId) {\r
         mtx->_NestCount++;\r
         return thrd_success;\r
     }\r
index ebc5e85c3c3fbf806203756533b55c938947ad15..c5fce0efbd373f43a56b9d7fc6474b7a01e03b63 100644 (file)
@@ -6,7 +6,7 @@ int mtx_trylock(mtx_t *mtx)
 {\r
     DWORD myId = GetCurrentThreadId();\r
 \r
-    if(mtx->_ThreadId == myId) {\r
+    if(mtx->_ThreadId == (long) myId) {\r
         mtx->_NestCount++;\r
         return thrd_success;\r
     }\r
index c311867e871297fac957528bc1d664090ba86a80..0f35d294f94e54632cb6235785fa54b81ea75a6f 100644 (file)
@@ -20,7 +20,7 @@ void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));
 \r
 struct _PDCLIB_mtx {\r
     void                   * _WaitEvHandle;\r
-    volatile unsigned long   _ThreadId; \r
+    volatile          long   _ThreadId; \r
     volatile unsigned  int   _NestCount;\r
 };\r
 \r