summaryrefslogtreecommitdiffstats
path: root/raul/RingBuffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-16 21:37:34 +0200
committerDavid Robillard <d@drobilla.net>2018-09-16 21:50:04 +0200
commit07396e8d23bb8724c5960b57aca33e08a97f4e52 (patch)
tree8699e538e4c4b6cded707ebce46d8c6bc3e5a78e /raul/RingBuffer.hpp
parente911351fcc631cd511bfdac93687669028136f79 (diff)
downloadraul-07396e8d23bb8724c5960b57aca33e08a97f4e52.tar.gz
raul-07396e8d23bb8724c5960b57aca33e08a97f4e52.tar.bz2
raul-07396e8d23bb8724c5960b57aca33e08a97f4e52.zip
Remove C casts
Diffstat (limited to 'raul/RingBuffer.hpp')
-rw-r--r--raul/RingBuffer.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/raul/RingBuffer.hpp b/raul/RingBuffer.hpp
index 574b8b8..dfe5dd2 100644
--- a/raul/RingBuffer.hpp
+++ b/raul/RingBuffer.hpp
@@ -146,7 +146,9 @@ public:
assert(this_size < size);
assert(w + this_size <= _size);
memcpy(&_buf[w], src, this_size);
- memcpy(&_buf[0], (const char*)src + this_size, size - this_size);
+ memcpy(&_buf[0],
+ static_cast<const char*>(src) + this_size,
+ size - this_size);
std::atomic_thread_fence(std::memory_order_release);
_write_head = size - this_size;
}
@@ -196,7 +198,9 @@ private:
} else {
const uint32_t first_size = _size - r;
memcpy(dst, &_buf[r], first_size);
- memcpy((char*)dst + first_size, &_buf[0], size - first_size);
+ memcpy(static_cast<char*>(dst) + first_size,
+ &_buf[0],
+ size - first_size);
}
return size;