bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thread: fix some gcc warnings


From: Bruno Haible
Subject: thread: fix some gcc warnings
Date: Fri, 8 Jul 2011 13:27:01 +0200
User-agent: KMail/1.9.9

The statement
  gl_thread_t t = gl_thread_self ();
gives a gcc warning about assignment from a pointer to an integer. This fixes
it:


2011-07-08  Bruno Haible  <address@hidden>

        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.

--- lib/glthread/thread.h.orig  Fri Jul  8 13:22:25 2011
+++ lib/glthread/thread.h       Fri Jul  8 13:11:25 2011
@@ -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)

-- 
In memoriam Jean Moulin <http://en.wikipedia.org/wiki/Jean_Moulin>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]