aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-27 15:05:12 -0800
committerChris Robinson <[email protected]>2018-12-27 15:05:12 -0800
commit515edc3deea8ba2661cb86571410fdd9a8eae158 (patch)
treef6226ab416907070bf8d79ac637ac121ee5c4ded
parentf2c2b7c5383ddd999b56f28730258f270b0d2576 (diff)
Fix ring buffer vector methods
-rw-r--r--Alc/ringbuffer.cpp6
-rw-r--r--OpenAL32/event.cpp10
2 files changed, 8 insertions, 8 deletions
diff --git a/Alc/ringbuffer.cpp b/Alc/ringbuffer.cpp
index 767db246..791fff63 100644
--- a/Alc/ringbuffer.cpp
+++ b/Alc/ringbuffer.cpp
@@ -192,7 +192,7 @@ void RingBuffer::writeAdvance(size_t cnt) noexcept
}
-ll_ringbuffer_data_pair RingBuffer::getWriteVector() const noexcept
+ll_ringbuffer_data_pair RingBuffer::getReadVector() const noexcept
{
ll_ringbuffer_data_pair ret;
@@ -205,7 +205,7 @@ ll_ringbuffer_data_pair RingBuffer::getWriteVector() const noexcept
const size_t cnt2{r + free_cnt};
if(cnt2 > mSizeMask+1)
{
- /* Two part vector: the rest of the buffer after the current write ptr,
+ /* Two part vector: the rest of the buffer after the current read ptr,
* plus some from the start of the buffer. */
ret.first.buf = const_cast<char*>(&mBuffer[r*mElemSize]);
ret.first.len = mSizeMask+1 - r;
@@ -224,7 +224,7 @@ ll_ringbuffer_data_pair RingBuffer::getWriteVector() const noexcept
return ret;
}
-ll_ringbuffer_data_pair RingBuffer::getReadVector() const noexcept
+ll_ringbuffer_data_pair RingBuffer::getWriteVector() const noexcept
{
ll_ringbuffer_data_pair ret;
diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp
index f3474139..a2e3addd 100644
--- a/OpenAL32/event.cpp
+++ b/OpenAL32/event.cpp
@@ -37,14 +37,14 @@ static int EventThread(ALCcontext *context)
* ringbuffer's read offset at the end of scope.
*/
const struct EventAutoDestructor {
- AsyncEvent &evt;
- RingBuffer *ring;
+ AsyncEvent &evt_;
+ RingBuffer *ring_;
~EventAutoDestructor()
{
- evt.~AsyncEvent();
- ring->readAdvance(1);
+ evt_.~AsyncEvent();
+ ring_->readAdvance(1);
}
- } _{evt, context->AsyncEvents.get()};
+ } _{evt, ring};
quitnow = evt.EnumType == EventType_KillThread;
if(UNLIKELY(quitnow)) break;