summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-29 23:56:37 +0200
committerwm4 <wm4@nowhere>2014-05-30 02:15:25 +0200
commitd87a84ca89d92ab9b93ead2c483d2f45e8fd2ec3 (patch)
treec99a55f508d9edb6212b6b3b9b1d8d5eed8cc8e6 /misc
parente127cfa0b51322f1c78c42634ae740d57ff17f00 (diff)
downloadmpv-d87a84ca89d92ab9b93ead2c483d2f45e8fd2ec3.tar.bz2
mpv-d87a84ca89d92ab9b93ead2c483d2f45e8fd2ec3.tar.xz
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.
Diffstat (limited to 'misc')
-rw-r--r--misc/ring.c6
1 files changed, 3 insertions, 3 deletions
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);
}