From 431a9c00a56cf4c603be1cf5f773b193621d8150 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 16:55:19 +0100 Subject: Fixed a huge amount of Clang warnings On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably. 99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified. Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects. Most remaining warnings are now unused parameters. --- source/frontend/StarVoice.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/frontend/StarVoice.cpp') diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp index 168d23b..f7155e6 100644 --- a/source/frontend/StarVoice.cpp +++ b/source/frontend/StarVoice.cpp @@ -61,7 +61,8 @@ float getAudioLoudness(int16_t* data, size_t samples, float volume = 1.0f) { return highest; } -struct VoiceAudioStream { +class VoiceAudioStream { +public: // TODO: This should really be a ring buffer instead. std::queue samples; SDL_AudioStream* sdlAudioStreamMono; @@ -173,7 +174,7 @@ template inline bool change(T& value, T newValue, bool& out) { bool changed = value != newValue; out |= changed; - value = move(newValue); + value = std::move(newValue); return changed; } @@ -480,7 +481,7 @@ int Voice::send(DataStreamBuffer& out, size_t budget) { if (m_encodedChunks.empty()) return 0; - std::vector encodedChunks = move(m_encodedChunks); + std::vector encodedChunks = std::move(m_encodedChunks); size_t encodedChunksLength = m_encodedChunksLength; m_encodedChunksLength = 0; @@ -692,7 +693,7 @@ void Voice::thread() { { MutexLocker lock(m_encodeMutex); - m_encodedChunks.emplace_back(move(encoded)); + m_encodedChunks.emplace_back(std::move(encoded)); m_encodedChunksLength += encodedSize; encoded = ByteArray(VOICE_MAX_PACKET_SIZE, 0); -- cgit v1.2.3