From d87a84ca89d92ab9b93ead2c483d2f45e8fd2ec3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 29 May 2014 23:56:37 +0200 Subject: ring: use a different type for read/write pointers uint_least32_t could be larger than uint32_t, so the return values of mp_ring_get_wpos/rpos must be adjusted. Actually just use unsigned long as type instead, because that is less awkward than uint_least32_t. --- misc/ring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'misc') diff --git a/misc/ring.c b/misc/ring.c index 3db87f71f6..804e6330b0 100644 --- a/misc/ring.c +++ b/misc/ring.c @@ -30,15 +30,15 @@ struct mp_ring { /* Positions of the first readable/writeable chunks. Do not read this * fields but use the atomic private accessors `mp_ring_get_wpos` * and `mp_ring_get_rpos`. */ - atomic_uint_least32_t rpos, wpos; + atomic_ulong rpos, wpos; }; -static uint32_t mp_ring_get_wpos(struct mp_ring *buffer) +static unsigned long mp_ring_get_wpos(struct mp_ring *buffer) { return atomic_load(&buffer->wpos); } -static uint32_t mp_ring_get_rpos(struct mp_ring *buffer) +static unsigned long mp_ring_get_rpos(struct mp_ring *buffer) { return atomic_load(&buffer->rpos); } -- cgit v1.2.3