2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #6383 from degasus/fix_gcc_warnings

Fix two GCC 11 warnings: Unneeded copies.
This commit is contained in:
Mai M 2021-05-29 03:08:11 -04:00 committed by GitHub
commit 38dbe57797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -258,7 +258,7 @@ struct KernelCore::Impl {
KAutoObject::Create(thread.get()); KAutoObject::Create(thread.get());
ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess()); ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess());
thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId())); thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId()));
return std::move(thread); return thread;
}; };
thread_local auto thread = make_thread(); thread_local auto thread = make_thread();

View file

@ -596,7 +596,7 @@ void BufferCache<P>::PopAsyncFlushes() {
runtime.CopyBuffer(download_staging.buffer, slot_buffers[buffer_id], copies); runtime.CopyBuffer(download_staging.buffer, slot_buffers[buffer_id], copies);
} }
runtime.Finish(); runtime.Finish();
for (const auto [copy, buffer_id] : downloads) { for (const auto& [copy, buffer_id] : downloads) {
const Buffer& buffer = slot_buffers[buffer_id]; const Buffer& buffer = slot_buffers[buffer_id];
const VAddr cpu_addr = buffer.CpuAddr() + copy.src_offset; const VAddr cpu_addr = buffer.CpuAddr() + copy.src_offset;
// Undo the modified offset // Undo the modified offset
@ -606,7 +606,7 @@ void BufferCache<P>::PopAsyncFlushes() {
} }
} else { } else {
const std::span<u8> immediate_buffer = ImmediateBuffer(largest_copy); const std::span<u8> immediate_buffer = ImmediateBuffer(largest_copy);
for (const auto [copy, buffer_id] : downloads) { for (const auto& [copy, buffer_id] : downloads) {
Buffer& buffer = slot_buffers[buffer_id]; Buffer& buffer = slot_buffers[buffer_id];
buffer.ImmediateDownload(copy.src_offset, immediate_buffer.subspan(0, copy.size)); buffer.ImmediateDownload(copy.src_offset, immediate_buffer.subspan(0, copy.size));
const VAddr cpu_addr = buffer.CpuAddr() + copy.src_offset; const VAddr cpu_addr = buffer.CpuAddr() + copy.src_offset;