diff options
| author | 2024-01-27 20:41:36 -0500 | |
|---|---|---|
| committer | 2024-01-27 20:41:36 -0500 | |
| commit | 3eeb6351ea365d8eb095a3db3063b6129f73a178 (patch) | |
| tree | 57c1aa63ac6c4c0860bcc31fc7e1544180925734 /src | |
| parent | a1f9ffcc6eb38ad5f6f0fa750a34e14ad9cdf812 (diff) | |
| download | libalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.tar.gz libalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.tar.bz2 libalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.zip | |
Switch the order of al_array_insert args, cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
| -rw-r--r-- | src/array.c | 2 | ||||
| -rw-r--r-- | src/ring_buffer.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/array.c b/src/array.c index 9b61cd9..6af0f40 100644 --- a/src/array.c +++ b/src/array.c @@ -35,7 +35,7 @@ al_array_at(arr, (arr).size++) = item; \ } while (0) -#define al_array_insert(arr, item, i) \ +#define al_array_insert(arr, i, item) \ do { \ if ((arr).size > i) { \ al_array_reserve(arr, (arr).size + 1); \ diff --git a/src/ring_buffer.c b/src/ring_buffer.c index eaff139..751ea4a 100644 --- a/src/ring_buffer.c +++ b/src/ring_buffer.c @@ -1,5 +1,6 @@ -#include "../include/al/lib.h" #include "../include/al/ring_buffer.h" +#include "../include/al/atomic.h" +#include "../include/al/lib.h" // https://github.com/MusicPlayerDaemon/MPD/blob/master/src/util/RingBuffer.hxx // https://andrea.lattuada.me/blog/2019/the-design-and-implementation-of-a-lock-free-ring-buffer-with-contiguous-reservations.html |