diff options
| author | 2020-09-27 01:52:59 -0700 | |
|---|---|---|
| committer | 2020-09-27 01:52:59 -0700 | |
| commit | a8be822e8eb5cda83b09bcf6c1478b8bef2f2caf (patch) | |
| tree | 2ffdcbce07231caba437d6ac1cbfe23f3a02f16e | |
| parent | Merge pull request #4724 from lat9nq/fix-vulkan-nvidia-allocate-2 (diff) | |
| parent | audio_core: Resolve sign conversion warnings (diff) | |
| download | yuzu-a8be822e8eb5cda83b09bcf6c1478b8bef2f2caf.tar.gz yuzu-a8be822e8eb5cda83b09bcf6c1478b8bef2f2caf.tar.xz yuzu-a8be822e8eb5cda83b09bcf6c1478b8bef2f2caf.zip | |
Merge pull request #4719 from lioncash/audio-warn
audio_core: Resolve sign conversion warnings
Diffstat (limited to '')
| -rw-r--r-- | src/audio_core/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | src/audio_core/command_generator.cpp | 12 | ||||
| -rw-r--r-- | src/audio_core/effect_context.cpp | 8 | ||||
| -rw-r--r-- | src/audio_core/effect_context.h | 33 | ||||
| -rw-r--r-- | src/audio_core/info_updater.cpp | 7 | ||||
| -rw-r--r-- | src/audio_core/mix_context.cpp | 4 | ||||
| -rw-r--r-- | src/audio_core/splitter_context.cpp | 6 | ||||
| -rw-r--r-- | src/audio_core/voice_context.cpp | 4 |
8 files changed, 46 insertions, 38 deletions
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index cb00ef60e..6a7075f73 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt | |||
| @@ -44,6 +44,16 @@ add_library(audio_core STATIC | |||
| 44 | 44 | ||
| 45 | create_target_directory_groups(audio_core) | 45 | create_target_directory_groups(audio_core) |
| 46 | 46 | ||
| 47 | if (NOT MSVC) | ||
| 48 | target_compile_options(audio_core PRIVATE | ||
| 49 | -Werror=ignored-qualifiers | ||
| 50 | -Werror=implicit-fallthrough | ||
| 51 | -Werror=reorder | ||
| 52 | -Werror=sign-compare | ||
| 53 | -Werror=unused-variable | ||
| 54 | ) | ||
| 55 | endif() | ||
| 56 | |||
| 47 | target_link_libraries(audio_core PUBLIC common core) | 57 | target_link_libraries(audio_core PUBLIC common core) |
| 48 | target_link_libraries(audio_core PRIVATE SoundTouch) | 58 | target_link_libraries(audio_core PRIVATE SoundTouch) |
| 49 | 59 | ||
diff --git a/src/audio_core/command_generator.cpp b/src/audio_core/command_generator.cpp index 8f7da49e6..7f2597257 100644 --- a/src/audio_core/command_generator.cpp +++ b/src/audio_core/command_generator.cpp | |||
| @@ -152,7 +152,7 @@ void CommandGenerator::GenerateVoiceCommand(ServerVoiceInfo& voice_info) { | |||
| 152 | if (!destination_data->IsConfigured()) { | 152 | if (!destination_data->IsConfigured()) { |
| 153 | continue; | 153 | continue; |
| 154 | } | 154 | } |
| 155 | if (destination_data->GetMixId() >= mix_context.GetCount()) { | 155 | if (destination_data->GetMixId() >= static_cast<int>(mix_context.GetCount())) { |
| 156 | continue; | 156 | continue; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| @@ -435,7 +435,7 @@ void CommandGenerator::GenerateAuxCommand(s32 mix_buffer_offset, EffectBase* inf | |||
| 435 | GetMixBuffer(output_index), worker_params.sample_count, offset, write_count); | 435 | GetMixBuffer(output_index), worker_params.sample_count, offset, write_count); |
| 436 | memory.WriteBlock(aux->GetRecvInfo(), &recv_info, sizeof(AuxInfoDSP)); | 436 | memory.WriteBlock(aux->GetRecvInfo(), &recv_info, sizeof(AuxInfoDSP)); |
| 437 | 437 | ||
| 438 | if (samples_read != worker_params.sample_count && | 438 | if (samples_read != static_cast<int>(worker_params.sample_count) && |
| 439 | samples_read <= params.sample_count) { | 439 | samples_read <= params.sample_count) { |
| 440 | std::memset(GetMixBuffer(output_index), 0, params.sample_count - samples_read); | 440 | std::memset(GetMixBuffer(output_index), 0, params.sample_count - samples_read); |
| 441 | } | 441 | } |
| @@ -611,7 +611,8 @@ void CommandGenerator::GenerateMixCommands(ServerMixInfo& mix_info) { | |||
| 611 | const auto& dest_mix = mix_context.GetInfo(destination_data->GetMixId()); | 611 | const auto& dest_mix = mix_context.GetInfo(destination_data->GetMixId()); |
| 612 | const auto& dest_in_params = dest_mix.GetInParams(); | 612 | const auto& dest_in_params = dest_mix.GetInParams(); |
| 613 | const auto mix_index = (base - 1) % in_params.buffer_count + in_params.buffer_offset; | 613 | const auto mix_index = (base - 1) % in_params.buffer_count + in_params.buffer_offset; |
| 614 | for (std::size_t i = 0; i < dest_in_params.buffer_count; i++) { | 614 | for (std::size_t i = 0; i < static_cast<std::size_t>(dest_in_params.buffer_count); |
| 615 | i++) { | ||
| 615 | const auto mixed_volume = in_params.volume * destination_data->GetMixVolume(i); | 616 | const auto mixed_volume = in_params.volume * destination_data->GetMixVolume(i); |
| 616 | if (mixed_volume != 0.0f) { | 617 | if (mixed_volume != 0.0f) { |
| 617 | GenerateMixCommand(dest_in_params.buffer_offset + i, mix_index, mixed_volume, | 618 | GenerateMixCommand(dest_in_params.buffer_offset + i, mix_index, mixed_volume, |
| @@ -704,7 +705,7 @@ s32 CommandGenerator::DecodePcm16(ServerVoiceInfo& voice_info, VoiceState& dsp_s | |||
| 704 | std::vector<s16> buffer(samples_processed * channel_count); | 705 | std::vector<s16> buffer(samples_processed * channel_count); |
| 705 | memory.ReadBlock(buffer_pos, buffer.data(), buffer.size() * sizeof(s16)); | 706 | memory.ReadBlock(buffer_pos, buffer.data(), buffer.size() * sizeof(s16)); |
| 706 | 707 | ||
| 707 | for (std::size_t i = 0; i < samples_processed; i++) { | 708 | for (std::size_t i = 0; i < static_cast<std::size_t>(samples_processed); i++) { |
| 708 | sample_buffer[mix_offset + i] = buffer[i * channel_count + channel]; | 709 | sample_buffer[mix_offset + i] = buffer[i * channel_count + channel]; |
| 709 | } | 710 | } |
| 710 | } | 711 | } |
| @@ -789,7 +790,7 @@ s32 CommandGenerator::DecodeAdpcm(ServerVoiceInfo& voice_info, VoiceState& dsp_s | |||
| 789 | position_in_frame += 2; | 790 | position_in_frame += 2; |
| 790 | 791 | ||
| 791 | // Decode entire frame | 792 | // Decode entire frame |
| 792 | if (remaining_samples >= SAMPLES_PER_FRAME) { | 793 | if (remaining_samples >= static_cast<int>(SAMPLES_PER_FRAME)) { |
| 793 | for (std::size_t i = 0; i < SAMPLES_PER_FRAME / 2; i++) { | 794 | for (std::size_t i = 0; i < SAMPLES_PER_FRAME / 2; i++) { |
| 794 | 795 | ||
| 795 | // Sample 1 | 796 | // Sample 1 |
| @@ -866,7 +867,6 @@ void CommandGenerator::DecodeFromWaveBuffers(ServerVoiceInfo& voice_info, s32* o | |||
| 866 | const auto resample_rate = static_cast<s32>( | 867 | const auto resample_rate = static_cast<s32>( |
| 867 | static_cast<float>(in_params.sample_rate) / static_cast<float>(target_sample_rate) * | 868 | static_cast<float>(in_params.sample_rate) / static_cast<float>(target_sample_rate) * |
| 868 | static_cast<float>(static_cast<s32>(in_params.pitch * 32768.0f))); | 869 | static_cast<float>(static_cast<s32>(in_params.pitch * 32768.0f))); |
| 869 | auto* output_base = output; | ||
| 870 | if (dsp_state.fraction + sample_count * resample_rate > | 870 | if (dsp_state.fraction + sample_count * resample_rate > |
| 871 | static_cast<s32>(SCALED_MIX_BUFFER_SIZE - 4ULL)) { | 871 | static_cast<s32>(SCALED_MIX_BUFFER_SIZE - 4ULL)) { |
| 872 | return; | 872 | return; |
diff --git a/src/audio_core/effect_context.cpp b/src/audio_core/effect_context.cpp index adfec3df5..4d9cdf524 100644 --- a/src/audio_core/effect_context.cpp +++ b/src/audio_core/effect_context.cpp | |||
| @@ -184,19 +184,19 @@ void EffectAuxInfo::UpdateForCommandGeneration() { | |||
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | const VAddr EffectAuxInfo::GetSendInfo() const { | 187 | VAddr EffectAuxInfo::GetSendInfo() const { |
| 188 | return send_info; | 188 | return send_info; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | const VAddr EffectAuxInfo::GetSendBuffer() const { | 191 | VAddr EffectAuxInfo::GetSendBuffer() const { |
| 192 | return send_buffer; | 192 | return send_buffer; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | const VAddr EffectAuxInfo::GetRecvInfo() const { | 195 | VAddr EffectAuxInfo::GetRecvInfo() const { |
| 196 | return recv_info; | 196 | return recv_info; |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | const VAddr EffectAuxInfo::GetRecvBuffer() const { | 199 | VAddr EffectAuxInfo::GetRecvBuffer() const { |
| 200 | return recv_buffer; | 200 | return recv_buffer; |
| 201 | } | 201 | } |
| 202 | 202 | ||
diff --git a/src/audio_core/effect_context.h b/src/audio_core/effect_context.h index 2f2da72dd..2c4ce53ef 100644 --- a/src/audio_core/effect_context.h +++ b/src/audio_core/effect_context.h | |||
| @@ -166,13 +166,13 @@ public: | |||
| 166 | std::array<u8, 0xa0> raw; | 166 | std::array<u8, 0xa0> raw; |
| 167 | }; | 167 | }; |
| 168 | }; | 168 | }; |
| 169 | static_assert(sizeof(EffectInfo::InParams) == 0xc0, "InParams is an invalid size"); | 169 | static_assert(sizeof(InParams) == 0xc0, "InParams is an invalid size"); |
| 170 | 170 | ||
| 171 | struct OutParams { | 171 | struct OutParams { |
| 172 | UsageStatus status{}; | 172 | UsageStatus status{}; |
| 173 | INSERT_PADDING_BYTES(15); | 173 | INSERT_PADDING_BYTES(15); |
| 174 | }; | 174 | }; |
| 175 | static_assert(sizeof(EffectInfo::OutParams) == 0x10, "OutParams is an invalid size"); | 175 | static_assert(sizeof(OutParams) == 0x10, "OutParams is an invalid size"); |
| 176 | }; | 176 | }; |
| 177 | 177 | ||
| 178 | struct AuxAddress { | 178 | struct AuxAddress { |
| @@ -184,8 +184,8 @@ struct AuxAddress { | |||
| 184 | 184 | ||
| 185 | class EffectBase { | 185 | class EffectBase { |
| 186 | public: | 186 | public: |
| 187 | EffectBase(EffectType effect_type); | 187 | explicit EffectBase(EffectType effect_type); |
| 188 | ~EffectBase(); | 188 | virtual ~EffectBase(); |
| 189 | 189 | ||
| 190 | virtual void Update(EffectInfo::InParams& in_params) = 0; | 190 | virtual void Update(EffectInfo::InParams& in_params) = 0; |
| 191 | virtual void UpdateForCommandGeneration() = 0; | 191 | virtual void UpdateForCommandGeneration() = 0; |
| @@ -206,8 +206,7 @@ protected: | |||
| 206 | template <typename T> | 206 | template <typename T> |
| 207 | class EffectGeneric : public EffectBase { | 207 | class EffectGeneric : public EffectBase { |
| 208 | public: | 208 | public: |
| 209 | EffectGeneric(EffectType effect_type) : EffectBase::EffectBase(effect_type) {} | 209 | explicit EffectGeneric(EffectType effect_type) : EffectBase(effect_type) {} |
| 210 | ~EffectGeneric() = default; | ||
| 211 | 210 | ||
| 212 | T& GetParams() { | 211 | T& GetParams() { |
| 213 | return internal_params; | 212 | return internal_params; |
| @@ -224,7 +223,7 @@ private: | |||
| 224 | class EffectStubbed : public EffectBase { | 223 | class EffectStubbed : public EffectBase { |
| 225 | public: | 224 | public: |
| 226 | explicit EffectStubbed(); | 225 | explicit EffectStubbed(); |
| 227 | ~EffectStubbed(); | 226 | ~EffectStubbed() override; |
| 228 | 227 | ||
| 229 | void Update(EffectInfo::InParams& in_params) override; | 228 | void Update(EffectInfo::InParams& in_params) override; |
| 230 | void UpdateForCommandGeneration() override; | 229 | void UpdateForCommandGeneration() override; |
| @@ -233,7 +232,7 @@ public: | |||
| 233 | class EffectI3dl2Reverb : public EffectGeneric<I3dl2ReverbParams> { | 232 | class EffectI3dl2Reverb : public EffectGeneric<I3dl2ReverbParams> { |
| 234 | public: | 233 | public: |
| 235 | explicit EffectI3dl2Reverb(); | 234 | explicit EffectI3dl2Reverb(); |
| 236 | ~EffectI3dl2Reverb(); | 235 | ~EffectI3dl2Reverb() override; |
| 237 | 236 | ||
| 238 | void Update(EffectInfo::InParams& in_params) override; | 237 | void Update(EffectInfo::InParams& in_params) override; |
| 239 | void UpdateForCommandGeneration() override; | 238 | void UpdateForCommandGeneration() override; |
| @@ -245,7 +244,7 @@ private: | |||
| 245 | class EffectBiquadFilter : public EffectGeneric<BiquadFilterParams> { | 244 | class EffectBiquadFilter : public EffectGeneric<BiquadFilterParams> { |
| 246 | public: | 245 | public: |
| 247 | explicit EffectBiquadFilter(); | 246 | explicit EffectBiquadFilter(); |
| 248 | ~EffectBiquadFilter(); | 247 | ~EffectBiquadFilter() override; |
| 249 | 248 | ||
| 250 | void Update(EffectInfo::InParams& in_params) override; | 249 | void Update(EffectInfo::InParams& in_params) override; |
| 251 | void UpdateForCommandGeneration() override; | 250 | void UpdateForCommandGeneration() override; |
| @@ -254,14 +253,14 @@ public: | |||
| 254 | class EffectAuxInfo : public EffectGeneric<AuxInfo> { | 253 | class EffectAuxInfo : public EffectGeneric<AuxInfo> { |
| 255 | public: | 254 | public: |
| 256 | explicit EffectAuxInfo(); | 255 | explicit EffectAuxInfo(); |
| 257 | ~EffectAuxInfo(); | 256 | ~EffectAuxInfo() override; |
| 258 | 257 | ||
| 259 | void Update(EffectInfo::InParams& in_params) override; | 258 | void Update(EffectInfo::InParams& in_params) override; |
| 260 | void UpdateForCommandGeneration() override; | 259 | void UpdateForCommandGeneration() override; |
| 261 | const VAddr GetSendInfo() const; | 260 | VAddr GetSendInfo() const; |
| 262 | const VAddr GetSendBuffer() const; | 261 | VAddr GetSendBuffer() const; |
| 263 | const VAddr GetRecvInfo() const; | 262 | VAddr GetRecvInfo() const; |
| 264 | const VAddr GetRecvBuffer() const; | 263 | VAddr GetRecvBuffer() const; |
| 265 | 264 | ||
| 266 | private: | 265 | private: |
| 267 | VAddr send_info{}; | 266 | VAddr send_info{}; |
| @@ -275,7 +274,7 @@ private: | |||
| 275 | class EffectDelay : public EffectGeneric<DelayParams> { | 274 | class EffectDelay : public EffectGeneric<DelayParams> { |
| 276 | public: | 275 | public: |
| 277 | explicit EffectDelay(); | 276 | explicit EffectDelay(); |
| 278 | ~EffectDelay(); | 277 | ~EffectDelay() override; |
| 279 | 278 | ||
| 280 | void Update(EffectInfo::InParams& in_params) override; | 279 | void Update(EffectInfo::InParams& in_params) override; |
| 281 | void UpdateForCommandGeneration() override; | 280 | void UpdateForCommandGeneration() override; |
| @@ -287,7 +286,7 @@ private: | |||
| 287 | class EffectBufferMixer : public EffectGeneric<BufferMixerParams> { | 286 | class EffectBufferMixer : public EffectGeneric<BufferMixerParams> { |
| 288 | public: | 287 | public: |
| 289 | explicit EffectBufferMixer(); | 288 | explicit EffectBufferMixer(); |
| 290 | ~EffectBufferMixer(); | 289 | ~EffectBufferMixer() override; |
| 291 | 290 | ||
| 292 | void Update(EffectInfo::InParams& in_params) override; | 291 | void Update(EffectInfo::InParams& in_params) override; |
| 293 | void UpdateForCommandGeneration() override; | 292 | void UpdateForCommandGeneration() override; |
| @@ -296,7 +295,7 @@ public: | |||
| 296 | class EffectReverb : public EffectGeneric<ReverbParams> { | 295 | class EffectReverb : public EffectGeneric<ReverbParams> { |
| 297 | public: | 296 | public: |
| 298 | explicit EffectReverb(); | 297 | explicit EffectReverb(); |
| 299 | ~EffectReverb(); | 298 | ~EffectReverb() override; |
| 300 | 299 | ||
| 301 | void Update(EffectInfo::InParams& in_params) override; | 300 | void Update(EffectInfo::InParams& in_params) override; |
| 302 | void UpdateForCommandGeneration() override; | 301 | void UpdateForCommandGeneration() override; |
diff --git a/src/audio_core/info_updater.cpp b/src/audio_core/info_updater.cpp index f53ce21a5..2940e53a9 100644 --- a/src/audio_core/info_updater.cpp +++ b/src/audio_core/info_updater.cpp | |||
| @@ -64,7 +64,6 @@ bool InfoUpdater::UpdateBehaviorInfo(BehaviorInfo& in_behavior_info) { | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | bool InfoUpdater::UpdateMemoryPools(std::vector<ServerMemoryPoolInfo>& memory_pool_info) { | 66 | bool InfoUpdater::UpdateMemoryPools(std::vector<ServerMemoryPoolInfo>& memory_pool_info) { |
| 67 | const auto force_mapping = behavior_info.IsMemoryPoolForceMappingEnabled(); | ||
| 68 | const auto memory_pool_count = memory_pool_info.size(); | 67 | const auto memory_pool_count = memory_pool_info.size(); |
| 69 | const auto total_memory_pool_in = sizeof(ServerMemoryPoolInfo::InParams) * memory_pool_count; | 68 | const auto total_memory_pool_in = sizeof(ServerMemoryPoolInfo::InParams) * memory_pool_count; |
| 70 | const auto total_memory_pool_out = sizeof(ServerMemoryPoolInfo::OutParams) * memory_pool_count; | 69 | const auto total_memory_pool_out = sizeof(ServerMemoryPoolInfo::OutParams) * memory_pool_count; |
| @@ -174,7 +173,7 @@ bool InfoUpdater::UpdateVoices(VoiceContext& voice_context, | |||
| 174 | } | 173 | } |
| 175 | // Voice states for each channel | 174 | // Voice states for each channel |
| 176 | std::array<VoiceState*, AudioCommon::MAX_CHANNEL_COUNT> voice_states{}; | 175 | std::array<VoiceState*, AudioCommon::MAX_CHANNEL_COUNT> voice_states{}; |
| 177 | ASSERT(in_params.id < voice_count); | 176 | ASSERT(static_cast<std::size_t>(in_params.id) < voice_count); |
| 178 | 177 | ||
| 179 | // Grab our current voice info | 178 | // Grab our current voice info |
| 180 | auto& voice_info = voice_context.GetInfo(static_cast<std::size_t>(in_params.id)); | 179 | auto& voice_info = voice_context.GetInfo(static_cast<std::size_t>(in_params.id)); |
| @@ -352,8 +351,8 @@ ResultCode InfoUpdater::UpdateMixes(MixContext& mix_context, std::size_t mix_buf | |||
| 352 | for (std::size_t i = 0; i < mix_count; i++) { | 351 | for (std::size_t i = 0; i < mix_count; i++) { |
| 353 | const auto& in = mix_in_params[i]; | 352 | const auto& in = mix_in_params[i]; |
| 354 | total_buffer_count += in.buffer_count; | 353 | total_buffer_count += in.buffer_count; |
| 355 | if (in.dest_mix_id > mix_count && in.dest_mix_id != AudioCommon::NO_MIX && | 354 | if (static_cast<std::size_t>(in.dest_mix_id) > mix_count && |
| 356 | in.mix_id != AudioCommon::FINAL_MIX) { | 355 | in.dest_mix_id != AudioCommon::NO_MIX && in.mix_id != AudioCommon::FINAL_MIX) { |
| 357 | LOG_ERROR( | 356 | LOG_ERROR( |
| 358 | Audio, | 357 | Audio, |
| 359 | "Invalid mix destination, mix_id={:X}, dest_mix_id={:X}, mix_buffer_count={:X}", | 358 | "Invalid mix destination, mix_id={:X}, dest_mix_id={:X}, mix_buffer_count={:X}", |
diff --git a/src/audio_core/mix_context.cpp b/src/audio_core/mix_context.cpp index 042891490..4bca72eb0 100644 --- a/src/audio_core/mix_context.cpp +++ b/src/audio_core/mix_context.cpp | |||
| @@ -53,7 +53,7 @@ void MixContext::UpdateDistancesFromFinalMix() { | |||
| 53 | auto mix_id = in_params.mix_id; | 53 | auto mix_id = in_params.mix_id; |
| 54 | // Needs to be referenced out of scope | 54 | // Needs to be referenced out of scope |
| 55 | s32 distance_to_final_mix{AudioCommon::FINAL_MIX}; | 55 | s32 distance_to_final_mix{AudioCommon::FINAL_MIX}; |
| 56 | for (; distance_to_final_mix < info_count; distance_to_final_mix++) { | 56 | for (; distance_to_final_mix < static_cast<s32>(info_count); distance_to_final_mix++) { |
| 57 | if (mix_id == AudioCommon::FINAL_MIX) { | 57 | if (mix_id == AudioCommon::FINAL_MIX) { |
| 58 | // If we're at the final mix, we're done | 58 | // If we're at the final mix, we're done |
| 59 | break; | 59 | break; |
| @@ -77,7 +77,7 @@ void MixContext::UpdateDistancesFromFinalMix() { | |||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | // If we're out of range for our distance, mark it as no final mix | 79 | // If we're out of range for our distance, mark it as no final mix |
| 80 | if (distance_to_final_mix >= info_count) { | 80 | if (distance_to_final_mix >= static_cast<s32>(info_count)) { |
| 81 | distance_to_final_mix = AudioCommon::NO_FINAL_MIX; | 81 | distance_to_final_mix = AudioCommon::NO_FINAL_MIX; |
| 82 | } | 82 | } |
| 83 | 83 | ||
diff --git a/src/audio_core/splitter_context.cpp b/src/audio_core/splitter_context.cpp index 79bb2f516..f21b53147 100644 --- a/src/audio_core/splitter_context.cpp +++ b/src/audio_core/splitter_context.cpp | |||
| @@ -306,7 +306,7 @@ bool SplitterContext::UpdateInfo(const std::vector<u8>& input, std::size_t& inpu | |||
| 306 | break; | 306 | break; |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | if (header.send_id < 0 || header.send_id > info_count) { | 309 | if (header.send_id < 0 || static_cast<std::size_t>(header.send_id) > info_count) { |
| 310 | LOG_ERROR(Audio, "Bad splitter data id"); | 310 | LOG_ERROR(Audio, "Bad splitter data id"); |
| 311 | break; | 311 | break; |
| 312 | } | 312 | } |
| @@ -348,7 +348,7 @@ bool SplitterContext::UpdateData(const std::vector<u8>& input, std::size_t& inpu | |||
| 348 | break; | 348 | break; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | if (header.splitter_id < 0 || header.splitter_id > data_count) { | 351 | if (header.splitter_id < 0 || static_cast<std::size_t>(header.splitter_id) > data_count) { |
| 352 | LOG_ERROR(Audio, "Bad splitter data id"); | 352 | LOG_ERROR(Audio, "Bad splitter data id"); |
| 353 | break; | 353 | break; |
| 354 | } | 354 | } |
| @@ -434,7 +434,7 @@ const std::vector<s32>& NodeStates::GetIndexList() const { | |||
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | void NodeStates::PushTsortResult(s32 index) { | 436 | void NodeStates::PushTsortResult(s32 index) { |
| 437 | ASSERT(index < node_count); | 437 | ASSERT(index < static_cast<s32>(node_count)); |
| 438 | index_list[index_pos++] = index; | 438 | index_list[index_pos++] = index; |
| 439 | } | 439 | } |
| 440 | 440 | ||
diff --git a/src/audio_core/voice_context.cpp b/src/audio_core/voice_context.cpp index 1d8f69844..863ac9267 100644 --- a/src/audio_core/voice_context.cpp +++ b/src/audio_core/voice_context.cpp | |||
| @@ -488,11 +488,11 @@ s32 VoiceContext::DecodePcm16(s32* output_buffer, ServerWaveBuffer* wave_buffer, | |||
| 488 | 488 | ||
| 489 | // Fast path | 489 | // Fast path |
| 490 | if (channel_count == 1) { | 490 | if (channel_count == 1) { |
| 491 | for (std::size_t i = 0; i < samples_processed; i++) { | 491 | for (std::ptrdiff_t i = 0; i < samples_processed; i++) { |
| 492 | output_buffer[i] = buffer_data[i]; | 492 | output_buffer[i] = buffer_data[i]; |
| 493 | } | 493 | } |
| 494 | } else { | 494 | } else { |
| 495 | for (std::size_t i = 0; i < samples_processed; i++) { | 495 | for (std::ptrdiff_t i = 0; i < samples_processed; i++) { |
| 496 | output_buffer[i] = buffer_data[i * channel_count + channel]; | 496 | output_buffer[i] = buffer_data[i * channel_count + channel]; |
| 497 | } | 497 | } |
| 498 | } | 498 | } |