diff options
author | David Robillard <d@drobilla.net> | 2022-08-19 15:14:24 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-19 15:14:24 -0400 |
commit | 1c440b76eeaf4968debe18973435832200a0a12f (patch) | |
tree | d722c92fa8c16016d67eedc8d683c24f837a8d61 /src/bump_allocator.c | |
parent | 171aa2a60a8deeaf7b7692a0ecb6de56df1607f8 (diff) | |
download | zix-1c440b76eeaf4968debe18973435832200a0a12f.tar.gz zix-1c440b76eeaf4968debe18973435832200a0a12f.tar.bz2 zix-1c440b76eeaf4968debe18973435832200a0a12f.zip |
Avoid mixing signed and unsigned integers
Diffstat (limited to 'src/bump_allocator.c')
-rw-r--r-- | src/bump_allocator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bump_allocator.c b/src/bump_allocator.c index eedd3e9..0bacb28 100644 --- a/src/bump_allocator.c +++ b/src/bump_allocator.c @@ -15,8 +15,8 @@ static const size_t min_alignment = sizeof(uintmax_t); static size_t round_up_multiple(const size_t number, const size_t factor) { - assert(factor); // Factor must be non-zero - assert((factor & (factor - 1)) == 0U); // Factor must be a power of two + assert(factor); // Factor must be non-zero + assert((factor & (factor - 1U)) == 0U); // Factor must be a power of two return (number + factor - 1U) & ~(factor - 1U); } @@ -27,7 +27,7 @@ zix_bump_malloc(ZixAllocator* const allocator, const size_t size) { ZixBumpAllocator* const state = (ZixBumpAllocator*)allocator; - assert((uintptr_t)((char*)state->buffer + state->top) % min_alignment == 0); + assert((uintptr_t)((char*)state->buffer + state->top) % min_alignment == 0U); /* For C malloc(), the result is guaranteed to be aligned for any variable. What that means is deliberately vague to accommodate diverse platforms, |