From 690cdff0d3f14a0375a193d3cee1f64a853d0b04 Mon Sep 17 00:00:00 2001 From: msuih Date: Fri, 28 Jun 2019 10:16:14 +0300 Subject: [PATCH] Minor fixes - Fix a typo in OpenAL - Fix typo in cellHttp.h - Unused variables in catch - Use 64-bit shifts - Use use_count with shared pointers, unique is depracated and getting removed - Explicitly cast boolean to int - Signed/unsigned issues with loop variables - Fix missing return statement (the code path is unreachable, but compiler wants a return) - */ ouside of comment - Fix duplicate layout name --- rpcs3/Emu/Audio/AL/OpenALBackend.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellHttp.h | 2 +- rpcs3/Emu/Cell/SPURecompiler.cpp | 10 +++++----- rpcs3/Emu/Cell/lv2/sys_mmapper.cpp | 2 +- rpcs3/Emu/Memory/vm.cpp | 2 +- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 2 +- rpcs3/Emu/RSX/gcm_printing.cpp | 1 + rpcs3/rpcs3qt/pad_settings_dialog.cpp | 2 +- rpcs3/rpcs3qt/qt_utils.cpp | 2 +- rpcs3/rpcs3qt/settings_dialog.ui | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp index 3c6c7a0878..331e19ea8f 100644 --- a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp +++ b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp @@ -128,7 +128,7 @@ bool OpenALBackend::AddData(const void* src, u32 num_samples) // Fail if there are no free buffers remaining if (m_num_unqueued == 0) { - LOG_WARNING(GENERAL, "XAudio2Backend : no unqueued buffers remaining"); + LOG_WARNING(GENERAL, "OpenALBackend : no unqueued buffers remaining"); return false; } diff --git a/rpcs3/Emu/Cell/Modules/cellHttp.h b/rpcs3/Emu/Cell/Modules/cellHttp.h index 2c014b9501..4df8e2b213 100644 --- a/rpcs3/Emu/Cell/Modules/cellHttp.h +++ b/rpcs3/Emu/Cell/Modules/cellHttp.h @@ -125,7 +125,7 @@ enum CELL_HTTPS_ERROR_CERT_KEY_MISMATCH = 0x80710a0a, CELL_HTTPS_ERROR_KEY_NEEDS_CERT = 0x80710a0b, CELL_HTTPS_ERROR_CERT_NEEDS_KEY = 0x80710a0c, - CELL_HTTPS_ERROR_RETRY_CONNECTION = 0x80710a01d, + CELL_HTTPS_ERROR_RETRY_CONNECTION = 0x80710a0d, CELL_HTTPS_ERROR_NET_SSL_CONNECT = 0x80710b00, CELL_HTTPS_ERROR_NET_SSL_SEND = 0x80710c00, CELL_HTTPS_ERROR_NET_SSL_RECV = 0x80710d00, diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 8cf722f113..aead7e4c84 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -4543,7 +4543,7 @@ public: { (this->*g_decoder.decode(op))({op}); } - catch (const std::exception& e) + catch (const std::exception&) { std::string dump; raw_string_ostream out(dump); @@ -4762,7 +4762,7 @@ public: // Create interpreter table const auto if_type = get_ftype(); const auto if_pptr = if_type->getPointerTo()->getPointerTo(); - m_function_table = new GlobalVariable(*m_module, ArrayType::get(if_type->getPointerTo(), 1u << m_interp_magn), true, GlobalValue::InternalLinkage, nullptr); + m_function_table = new GlobalVariable(*m_module, ArrayType::get(if_type->getPointerTo(), 1ull << m_interp_magn), true, GlobalValue::InternalLinkage, nullptr); // Add return function const auto ret_func = cast(module->getOrInsertFunction("spu_ret", if_type).getCallee()); @@ -4823,7 +4823,7 @@ public: // Fill interpreter table std::vector iptrs; - iptrs.reserve(1u << m_interp_magn); + iptrs.reserve(1ull << m_interp_magn); m_block = nullptr; @@ -4987,7 +4987,7 @@ public: } } } - catch (const std::exception& e) + catch (const std::exception&) { std::string dump; raw_string_ostream out(dump); @@ -5011,7 +5011,7 @@ public: } } - m_function_table->setInitializer(ConstantArray::get(ArrayType::get(if_type->getPointerTo(), 1u << m_interp_magn), iptrs)); + m_function_table->setInitializer(ConstantArray::get(ArrayType::get(if_type->getPointerTo(), 1ull << m_interp_magn), iptrs)); m_function_table = nullptr; // Initialize pass manager diff --git a/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp b/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp index 4ec30dd261..e1d0d85829 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp @@ -218,7 +218,7 @@ error_code sys_mmapper_free_address(u32 addr) return {CELL_EINVAL, addr}; } - if (!area.unique()) + if (area.use_count() != 1) { return CELL_EBUSY; } diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 029a9f20f9..85dd56d06a 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -988,7 +988,7 @@ namespace vm continue; } - if (must_be_empty && (!it->unique() || (*it)->imp_used(lock))) + if (must_be_empty && (it->use_count() != 1 || (*it)->imp_used(lock))) { return *it; } diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 8fc11a2fd5..c4844f35c9 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -481,7 +481,7 @@ VKGSRender::VKGSRender() : GSRender() m_occlusion_query_pool.create((*m_device), OCCLUSION_MAX_POOL_SIZE); m_occlusion_map.resize(occlusion_query_count); - for (int n = 0; n < occlusion_query_count; ++n) + for (u32 n = 0; n < occlusion_query_count; ++n) m_occlusion_query_data[n].driver_handle = n; //Generate frame contexts diff --git a/rpcs3/Emu/RSX/gcm_printing.cpp b/rpcs3/Emu/RSX/gcm_printing.cpp index 2bec16154d..9ab44de4cd 100644 --- a/rpcs3/Emu/RSX/gcm_printing.cpp +++ b/rpcs3/Emu/RSX/gcm_printing.cpp @@ -780,6 +780,7 @@ namespace case rsx::vertex_base_type::cmp: return "CMP"; case rsx::vertex_base_type::ub256: return "Unsigned byte unormalized"; } + return ""; } std::string unpack_vertex_format(u32 arg) diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index 0bb7e09642..67ef843403 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -685,7 +685,7 @@ void pad_settings_dialog::mouseReleaseEvent(QMouseEvent* event) ReactivateButtons(); } -void pad_settings_dialog::mouseMoveEvent(QMouseEvent*/* event*/) +void pad_settings_dialog::mouseMoveEvent(QMouseEvent* /*event*/) { if (m_handler->m_type != pad_handler::keyboard) { diff --git a/rpcs3/rpcs3qt/qt_utils.cpp b/rpcs3/rpcs3qt/qt_utils.cpp index 4fa63b8528..4ff3c4480f 100644 --- a/rpcs3/rpcs3qt/qt_utils.cpp +++ b/rpcs3/rpcs3qt/qt_utils.cpp @@ -207,7 +207,7 @@ namespace gui table->clearContents(); table->setRowCount(0); - for (u32 i = 0; i < item_count; ++i) + for (int i = 0; i < item_count; ++i) table->insertRow(i); if (table->horizontalScrollBar()) diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index e750a1037a..b11a24a96e 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -1239,7 +1239,7 @@ Disk cache - +