From: Ed Czeck Date: Thu, 6 Apr 2017 13:59:47 +0000 (-0400) Subject: ring: fix C++ cast error X-Git-Tag: spdx-start~3753 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=65d9e621fac43c42f1a12a8b65ef44e7faa79e11;p=dpdk.git ring: fix C++ cast error build error: include/rte_ring.h:459:22: error: invalid conversion from ‘void*’ to ‘void**’ [-fpermissive] ENQUEUE_PTRS(r, &r[1], prod_head, obj_table, n, void *); Implicit casts of void* to void** are considered warnings in some compilers. E.g. g++ version 5.8. Cast directly to object types Fixes: a6619414 ("ring: make struct and macros type agnostic") Signed-off-by: Ed Czeck Acked-by: Olivier Matz --- diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 28b7b2a80b..bd29a8afcc 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -290,7 +290,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); unsigned int i; \ const uint32_t size = (r)->size; \ uint32_t idx = prod_head & (r)->mask; \ - obj_type *ring = (void *)ring_start; \ + obj_type *ring = (obj_type *)ring_start; \ if (likely(idx + n < size)) { \ for (i = 0; i < (n & ((~(unsigned)0x3))); i+=4, idx+=4) { \ ring[idx] = obj_table[i]; \ @@ -321,7 +321,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); unsigned int i; \ uint32_t idx = cons_head & (r)->mask; \ const uint32_t size = (r)->size; \ - obj_type *ring = (void *)ring_start; \ + obj_type *ring = (obj_type *)ring_start; \ if (likely(idx + n < size)) { \ for (i = 0; i < (n & (~(unsigned)0x3)); i+=4, idx+=4) {\ obj_table[i] = ring[idx]; \