]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: fix warning
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 Jan 2018 16:17:49 +0000 (17:17 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 27 Jan 2018 16:17:49 +0000 (17:17 +0100)
timer_ptr2id and timer_id2ptr are used to convert between
application-visible timer_t and struct timer_node *. timer_ptr2id was made
to use void * instead of timer_t in 49b650430eb5 ('Update.') for no reason.
It happens that on Linux timer_t is void *, so both that change and this
commit are no-ops there, but not on systems where timer_t is not void *.

Using timer_ptr2id for filling sival_ptr also does not make sense since that
actually is a void *.

* sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t
instead of void *.
* sysdeps/pthread/timer_create.c (timer_create): Do not use
timer_ptr2id to cast struct timer_node * to void *.

ChangeLog
sysdeps/pthread/posix-timer.h
sysdeps/pthread/timer_create.c

index f2a771781e9a930c41abe8e9c8aebfd6f28cdc0b..497b00f65a48bd90e6d1c513cac765b97af296c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        return 0.
        * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Cast
        vm_address_t * to ElfW(Addr) * for dl_main parameter.
+       * sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t
+       instead of void *.
+       * sysdeps/pthread/timer_create.c (timer_create): Do not use
+       timer_ptr2id to cast struct timer_node * to void *.
 
 2018-01-27  James Clarke  <jrtc27@jrtc27.com>
 
index 82311706d839a106ab35bc22ceb946a792da1493..d7af9a017a974a9e8bdb120618548f047157aada 100644 (file)
@@ -87,7 +87,7 @@ extern struct thread_node __timer_signal_thread_rclk;
 
 /* Return pointer to timer structure corresponding to ID.  */
 #define timer_id2ptr(timerid) ((struct timer_node *) timerid)
-#define timer_ptr2id(timerid) ((void *) timerid)
+#define timer_ptr2id(timerid) ((timer_t) timerid)
 
 /* Check whether timer is valid; global mutex must be held. */
 static inline int
index 1c80e6162f6d986e593efc80dc44af6142cf2d7d..2381a60d6f685be53a2aefe369c6c9e6d4ac1551 100644 (file)
@@ -77,7 +77,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
     {
       newtimer->event.sigev_notify = SIGEV_SIGNAL;
       newtimer->event.sigev_signo = SIGALRM;
-      newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer);
+      newtimer->event.sigev_value.sival_ptr = newtimer;
       newtimer->event.sigev_notify_function = 0;
     }