thread: Fix confusion between NULL and 0.
authorBruno Haible <bruno@clisp.org>
Thu, 9 Jun 2011 10:55:09 +0000 (12:55 +0200)
committerIan Beckwith <ianb@erislabs.net>
Fri, 10 Jun 2011 01:00:32 +0000 (02:00 +0100)
* lib/glthread/thread.h (gl_thread_self): Use NULL and 0 appropriately.
Reported by Paul Eggert.
(cherry picked from commit 5f0441a0bef4d7a8af4e3ba8b24a948e5cccd71c)

ChangeLog
lib/glthread/thread.h

index aee35e1..f26d2c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-06-09  Bruno Haible  <bruno@clisp.org>
 
+       thread: Fix confusion between NULL and 0.
+       * lib/glthread/thread.h (gl_thread_self): Use NULL and 0 appropriately.
+       Reported by Paul Eggert.
+
+2011-06-09  Bruno Haible  <bruno@clisp.org>
+
        acl tests: Fix compilation error on HP-UX 11.
        * tests/test-sameacls.c: Include <sys/acl.h> also on HP-UX.
 
index 5d72040..a0d40f8 100644 (file)
@@ -205,7 +205,7 @@ typedef pth_t gl_thread_t;
 # define glthread_join(THREAD, RETVALP) \
     (pth_in_use () && !pth_join (THREAD, RETVALP) ? errno : 0)
 # define gl_thread_self() \
-    (pth_in_use () ? (void *) pth_self () : 0)
+    (pth_in_use () ? (void *) pth_self () : NULL)
 # define gl_thread_exit(RETVAL) \
     (pth_in_use () ? pth_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
@@ -257,7 +257,7 @@ typedef thread_t gl_thread_t;
 # define glthread_join(THREAD, RETVALP) \
     (thread_in_use () ? thr_join (THREAD, NULL, RETVALP) : 0)
 # define gl_thread_self() \
-    (thread_in_use () ? (void *) thr_self () : 0)
+    (thread_in_use () ? (void *) thr_self () : NULL)
 # define gl_thread_exit(RETVAL) \
     (thread_in_use () ? thr_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
@@ -322,7 +322,7 @@ typedef int gl_thread_t;
 # define glthread_create(THREADP, FUNC, ARG) ENOSYS
 # define glthread_sigmask(HOW, SET, OSET) 0
 # define glthread_join(THREAD, RETVALP) 0
-# define gl_thread_self() NULL
+# define gl_thread_self() 0
 # define gl_thread_exit(RETVAL) 0
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0