summaryrefslogtreecommitdiffstats
path: root/src/ring.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-19 15:14:24 -0400
committerDavid Robillard <d@drobilla.net>2022-08-19 15:14:24 -0400
commit1c440b76eeaf4968debe18973435832200a0a12f (patch)
treed722c92fa8c16016d67eedc8d683c24f837a8d61 /src/ring.c
parent171aa2a60a8deeaf7b7692a0ecb6de56df1607f8 (diff)
downloadzix-1c440b76eeaf4968debe18973435832200a0a12f.tar.gz
zix-1c440b76eeaf4968debe18973435832200a0a12f.tar.bz2
zix-1c440b76eeaf4968debe18973435832200a0a12f.zip
Avoid mixing signed and unsigned integers
Diffstat (limited to 'src/ring.c')
-rw-r--r--src/ring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ring.c b/src/ring.c
index 4932e9e..bcbeb4c 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -86,7 +86,7 @@ zix_ring_new(ZixAllocator* const allocator, const uint32_t size)
ring->write_head = 0;
ring->read_head = 0;
ring->size = next_power_of_two(size);
- ring->size_mask = ring->size - 1;
+ ring->size_mask = ring->size - 1U;
if (!(ring->buf = (char*)zix_malloc(allocator, ring->size))) {
zix_free(allocator, ring);
@@ -162,7 +162,7 @@ zix_ring_write_space(const ZixRing* const ring)
uint32_t
zix_ring_capacity(const ZixRing* const ring)
{
- return ring->size - 1;
+ return ring->size - 1U;
}
static inline uint32_t