DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ed Czeck <ed.czeck@atomicrules.com>
To: dev@dpdk.org
Cc: olivier.matz@6wind.com, bruce.richardson@intel.com,
	Ed Czeck <ed.czeck@atomicrules.com>
Subject: [dpdk-dev] [PATCH] ring: use direct cast to objtype fixes build error
Date: Thu,  6 Apr 2017 09:59:47 -0400	[thread overview]
Message-ID: <1491487187-19577-1-git-send-email-ed.czeck@atomicrules.com> (raw)

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

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
 lib/librte_ring/rte_ring.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 6642e18..7648cd8 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]; \
-- 
2.7.4

             reply	other threads:[~2017-04-06 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 13:59 Ed Czeck [this message]
2017-04-06 14:18 ` Olivier MATZ
2017-04-06 14:25   ` Thomas Monjalon
2017-04-06 15:16     ` Ed Czeck
2017-04-06 15:40   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491487187-19577-1-git-send-email-ed.czeck@atomicrules.com \
    --to=ed.czeck@atomicrules.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).