changeset 15372:78e3e681012d

thread: Avoid gcc warnings when using gl_thread_self(). * lib/glthread/thread.h (gl_thread_self): Return a pthread_t, not a 'void *'. (gl_thread_self_pointer): Update.
author Bruno Haible <bruno@clisp.org>
date Fri, 08 Jul 2011 13:25:16 +0200
parents 90ac6874ff8e
children 335a77ae4731
files ChangeLog lib/glthread/thread.h
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-08  Bruno Haible  <bruno@clisp.org>
+
+	thread: Avoid gcc warnings when using gl_thread_self().
+	* lib/glthread/thread.h (gl_thread_self): Return a pthread_t, not a
+	'void *'.
+	(gl_thread_self_pointer): Update.
+
 2011-07-07  Bruno Haible  <bruno@clisp.org>
 
 	signal-c++-tests: Check declaration of pthread_sigmask.
--- a/lib/glthread/thread.h
+++ b/lib/glthread/thread.h
@@ -161,9 +161,9 @@
 extern const gl_thread_t gl_null_thread;
 # else
 #  define gl_thread_self() \
-     (pthread_in_use () ? (void *) pthread_self () : NULL)
+     (pthread_in_use () ? pthread_self () : (pthread_t) NULL)
 #  define gl_thread_self_pointer() \
-     gl_thread_self ()
+     (pthread_in_use () ? (void *) pthread_self () : NULL)
 # endif
 # define gl_thread_exit(RETVAL) \
     (pthread_in_use () ? pthread_exit (RETVAL) : 0)