Fix: assignment from incompatible pointer type warnings
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 20 Jul 2017 21:33:46 +0000 (17:33 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Jul 2017 12:39:36 +0000 (08:39 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-bp.c

index f78935e1af2d5d9883946f0aef201a6928d3a90a..ac8c6806e1008e5314f61e013b31e6b454e3fb69 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -355,7 +355,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);
@@ -389,7 +390,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);
@@ -587,7 +589,7 @@ void _rcu_bp_exit(void)
 
                cds_list_for_each_entry_safe(chunk, tmp,
                                &registry_arena.chunk_list, node) {
-                       munmap(chunk, chunk->data_len
+                       munmap((void *) chunk, chunk->data_len
                                        + sizeof(struct registry_chunk));
                }
                CDS_INIT_LIST_HEAD(&registry_arena.chunk_list);
This page took 0.026584 seconds and 4 git commands to generate.