From f1302c4920afb9bad1a2a1672b561416b83e65c2 Mon Sep 17 00:00:00 2001 From: Paul Khuong Date: Wed, 30 Sep 2015 14:25:04 -0400 Subject: [PATCH] ck_ring: explicit casts to clarify the semantics of generic (pointer) dequeuing --- include/ck_ring.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/ck_ring.h b/include/ck_ring.h index 48f347e..295f810 100644 --- a/include/ck_ring.h +++ b/include/ck_ring.h @@ -330,7 +330,7 @@ ck_ring_dequeue_spsc(struct ck_ring *ring, { return _ck_ring_dequeue_sc(ring, buffer, - data, sizeof(data)); + (void **)data, sizeof(void *)); } /* @@ -366,7 +366,7 @@ ck_ring_trydequeue_mpmc(struct ck_ring *ring, { return _ck_ring_trydequeue_mc(ring, - buffer, data, sizeof(data)); + buffer, (void **)data, sizeof(void *)); } CK_CC_INLINE static bool @@ -375,8 +375,8 @@ ck_ring_dequeue_mpmc(struct ck_ring *ring, void *data) { - return _ck_ring_dequeue_mc(ring, buffer, data, - sizeof(data)); + return _ck_ring_dequeue_mc(ring, buffer, (void **)data, + sizeof(void *)); } /* @@ -411,7 +411,7 @@ ck_ring_trydequeue_spmc(struct ck_ring *ring, void *data) { - return _ck_ring_trydequeue_mc(ring, buffer, data, sizeof(data)); + return _ck_ring_trydequeue_mc(ring, buffer, (void **)data, sizeof(void *)); } CK_CC_INLINE static bool @@ -420,7 +420,7 @@ ck_ring_dequeue_spmc(struct ck_ring *ring, void *data) { - return _ck_ring_dequeue_mc(ring, buffer, data, sizeof(data)); + return _ck_ring_dequeue_mc(ring, buffer, (void **)data, sizeof(void *)); } /* @@ -455,8 +455,8 @@ ck_ring_dequeue_mpsc(struct ck_ring *ring, void *data) { - return _ck_ring_dequeue_sc(ring, buffer, data, - sizeof(data)); + return _ck_ring_dequeue_sc(ring, buffer, (void **)data, + sizeof(void *)); } /*