diff options
author | Chris Robinson <[email protected]> | 2018-11-17 07:45:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-17 07:45:10 -0800 |
commit | 057b1411f980d480cca76fb64c817f5b3e127f80 (patch) | |
tree | d9747e4cf453c0c6cb598f20d93465cfc0aacdab | |
parent | ff4219e54e2a444f0ccf4033091931d2908af91e (diff) |
Convert ringbuffer.c to C++
-rw-r--r-- | Alc/ringbuffer.cpp (renamed from Alc/ringbuffer.c) | 10 | ||||
-rw-r--r-- | CMakeLists.txt | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Alc/ringbuffer.c b/Alc/ringbuffer.cpp index 6c419cf8..72267bd0 100644 --- a/Alc/ringbuffer.c +++ b/Alc/ringbuffer.cpp @@ -66,11 +66,11 @@ ll_ringbuffer_t *ll_ringbuffer_create(size_t sz, size_t elem_sz, int limit_write power_of_two++; if(power_of_two < sz) return NULL; - rb = al_malloc(16, sizeof(*rb) + power_of_two*elem_sz); + rb = static_cast<ll_ringbuffer_t*>(al_malloc(16, sizeof(*rb) + power_of_two*elem_sz)); if(!rb) return NULL; - ATOMIC_INIT(&rb->write_ptr, 0); - ATOMIC_INIT(&rb->read_ptr, 0); + ATOMIC_INIT(&rb->write_ptr, static_cast<size_t>(0)); + ATOMIC_INIT(&rb->read_ptr, static_cast<size_t>(0)); rb->size = limit_writes ? sz : power_of_two; rb->size_mask = power_of_two - 1; rb->elem_size = elem_sz; @@ -84,8 +84,8 @@ void ll_ringbuffer_free(ll_ringbuffer_t *rb) void ll_ringbuffer_reset(ll_ringbuffer_t *rb) { - ATOMIC_STORE(&rb->write_ptr, 0, almemory_order_release); - ATOMIC_STORE(&rb->read_ptr, 0, almemory_order_release); + ATOMIC_STORE(&rb->write_ptr, static_cast<size_t>(0), almemory_order_release); + ATOMIC_STORE(&rb->read_ptr, static_cast<size_t>(0), almemory_order_release); memset(rb->buf, 0, (rb->size_mask+1)*rb->elem_size); } diff --git a/CMakeLists.txt b/CMakeLists.txt index 84a99d2e..19dc0439 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -806,7 +806,7 @@ SET(ALC_OBJS Alc/inprogext.h Alc/mastering.cpp Alc/mastering.h - Alc/ringbuffer.c + Alc/ringbuffer.cpp Alc/ringbuffer.h Alc/effects/autowah.cpp Alc/effects/chorus.cpp |