Fix: assignment from incompatible pointer type warnings
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 Fix: assignment from incompatible pointer type warnings
On some platforms, mmap returns a caddr_t pointer which generates compiler warnings, cast to the proper pointer type to eliminate them.
Signed-off-by Michael Jeanson <[email protected]>
--- src/urcu-bp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
src/urcu-bp.c +5 -3
@@ -374,7 +374,8 @@ void expand_arena(struct registry_arena *arena)sizeof (struct registry_chunk ) + sizeof(struct rcu_reader)); new_chunk_len =ARENA_INIT_ALLOC ; - new_chunk =mmap (NULL , new_chunk_len, + new_chunk = (struct registry_chunk *)mmap (NULL , + new_chunk_len,PROT_READ |PROT_WRITE ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );
@@ -408,7 +409,8 @@ void expand_arena(struct registry_arena *arena) }/* Remap did not succeed, we need to add a new chunk. */ - new_chunk =mmap (NULL , new_chunk_len, + new_chunk = (struct registry_chunk *)mmap (NULL , + new_chunk_len,PROT_READ |PROT_WRITE ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );
@@ -625,7 +627,7 @@ void rcu_bp_exit(void)cds_list_for_each_entry_safe (chunk, tmp, ®istry_arena.chunk_list, node) { -munmap (chunk, chunk->data_len +munmap ((void *) chunk, chunk->data_len +sizeof (struct registry_chunk )); }CDS_INIT_LIST_HEAD (®istry_arena.chunk_list);
Signature · 6 lines
2.7.4 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
PATCH 3/3 Tests fix: add missing Cygwin thread id
In reply to a message not in the archiveSigned-off-by Michael Jeanson <[email protected]>
--- tests/common/thread-id.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tests/common/thread-id.h +12 -0
@@ -57,6 +57,18 @@ unsigned long urcu_get_thread_id(void) {return (unsigned long )pthread_self (); } +#elif defined(__CYGWIN__) +#include <pthread.h> + +extern unsigned long pthread_getsequence_np (pthread_t *); + +static inline +unsigned long urcu_get_thread_id (void ) +{ +pthread_t thr =pthread_self (); +return pthread_getsequence_np (&thr); +} +#else # warning "use pid as thread ID" static inline
Signature · 6 lines
2.7.4 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Mathieu Desnoyers
AppliedRe: [PATCH urcu 1/3] Tests fix: unused variable warnings
In reply to a message not in the archiveMerged into master, 0.10, 0.9, 0.8, thanks!
Mathieu
Quoted 25 lines · ----- On Jul 20, 2017, at 5:33 PM, Michael Jeanson [email protected] wrote:
Signed-off-by Michael Jeanson <[email protected]>---
tests/benchmark/test_urcu_lfs_rcu.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)tests/benchmark/test_urcu_lfs_rcu.c +3
-3@@ -83,9 +83,10 @@ pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;static void set_affinity (void ) { +#if HAVE_SCHED_SETAFFINITY cpu_set_t mask; -int cpu; -int ret; +int cpu, ret; +#endif /* HAVE_SCHED_SETAFFINITY */ if (!use_affinity)return ; --2.7.4
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev