aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-10-03 08:02:57 -0700
committerChris Robinson <[email protected]>2021-10-03 08:02:57 -0700
commitf92cc479d82fbf85591d8918bbf469c4b329c31c (patch)
treef18d486b88aa274cd172496c133e6a82c1033dbb /al/source.cpp
parent53d9033ec70019353dfa255b63cbe9eb21c70888 (diff)
Silence some static analysis warnings
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/al/source.cpp b/al/source.cpp
index bf499442..e28b938f 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -619,6 +619,7 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC
}
++vidx;
}
+ assert(newvoice != nullptr);
}
/* Initialize the new voice and set its starting offset.
@@ -737,10 +738,10 @@ ALsource *AllocSource(ALCcontext *context)
{
auto sublist = std::find_if(context->mSourceList.begin(), context->mSourceList.end(),
[](const SourceSubList &entry) noexcept -> bool
- { return entry.FreeMask != 0; }
- );
+ { return entry.FreeMask != 0; });
auto lidx = static_cast<ALuint>(std::distance(context->mSourceList.begin(), sublist));
auto slidx = static_cast<ALuint>(al::countr_zero(sublist->FreeMask));
+ ASSUME(slidx < 64);
ALsource *source{::new(sublist->Sources + slidx) ALsource{}};
@@ -3063,6 +3064,7 @@ START_API_FUNC
break;
}
}
+ assert(voice != nullptr);
voice->mPosition.store(0u, std::memory_order_relaxed);
voice->mPositionFrac.store(0, std::memory_order_relaxed);