From: Mathieu Desnoyers Date: Fri, 6 Feb 2009 02:47:01 +0000 (-0500) Subject: remove ugly gcc warning removal ack, simply cast the caller parameter X-Git-Tag: v0.1~324 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cdcb92bbb9e54201e0982844e3ca9cb4fd9b31e5;p=userspace-rcu.git remove ugly gcc warning removal ack, simply cast the caller parameter --- diff --git a/test_urcu.c b/test_urcu.c index 2b34798..17061f8 100644 --- a/test_urcu.c +++ b/test_urcu.c @@ -82,7 +82,7 @@ void *thr_writer(void *arg) new->a = 8; new->b = 12; new->c[55] = 2; - old = urcu_publish_content(&test_rcu_pointer, new); + old = urcu_publish_content((void **)&test_rcu_pointer, new); rcu_write_unlock(); /* can be done after unlock */ if (old) { diff --git a/urcu.c b/urcu.c index e258d96..d0d6138 100644 --- a/urcu.c +++ b/urcu.c @@ -117,7 +117,7 @@ void wait_for_quiescent_state(int parity) * Return old pointer, OK to free, no more reference exist. * Called under rcu_write_lock. */ -void *_urcu_publish_content(void **ptr, void *new) +void *urcu_publish_content(void **ptr, void *new) { int prev_parity; void *oldptr; diff --git a/urcu.h b/urcu.h index 3c5b178..9431da5 100644 --- a/urcu.h +++ b/urcu.h @@ -104,13 +104,7 @@ static inline void rcu_read_unlock(int urcu_parity) extern void rcu_write_lock(void); extern void rcu_write_unlock(void); -extern void *_urcu_publish_content(void **ptr, void *new); - -/* - * gcc does not like automatic &struct ... * -> void **. - * Remove the warning. (hopefully this is ok) - */ -#define urcu_publish_content(ptr, new) _urcu_publish_content((void **)ptr, new) +extern void *urcu_publish_content(void **ptr, void *new); /* * Reader thread registration.