changeset 14900:5a8dec171b5a

thread: Fix confusion between NULL and 0. * lib/glthread/thread.h (gl_thread_self): Use NULL and 0 appropriately. Reported by Paul Eggert.
author Bruno Haible <bruno@clisp.org>
date Thu, 09 Jun 2011 12:55:09 +0200
parents 5ac43decc87c
children 4b26d9ce6840
files ChangeLog lib/glthread/thread.h
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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>
 
 	spawn-pipe tests: Avoid test failure on HP-UX 11.
--- a/lib/glthread/thread.h
+++ b/lib/glthread/thread.h
@@ -205,7 +205,7 @@
 # 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 @@
 # 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 @@
 # 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