From db8e6fe7a71c223f0f7a42bbe0ec82c3f917f47a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 12 Jan 2021 13:01:06 +0300 Subject: [PATCH] Enable -Wunused-variable --- Utilities/Thread.cpp | 18 ++--- rpcs3/Crypto/ec.cpp | 6 +- rpcs3/Crypto/ec.h | 6 +- rpcs3/Crypto/key_vault.h | 70 ++++++++++---------- rpcs3/Crypto/unedat.cpp | 10 +-- rpcs3/Emu/CPU/CPUThread.cpp | 2 +- rpcs3/Emu/CPU/CPUTranslator.h | 1 - rpcs3/Emu/Cell/Modules/cellAudio.cpp | 6 +- rpcs3/Emu/Cell/Modules/cellDmux.cpp | 8 +-- rpcs3/Emu/Cell/Modules/cellGcmSys.cpp | 4 -- rpcs3/Emu/Cell/Modules/cellGifDec.cpp | 1 - rpcs3/Emu/Cell/Modules/cellL10n.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellNetCtl.cpp | 1 - rpcs3/Emu/Cell/Modules/cellPad.cpp | 2 - rpcs3/Emu/Cell/Modules/cellRtc.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellSail.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 8 +-- rpcs3/Emu/Cell/Modules/cellSearch.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellSpurs.cpp | 13 ++-- rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp | 10 +-- rpcs3/Emu/Cell/Modules/cellSync.cpp | 4 +- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 4 +- rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp | 13 ++-- rpcs3/Emu/Cell/PPUAnalyser.cpp | 4 +- rpcs3/Emu/Cell/PPUModule.cpp | 22 +++--- rpcs3/Emu/Cell/PPUThread.cpp | 4 +- rpcs3/Emu/Cell/PPUTranslator.cpp | 4 +- rpcs3/Emu/Cell/SPUDisAsm.cpp | 2 +- rpcs3/Emu/Cell/SPURecompiler.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_fs.cpp | 4 +- rpcs3/Emu/Cell/lv2/sys_net.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_spu.cpp | 2 +- rpcs3/Emu/Memory/vm.cpp | 4 +- rpcs3/Emu/Memory/vm_ptr.h | 2 +- rpcs3/Emu/RSX/Capture/rsx_capture.cpp | 8 +-- rpcs3/Emu/RSX/Common/BufferUtils.cpp | 7 +- rpcs3/Emu/RSX/Common/ProgramStateCache.cpp | 6 +- rpcs3/Emu/RSX/Common/texture_cache.h | 2 +- rpcs3/Emu/RSX/Common/texture_cache_helpers.h | 4 +- rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp | 2 +- rpcs3/Emu/RSX/RSXFragmentProgram.h | 2 +- rpcs3/Emu/RSX/RSXThread.cpp | 10 +-- rpcs3/Emu/RSX/VK/VKDMA.cpp | 2 +- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 4 +- rpcs3/Emu/RSX/VK/VKMemAlloc.cpp | 1 + rpcs3/Emu/RSX/VK/VKTextureCache.h | 4 +- rpcs3/Emu/RSX/rsx_cache.h | 2 +- rpcs3/Emu/RSX/rsx_utils.h | 6 +- rpcs3/Emu/System.cpp | 2 +- rpcs3/Emu/VFS.cpp | 4 +- rpcs3/Input/ds4_pad_handler.cpp | 4 +- rpcs3/Input/dualsense_pad_handler.cpp | 8 +-- rpcs3/cmake_modules/ConfigureCompiler.cmake | 1 - rpcs3/main.cpp | 2 +- rpcs3/rpcs3qt/custom_table_widget_item.cpp | 2 +- rpcs3/rpcs3qt/debugger_frame.cpp | 4 +- rpcs3/rpcs3qt/kernel_explorer.cpp | 2 +- rpcs3/rpcs3qt/main_window.cpp | 4 +- rpcs3/rpcs3qt/trophy_notification_frame.cpp | 2 +- rpcs3/util/atomic.cpp | 2 - rpcs3/util/vm_native.cpp | 2 +- 62 files changed, 167 insertions(+), 183 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 0a70e9b18d..b4cadf09a4 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -542,7 +542,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz } case 0x80: { - switch (auto mod_code = get_modRM_reg(code, 0)) + switch (get_modRM_reg(code, 0)) { //case 0: out_op = X64OP_ADD; break; // TODO: strange info in instruction manual case 1: out_op = X64OP_OR; break; @@ -561,7 +561,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz } case 0x81: { - switch (auto mod_code = get_modRM_reg(code, 0)) + switch (get_modRM_reg(code, 0)) { case 0: out_op = X64OP_ADD; break; case 1: out_op = X64OP_OR; break; @@ -580,7 +580,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz } case 0x83: { - switch (auto mod_code = get_modRM_reg(code, 0)) + switch (get_modRM_reg(code, 0)) { case 0: out_op = X64OP_ADD; break; case 1: out_op = X64OP_OR; break; @@ -721,7 +721,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f; const u8 vop1 = op1 == 0xc5 ? op3 : code[2]; const u8 vlen = (opx & 0x4) ? 32 : 16; - const u8 vreg = (~opx >> 3) & 0xf; + //const u8 vreg = (~opx >> 3) & 0xf; out_length += op1 == 0xc5 ? 2 : 3; code += op1 == 0xc5 ? 2 : 3; @@ -782,7 +782,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz } case 0xf6: { - switch (auto mod_code = get_modRM_reg(code, 0)) + switch (get_modRM_reg(code, 0)) { case 0: out_op = X64OP_LOAD_TEST; break; default: out_op = X64OP_NONE; break; // TODO... @@ -795,7 +795,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz } case 0xf7: { - switch (auto mod_code = get_modRM_reg(code, 0)) + switch (get_modRM_reg(code, 0)) { case 0: out_op = X64OP_LOAD_TEST; break; default: out_op = X64OP_NONE; break; // TODO... @@ -2027,11 +2027,11 @@ u64 thread_base::finalize(thread_state result_state) noexcept const u64 _self = m_thread; // Set result state (errored or finalized) - const bool ok = 0 == (3 & ~m_sync.fetch_op([&](u64& v) + m_sync.fetch_op([&](u64& v) { v &= -4; v |= static_cast(result_state); - })); + }); // Signal waiting threads m_sync.notify_all(2); @@ -2069,7 +2069,7 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept { s_pool_ctr |= s_stop_bit; - while (u64 remains = s_pool_ctr & ~s_stop_bit) + while (/*u64 remains = */s_pool_ctr & ~s_stop_bit) { for (u32 i = 0; i < std::size(s_thread_pool); i++) { diff --git a/rpcs3/Crypto/ec.cpp b/rpcs3/Crypto/ec.cpp index 72261e0b54..cf028d431b 100644 --- a/rpcs3/Crypto/ec.cpp +++ b/rpcs3/Crypto/ec.cpp @@ -464,7 +464,7 @@ static void ec_priv_to_pub(u8 *k, u8 *Q) } #endif -int ecdsa_set_curve(u8* p, u8* a, u8* b, u8* N, u8* Gx, u8* Gy) +int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy) { memcpy(ec_p, p, 20); memcpy(ec_a, a, 20); @@ -481,14 +481,14 @@ int ecdsa_set_curve(u8* p, u8* a, u8* b, u8* N, u8* Gx, u8* Gy) return 0; } -void ecdsa_set_pub(u8 *Q) +void ecdsa_set_pub(const u8* Q) { memcpy(ec_Q.x, Q, 20); memcpy(ec_Q.y, Q+20, 20); point_to_mon(&ec_Q); } -void ecdsa_set_priv(u8 *k) +void ecdsa_set_priv(const u8* k) { memcpy(ec_k, k, sizeof ec_k); } diff --git a/rpcs3/Crypto/ec.h b/rpcs3/Crypto/ec.h index 614727c3e0..49b4685c4e 100644 --- a/rpcs3/Crypto/ec.h +++ b/rpcs3/Crypto/ec.h @@ -7,7 +7,7 @@ #include #include -int ecdsa_set_curve(unsigned char *p, unsigned char *a, unsigned char *b, unsigned char *N, unsigned char *Gx, unsigned char *Gy); -void ecdsa_set_pub(unsigned char *Q); -void ecdsa_set_priv(unsigned char *k); +int ecdsa_set_curve(const unsigned char *p, const unsigned char *a, const unsigned char *b, const unsigned char *N, const unsigned char *Gx, const unsigned char *Gy); +void ecdsa_set_pub(const unsigned char *Q); +void ecdsa_set_priv(const unsigned char *k); int ecdsa_verify(unsigned char *hash, unsigned char *R, unsigned char *S); diff --git a/rpcs3/Crypto/key_vault.h b/rpcs3/Crypto/key_vault.h index 86f4590a41..84d52a4992 100644 --- a/rpcs3/Crypto/key_vault.h +++ b/rpcs3/Crypto/key_vault.h @@ -33,147 +33,147 @@ struct SELF_KEY SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct); }; -static u8 PKG_AES_KEY_IDU[0x10] = { +constexpr u8 PKG_AES_KEY_IDU[0x10] = { 0x5d, 0xb9, 0x11, 0xe6, 0xb7, 0xe5, 0x0a, 0x7d, 0x32, 0x15, 0x38, 0xfd, 0x7c, 0x66, 0xf1, 0x7b }; -static u8 PKG_AES_KEY[0x10] = { +constexpr u8 PKG_AES_KEY[0x10] = { 0x2e, 0x7b, 0x71, 0xd7, 0xc9, 0xc9, 0xa1, 0x4e, 0xa3, 0x22, 0x1f, 0x18, 0x88, 0x28, 0xb8, 0xf8 }; -static u8 PKG_AES_KEY2[0x10] = { +constexpr u8 PKG_AES_KEY2[0x10] = { 0x07, 0xf2, 0xc6, 0x82, 0x90, 0xb5, 0x0d, 0x2c, 0x33, 0x81, 0x8d, 0x70, 0x9b, 0x60, 0xe6, 0x2b }; -static u8 PKG_AES_KEY_VITA_1[0x10] = { +constexpr u8 PKG_AES_KEY_VITA_1[0x10] = { 0xE3, 0x1A, 0x70, 0xC9, 0xCE, 0x1D, 0xD7, 0x2B, 0xF3, 0xC0, 0x62, 0x29, 0x63, 0xF2, 0xEC, 0xCB }; -static u8 PKG_AES_KEY_VITA_2[0x10] = { +constexpr u8 PKG_AES_KEY_VITA_2[0x10] = { 0x42, 0x3A, 0xCA, 0x3A, 0x2B, 0xD5, 0x64, 0x9F, 0x96, 0x86, 0xAB, 0xAD, 0x6F, 0xD8, 0x80, 0x1F }; -static u8 PKG_AES_KEY_VITA_3[0x10] = { +constexpr u8 PKG_AES_KEY_VITA_3[0x10] = { 0xAF, 0x07, 0xFD, 0x59, 0x65, 0x25, 0x27, 0xBA, 0xF1, 0x33, 0x89, 0x66, 0x8B, 0x17, 0xD9, 0xEA }; -static u8 NP_IDPS[0x10] = { +constexpr u8 NP_IDPS[0x10] = { 0x5E, 0x06, 0xE0, 0x4F, 0xD9, 0x4A, 0x71, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; -static u8 NP_KLIC_FREE[0x10] = { +constexpr u8 NP_KLIC_FREE[0x10] = { 0x72, 0xF9, 0x90, 0x78, 0x8F, 0x9C, 0xFF, 0x74, 0x57, 0x25, 0xF0, 0x8E, 0x4C, 0x12, 0x83, 0x87 }; -static u8 NP_OMAC_KEY_2[0x10] = { +constexpr u8 NP_OMAC_KEY_2[0x10] = { 0x6B, 0xA5, 0x29, 0x76, 0xEF, 0xDA, 0x16, 0xEF, 0x3C, 0x33, 0x9F, 0xB2, 0x97, 0x1E, 0x25, 0x6B }; -static u8 NP_OMAC_KEY_3[0x10] = { +constexpr u8 NP_OMAC_KEY_3[0x10] = { 0x9B, 0x51, 0x5F, 0xEA, 0xCF, 0x75, 0x06, 0x49, 0x81, 0xAA, 0x60, 0x4D, 0x91, 0xA5, 0x4E, 0x97 }; -static u8 NP_KLIC_KEY[0x10] = { +constexpr u8 NP_KLIC_KEY[0x10] = { 0xF2, 0xFB, 0xCA, 0x7A, 0x75, 0xB0, 0x4E, 0xDC, 0x13, 0x90, 0x63, 0x8C, 0xCD, 0xFD, 0xD1, 0xEE }; -static u8 NP_RIF_KEY[0x10] = { +constexpr u8 NP_RIF_KEY[0x10] = { 0xDA, 0x7D, 0x4B, 0x5E, 0x49, 0x9A, 0x4F, 0x53, 0xB1, 0xC1, 0xA1, 0x4A, 0x74, 0x84, 0x44, 0x3B }; // PSP Minis -static u8 NP_PSP_KEY_1[0x10] = { +constexpr u8 NP_PSP_KEY_1[0x10] = { 0x2A, 0x6A, 0xFB, 0xCF, 0x43, 0xD1, 0x57, 0x9F, 0x7D, 0x73, 0x87, 0x41, 0xA1, 0x3B, 0xD4, 0x2E }; // PSP Remasters -static u8 NP_PSP_KEY_2[0x10] = { +constexpr u8 NP_PSP_KEY_2[0x10] = { 0x0D, 0xB8, 0x57, 0x32, 0x36, 0x6C, 0xD7, 0x34, 0xFC, 0x87, 0x9E, 0x74, 0x33, 0x43, 0xBB, 0x4F }; -static u8 NP_PSX_KEY[0x10] = { +constexpr u8 NP_PSX_KEY[0x10] = { 0x52, 0xC0, 0xB5, 0xCA, 0x76, 0xD6, 0x13, 0x4B, 0xB4, 0x5F, 0xC6, 0x6C, 0xA6, 0x37, 0xF2, 0xC1 }; -static u8 RAP_KEY[0x10] = { +constexpr u8 RAP_KEY[0x10] = { 0x86, 0x9F, 0x77, 0x45, 0xC1, 0x3F, 0xD8, 0x90, 0xCC, 0xF2, 0x91, 0x88, 0xE3, 0xCC, 0x3E, 0xDF }; -static u8 RAP_PBOX[0x10] = { +constexpr u8 RAP_PBOX[0x10] = { 0x0C, 0x03, 0x06, 0x04, 0x01, 0x0B, 0x0F, 0x08, 0x02, 0x07, 0x00, 0x05, 0x0A, 0x0E, 0x0D, 0x09 }; -static u8 RAP_E1[0x10] = { +constexpr u8 RAP_E1[0x10] = { 0xA9, 0x3E, 0x1F, 0xD6, 0x7C, 0x55, 0xA3, 0x29, 0xB7, 0x5F, 0xDD, 0xA6, 0x2A, 0x95, 0xC7, 0xA5 }; -static u8 RAP_E2[0x10] = { +constexpr u8 RAP_E2[0x10] = { 0x67, 0xD4, 0x5D, 0xA3, 0x29, 0x6D, 0x00, 0x6A, 0x4E, 0x7C, 0x53, 0x7B, 0xF5, 0x53, 0x8C, 0x74 }; -static u8 SDAT_KEY[0x10] = { +constexpr u8 SDAT_KEY[0x10] = { 0x0D, 0x65, 0x5E, 0xF8, 0xE6, 0x74, 0xA9, 0x8A, 0xB8, 0x50, 0x5C, 0xFA, 0x7D, 0x01, 0x29, 0x33 }; -static u8 EDAT_KEY_0[0x10] = { +constexpr u8 EDAT_KEY_0[0x10] = { 0xBE, 0x95, 0x9C, 0xA8, 0x30, 0x8D, 0xEF, 0xA2, 0xE5, 0xE1, 0x80, 0xC6, 0x37, 0x12, 0xA9, 0xAE }; -static u8 EDAT_HASH_0[0x10] = { +constexpr u8 EDAT_HASH_0[0x10] = { 0xEF, 0xFE, 0x5B, 0xD1, 0x65, 0x2E, 0xEB, 0xC1, 0x19, 0x18, 0xCF, 0x7C, 0x04, 0xD4, 0xF0, 0x11 }; -static u8 EDAT_KEY_1[0x10] = { +constexpr u8 EDAT_KEY_1[0x10] = { 0x4C, 0xA9, 0xC1, 0x4B, 0x01, 0xC9, 0x53, 0x09, 0x96, 0x9B, 0xEC, 0x68, 0xAA, 0x0B, 0xC0, 0x81 }; -static u8 EDAT_HASH_1[0x10] = { +constexpr u8 EDAT_HASH_1[0x10] = { 0x3D, 0x92, 0x69, 0x9B, 0x70, 0x5B, 0x07, 0x38, 0x54, 0xD8, 0xFC, 0xC6, 0xC7, 0x67, 0x27, 0x47 }; -static u8 EDAT_IV[0x10] = { +constexpr u8 EDAT_IV[0x10] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static u8 VSH_CURVE_P[0x14] = { +constexpr u8 VSH_CURVE_P[0x14] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; -static u8 VSH_CURVE_A[0x14] = { +constexpr u8 VSH_CURVE_A[0x14] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC }; -static u8 VSH_CURVE_B[0x14] = { +constexpr u8 VSH_CURVE_B[0x14] = { 0xA6, 0x8B, 0xED, 0xC3, 0x34, 0x18, 0x02, 0x9C, 0x1D, 0x3C, 0xE3, 0x3B, 0x9A, 0x32, 0x1F, 0xCC, 0xBB, 0x9E, 0x0F, 0x0B }; -static u8 VSH_CURVE_N[0x15] = { +constexpr u8 VSH_CURVE_N[0x15] = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xB5, 0xAE, 0x3C, 0x52, 0x3E, 0x63, 0x94, 0x4F, 0x21, 0x27 }; -static u8 VSH_CURVE_GX[0x14] = { +constexpr u8 VSH_CURVE_GX[0x14] = { 0x12, 0x8E, 0xC4, 0x25, 0x64, 0x87, 0xFD, 0x8F, 0xDF, 0x64, 0xE2, 0x43, 0x7B, 0xC0, 0xA1, 0xF6, 0xD5, 0xAF, 0xDE, 0x2C }; -static u8 VSH_CURVE_GY[0x14] = { +constexpr u8 VSH_CURVE_GY[0x14] = { 0x59, 0x58, 0x55, 0x7E, 0xB1, 0xDB, 0x00, 0x12, 0x60, 0x42, 0x55, 0x24, 0xDB, 0xC3, 0x79, 0xD5, 0xAC, 0x5F, 0x4A, 0xDF }; -static u8 VSH_PUB[0x28] = { +constexpr u8 VSH_PUB[0x28] = { 0x62, 0x27, 0xB0, 0x0A, 0x02, 0x85, 0x6F, 0xB0, 0x41, 0x08, 0x87, 0x67, 0x19, 0xE0, 0xA0, 0x18, 0x32, 0x91, 0xEE, 0xB9, 0x6E, 0x73, 0x6A, 0xBF, 0x81, 0xF7, 0x0E, 0xE9, 0x16, 0x1B, 0x0D, 0xDE, 0xB0, 0x26, 0x76, 0x1A, 0xFF, 0x7B, 0xC8, 0x5B }; -static u8 SCEPKG_RIV[0x10] = { +constexpr u8 SCEPKG_RIV[0x10] = { 0x4A, 0xCE, 0xF0, 0x12, 0x24, 0xFB, 0xEE, 0xDF, 0x82, 0x45, 0xF8, 0xFF, 0x10, 0x21, 0x1E, 0x6E }; -static u8 SCEPKG_ERK[0x20] = { +constexpr u8 SCEPKG_ERK[0x20] = { 0xA9, 0x78, 0x18, 0xBD, 0x19, 0x3A, 0x67, 0xA1, 0x6F, 0xE8, 0x3A, 0x85, 0x5E, 0x1B, 0xE9, 0xFB, 0x56, 0x40, 0x93, 0x8D, 0x4D, 0xBC, 0xB2, 0xCB, 0x52, 0xC5, 0xA2, 0xF8, 0xB0, 0x2B, 0x10, 0x31 }; -static u8 PUP_KEY[0x40] = { +constexpr u8 PUP_KEY[0x40] = { 0xF4, 0x91, 0xAD, 0x94, 0xC6, 0x81, 0x10, 0x96, 0x91, 0x5F, 0xD5, 0xD2, 0x44, 0x81, 0xAE, 0xDC, 0xED, 0xED, 0xBE, 0x6B, 0xE5, 0x13, 0x72, 0x4D, 0xD8, 0xF7, 0xB6, 0x91, 0xE8, 0x8A, 0x38, 0xF4, 0xB5, 0x16, 0x2B, 0xFB, 0xEC, 0xBE, 0x3A, 0x62, 0x18, 0x5D, 0xD7, 0xC9, 0x4D, 0xA2, 0x22, 0x5A, 0xDA, 0x3F, 0xBF, 0xCE, 0x55, 0x5B, 0x9E, 0xA9, 0x64, 0x98, 0x29, 0xEB, diff --git a/rpcs3/Crypto/unedat.cpp b/rpcs3/Crypto/unedat.cpp index 3ec0d3c388..be0a746fe3 100644 --- a/rpcs3/Crypto/unedat.cpp +++ b/rpcs3/Crypto/unedat.cpp @@ -20,7 +20,7 @@ void generate_key(int crypto_mode, int version, unsigned char *key_final, unsign case 0x10000000: // Encrypted ERK. // Decrypt the key with EDAT_KEY + EDAT_IV and copy the original IV. - aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, key, key_final, 0x10); + aescbc128_decrypt(const_cast(version ? EDAT_KEY_1 : EDAT_KEY_0), const_cast(EDAT_IV), key, key_final, 0x10); memcpy(iv_final, iv, 0x10); break; case 0x20000000: @@ -46,7 +46,7 @@ void generate_hash(int hash_mode, int version, unsigned char *hash_final, unsign case 0x10000000: // Encrypted HASH. // Decrypt the hash with EDAT_KEY + EDAT_IV. - aescbc128_decrypt(version ? EDAT_KEY_1 : EDAT_KEY_0, EDAT_IV, hash, hash_final, 0x10); + aescbc128_decrypt(const_cast(version ? EDAT_KEY_1 : EDAT_KEY_0), const_cast(EDAT_IV), hash, hash_final, 0x10); break; case 0x20000000: // Default HASH. @@ -602,9 +602,9 @@ int validate_npd_hashes(const char* file_name, const u8* klicensee, NPD_HEADER * // Hash with NPDRM_OMAC_KEY_3 and compare with title_hash. // Try to ignore case sensivity with file extension title_hash_result = - cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf.get(), buf_len, npd->title_hash, 0x10) || - cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf_lower.get(), buf_len, npd->title_hash, 0x10) || - cmac_hash_compare(NP_OMAC_KEY_3, 0x10, buf_upper.get(), buf_len, npd->title_hash, 0x10); + cmac_hash_compare(const_cast(NP_OMAC_KEY_3), 0x10, buf.get(), buf_len, npd->title_hash, 0x10) || + cmac_hash_compare(const_cast(NP_OMAC_KEY_3), 0x10, buf_lower.get(), buf_len, npd->title_hash, 0x10) || + cmac_hash_compare(const_cast(NP_OMAC_KEY_3), 0x10, buf_upper.get(), buf_len, npd->title_hash, 0x10); if (verbose) { diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 5feaddaa11..8aecfbbc38 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -258,7 +258,7 @@ thread_local cpu_thread* g_tls_current_cpu_thread = nullptr; static atomic_t s_cpu_counter{0}; // List of posted tasks for suspend_all -static atomic_t s_cpu_work[128]{}; +//static atomic_t s_cpu_work[128]{}; // Linked list of pushed tasks for suspend_all static atomic_t s_pushed{}; diff --git a/rpcs3/Emu/CPU/CPUTranslator.h b/rpcs3/Emu/CPU/CPUTranslator.h index 7f8c021a14..c04292a070 100644 --- a/rpcs3/Emu/CPU/CPUTranslator.h +++ b/rpcs3/Emu/CPU/CPUTranslator.h @@ -2809,7 +2809,6 @@ public: const auto data0 = a.eval(m_ir); const auto data1 = b.eval(m_ir); const auto index = c.eval(m_ir); - const auto zeros = llvm::ConstantAggregateZero::get(get_type()); if (auto c = llvm::dyn_cast(index)) { diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.cpp b/rpcs3/Emu/Cell/Modules/cellAudio.cpp index a0fd3dd124..c2d4cdcea7 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudio.cpp @@ -347,7 +347,6 @@ u64 audio_ringbuffer::update() void audio_port::tag(s32 offset) { - auto port_pos = position(offset); auto port_buf = get_vm_ptr(offset); // This tag will be used to make sure that the game has finished writing the audio for the next audio period @@ -381,7 +380,6 @@ std::tuple cell_audio_thread::count_port_buffer_tags() active++; auto port_buf = port.get_vm_ptr(); - u32 port_pos = port.position(); // Find the last tag that has been touched const u32 tag_first_pos = port.num_channels == 2 ? PORT_BUFFER_TAG_FIRST_2CH : port.num_channels == 6 ? PORT_BUFFER_TAG_FIRST_6CH : PORT_BUFFER_TAG_FIRST_8CH; @@ -614,7 +612,7 @@ void cell_audio_thread::operator()() m_dynamic_period = 0; u32 untouched_expected = 0; - u32 in_progress_expected = 0; + //u32 in_progress_expected = 0; // Main cellAudio loop while (thread_ctrl::state() != thread_state::aborting) @@ -893,7 +891,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset) if (port.state != audio_port_state::started) continue; auto buf = port.get_vm_ptr(offset); - static const float k = 1.f; + static constexpr float minus_3db = 0.707f; // value taken from https://www.dolby.com/us/en/technologies/a-guide-to-dolby-metadata.pdf float m = master_volume; diff --git a/rpcs3/Emu/Cell/Modules/cellDmux.cpp b/rpcs3/Emu/Cell/Modules/cellDmux.cpp index df3607620c..0303794eb3 100644 --- a/rpcs3/Emu/Cell/Modules/cellDmux.cpp +++ b/rpcs3/Emu/Cell/Modules/cellDmux.cpp @@ -226,11 +226,11 @@ public: DemuxerStream stream = {}; ElementaryStream* esALL[96]{}; ElementaryStream** esAVC = &esALL[0]; // AVC (max 16 minus M2V count) - ElementaryStream** esM2V = &esALL[16]; // M2V (max 16 minus AVC count) - ElementaryStream** esDATA = &esALL[32]; // user data (max 16) + //ElementaryStream** esM2V = &esALL[16]; // M2V (max 16 minus AVC count) + //ElementaryStream** esDATA = &esALL[32]; // user data (max 16) ElementaryStream** esATX = &esALL[48]; // ATRAC3+ (max 16) - ElementaryStream** esAC3 = &esALL[64]; // AC3 (max 16) - ElementaryStream** esPCM = &esALL[80]; // LPCM (max 16) + //ElementaryStream** esAC3 = &esALL[64]; // AC3 (max 16) + //ElementaryStream** esPCM = &esALL[80]; // LPCM (max 16) u32 cb_add = 0; diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index 2ff3680b61..6fb0100365 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -602,8 +602,6 @@ void cellGcmSetSecondVFrequency(u32 freq) { cellGcmSys.warning("cellGcmSetSecondVFrequency(level=%d)", freq); - const auto render = rsx::get_current_renderer(); - switch (freq) { case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ: @@ -1104,8 +1102,6 @@ error_code GcmUnmapIoAddress(ppu_thread& ppu, gcm_config* cfg, u32 io) return error; } - const auto render = rsx::get_current_renderer(); - for (u32 i = 0; i < size; i++) { cfg->offsetTable.ioAddress[ea + i] = 0xFFFF; diff --git a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp index f8796031d1..b3bd0e0567 100644 --- a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp @@ -106,7 +106,6 @@ error_code cellGifDecReadHeader(PMainHandle mainHandle, PSubHandle subHandle, PI cellGifDec.warning("cellGifDecReadHeader(mainHandle=*0x%x, subHandle=*0x%x, info=*0x%x)", mainHandle, subHandle, info); const u32& fd = subHandle->fd; - const u64& fileSize = subHandle->fileSize; CellGifDecInfo& current_info = subHandle->info; // Write the header to buffer diff --git a/rpcs3/Emu/Cell/Modules/cellL10n.cpp b/rpcs3/Emu/Cell/Modules/cellL10n.cpp index a527008a2c..75e45e921d 100644 --- a/rpcs3/Emu/Cell/Modules/cellL10n.cpp +++ b/rpcs3/Emu/Cell/Modules/cellL10n.cpp @@ -258,7 +258,7 @@ s32 _ConvertStr(s32 src_code, const void *src, s32 src_len, s32 dst_code, void * char buf[16]; while (srcLen > 0) { - char *bufPtr = buf; + //char *bufPtr = buf; usz bufLeft = sizeof(buf); usz ictd = iconv(ict, const_cast(reinterpret_cast(&src)), &srcLen, reinterpret_cast(&dst), &bufLeft); *dst_len += sizeof(buf) - bufLeft; @@ -301,7 +301,7 @@ s32 _L10nConvertChar(s32 src_code, const void *src, s32 src_len, s32 dst_code, v s32 _L10nConvertCharNoResult(s32 src_code, const void *src, s32 src_len, s32 dst_code, vm::ptr dst) { s32 dstLen = 0x7FFFFFFF; - s32 result = _ConvertStr(src_code, src, src_len, dst_code, dst.get_ptr(), &dstLen, true); + [[maybe_unused]] s32 result = _ConvertStr(src_code, src, src_len, dst_code, dst.get_ptr(), &dstLen, true); return dstLen; } diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp index 5a00b17c13..af3152d726 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp @@ -445,7 +445,6 @@ error_code cellGameUpdateCheckStartAsyncEx(vm::cptr param, error_code cellGameUpdateCheckFinishAsyncEx(vm::ptr cb_func, vm::ptr userdata) { cellNetCtl.todo("cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); - const s32 PROCESSING_COMPLETE = 5; sysutil_register_cb([=](ppu_thread& ppu) -> s32 { cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK}), userdata); diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index 6b4b2b7d94..d3692a6427 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -765,8 +765,6 @@ error_code cellPadSetPortSetting(u32 port_no, u32 port_setting) if (!config->max_connect) return CELL_PAD_ERROR_UNINITIALIZED; - const auto handler = pad::get_current_handler(); - if (port_no >= CELL_MAX_PADS) return CELL_PAD_ERROR_INVALID_PARAMETER; diff --git a/rpcs3/Emu/Cell/Modules/cellRtc.cpp b/rpcs3/Emu/Cell/Modules/cellRtc.cpp index 0e83d4bce3..250d657366 100644 --- a/rpcs3/Emu/Cell/Modules/cellRtc.cpp +++ b/rpcs3/Emu/Cell/Modules/cellRtc.cpp @@ -1338,7 +1338,7 @@ error_code cellRtcSetCurrentTick(vm::cptr pTick) return CELL_RTC_ERROR_INVALID_POINTER; } - u64 tmp = pTick->tick + 0xff23400100d44000; + //u64 tmp = pTick->tick + 0xff23400100d44000; if (!(0xdcbffeff2bbfff < pTick->tick)) { return CELL_RTC_ERROR_INVALID_ARG; diff --git a/rpcs3/Emu/Cell/Modules/cellSail.cpp b/rpcs3/Emu/Cell/Modules/cellSail.cpp index 30638df76d..d1e4ad341d 100644 --- a/rpcs3/Emu/Cell/Modules/cellSail.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSail.cpp @@ -839,7 +839,7 @@ error_code cellSailPlayerCreateDescriptor(vm::ptr pSelf, s32 str ensure(f.read(buf, size) == size); u32 sp_ = vm::alloc(sizeof(CellPamfReader), vm::main); auto sp = vm::ptr::make(sp_); - u32 reader = cellPamfReaderInitialize(sp, bufPtr, size, 0); + [[maybe_unused]] u32 err = cellPamfReaderInitialize(sp, bufPtr, size, 0); descriptor->buffer = buffer; descriptor->sp_ = sp_; diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 08cdf9c9d2..96dc17009c 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -301,7 +301,7 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C lv2_obj::sleep(ppu); // Get user confirmation by opening a blocking dialog (return value should be irrelevant here) - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, use_invalid_message ? result.invalidMsg : vm::make_str(msg)); + [[maybe_unused]] error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, use_invalid_message ? result.invalidMsg : vm::make_str(msg)); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -1454,7 +1454,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return {CELL_SAVEDATA_ERROR_PARAM, "50"}; } - switch (const u32 mode = statSet->reCreateMode & CELL_SAVEDATA_RECREATE_MASK) + switch (statSet->reCreateMode & CELL_SAVEDATA_RECREATE_MASK) { case CELL_SAVEDATA_RECREATE_NO: { @@ -1767,7 +1767,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } // Read from memory file to vm - const u64 sr = file->second.seek(fileSet->fileOffset); + file->second.seek(fileSet->fileOffset); const u64 rr = lv2_file::op_read(file->second, fileSet->fileBuf, fileSet->fileSize); fileGet->excSize = ::narrow(rr); break; @@ -1849,7 +1849,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } // Write to memory file normally - const u64 sr = file.seek(fileSet->fileOffset); + file.seek(fileSet->fileOffset); const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); fileGet->excSize = ::narrow(wr); all_times.erase(file_path); diff --git a/rpcs3/Emu/Cell/Modules/cellSearch.cpp b/rpcs3/Emu/Cell/Modules/cellSearch.cpp index d9fd6aa5cf..ae524c3381 100644 --- a/rpcs3/Emu/Cell/Modules/cellSearch.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSearch.cpp @@ -323,7 +323,7 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo auto found = content_map->find(hash); if (found == content_map->end()) // content isn't yet being tracked { - auto ext_offset = item.name.find_last_of('.'); // used later if no "Title" found + //auto ext_offset = item.name.find_last_of('.'); // used later if no "Title" found std::shared_ptr curr_find = std::make_shared(); if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX) diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp index cebe8c7e8e..1374d86f78 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.cpp @@ -517,7 +517,7 @@ s32 _spurs::create_lv2_eq(ppu_thread& ppu, vm::ptr spurs, vm::ptr spurs, u32 p return rc; } - if (s32 rc = sys_event_port_create(ppu, spurs.ptr(&CellSpurs::eventPort), SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME)) + if (sys_event_port_create(ppu, spurs.ptr(&CellSpurs::eventPort), SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME)) { - if (s32 rc2 = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) + if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) { return CELL_SPURS_CORE_ERROR_AGAIN; } @@ -909,11 +909,11 @@ s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr spurs, u32 p return CELL_SPURS_CORE_ERROR_AGAIN; } - if (s32 rc = sys_event_port_connect_local(ppu, spurs->eventPort, spurs->eventQueue)) + if (sys_event_port_connect_local(ppu, spurs->eventPort, spurs->eventQueue)) { sys_event_port_destroy(ppu, spurs->eventPort); - if (s32 rc2 = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) + if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -939,7 +939,7 @@ s32 _spurs::create_event_helper(ppu_thread& ppu, vm::ptr spurs, u32 p sys_event_port_disconnect(ppu, spurs->eventPort); sys_event_port_destroy(ppu, spurs->eventPort); - if (s32 rc = _spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) + if (_spurs::detach_lv2_eq(spurs, spurs->spuPort, true)) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -4631,7 +4631,6 @@ s32 cellSpursJoinJobChain(ppu_thread& ppu, vm::ptr jobChain) return CELL_SPURS_JOB_ERROR_ALIGN; const u32 wid = jobChain->workloadId; - const auto spurs = +jobChain->spurs; if (wid >= CELL_SPURS_MAX_WORKLOAD2) return CELL_SPURS_JOB_ERROR_INVAL; diff --git a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp index c3d022a227..ca788536eb 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp @@ -743,7 +743,7 @@ bool spursKernelEntry(spu_thread& spu) bool spursSysServiceEntry(spu_thread& spu) { const auto ctxt = spu._ptr(spu.gpr[3]._u32[3]); - auto arg = spu.gpr[4]._u64[1]; + //auto arg = spu.gpr[4]._u64[1]; auto pollStatus = spu.gpr[5]._u32[3]; { @@ -2059,11 +2059,11 @@ s32 spursTasksetLoadElf(spu_thread& spu, u32* entryPoint, u32* lowestLoadAddr, u //---------------------------------------------------------------------------- bool spursJobChainEntry(spu_thread& spu) { - const auto ctxt = spu._ptr(0x4a00); - auto kernelCtxt = spu._ptr(spu.gpr[3]._u32[3]); + //const auto ctxt = spu._ptr(0x4a00); + //auto kernelCtxt = spu._ptr(spu.gpr[3]._u32[3]); - auto arg = spu.gpr[4]._u64[1]; - auto pollStatus = spu.gpr[5]._u32[3]; + //auto arg = spu.gpr[4]._u64[1]; + //auto pollStatus = spu.gpr[5]._u32[3]; // TODO return false; diff --git a/rpcs3/Emu/Cell/Modules/cellSync.cpp b/rpcs3/Emu/Cell/Modules/cellSync.cpp index 705d907f2c..61d8b672c3 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSync.cpp @@ -681,7 +681,7 @@ error_code cellSyncQueueSize(vm::ptr queue) return CELL_SYNC_ERROR_ALIGN; } - const u32 depth = queue->check_depth(); + queue->check_depth(); return not_an_error(queue->ctrl.load().count & 0xffffff); } @@ -700,7 +700,7 @@ error_code cellSyncQueueClear(ppu_thread& ppu, vm::ptr queue) return CELL_SYNC_ERROR_ALIGN; } - const u32 depth = queue->check_depth(); + queue->check_depth(); while (!queue->ctrl.atomic_op(&CellSyncQueue::try_clear_begin_1)) { diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index e92f206aac..17db2d3ce2 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -461,7 +461,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 { cellVdec.warning("cellVdecQueryAttr: AVC (profile=%d)", profile); - const vm::ptr sinfo = vm::cast(spec_addr); + //const vm::ptr sinfo = vm::cast(spec_addr); // TODO: sinfo @@ -557,7 +557,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 { cellVdec.warning("cellVdecQueryAttr: DivX (profile=%d)", profile); - const vm::ptr sinfo = vm::cast(spec_addr); + //const vm::ptr sinfo = vm::cast(spec_addr); // TODO: sinfo diff --git a/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp b/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp index 98a95d65ec..adba0e11ec 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp @@ -97,7 +97,6 @@ error_code sceNpCommerce2Term() error_code sceNpCommerce2CreateCtx(u32 version, vm::cptr npId, vm::ptr handler, vm::ptr arg, vm::ptr ctx_id) { sceNpCommerce2.warning("sceNpCommerce2CreateCtx(version=%d, npId=*0x%x, handler=*0x%x, arg=*0x%x, ctx_id=*0x%x)", version, npId, handler, arg, ctx_id); - const auto nph = g_fxo->get>(); *ctx_id = create_commerce2_context(version, npId, handler, arg); @@ -107,10 +106,9 @@ error_code sceNpCommerce2CreateCtx(u32 version, vm::cptr npId, vm::ptr< s32 sceNpCommerce2DestroyCtx(u32 ctx_id) { sceNpCommerce2.warning("sceNpCommerce2DestroyCtx(ctx_id=%d)", ctx_id); - const auto nph = g_fxo->get>(); destroy_commerce2_context(ctx_id); - + return CELL_OK; } @@ -118,13 +116,12 @@ s32 sceNpCommerce2EmptyStoreCheckStart(u32 ctx_id, s32 store_check_type, vm::cpt { sceNpCommerce2.warning("sceNpCommerce2EmptyStoreCheckStart(ctx_id=%d, store_check_type=%d, target_id=*0x%x(%s))", ctx_id, store_check_type, target_id, target_id); - const auto nph = g_fxo->get>(); - const auto ctx = get_commerce2_context(ctx_id); if (ctx->context_callback) { - sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 { + sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 + { ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_EMPTY_STORE_CHECK_DONE, 0, ctx->context_callback_param); return 0; }); @@ -149,13 +146,13 @@ s32 sceNpCommerce2EmptyStoreCheckFinish(u32 ctx_id, vm::ptr is_empty) s32 sceNpCommerce2CreateSessionStart(u32 ctx_id) { sceNpCommerce2.warning("sceNpCommerce2CreateSessionStart(ctx_id=%d)", ctx_id); - const auto nph = g_fxo->get>(); const auto ctx = get_commerce2_context(ctx_id); if (ctx->context_callback) { - sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 { + sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 + { ctx->context_callback(cb_ppu, ctx_id, 0, SCE_NP_COMMERCE2_EVENT_CREATE_SESSION_DONE, 0, ctx->context_callback_param); return 0; }); diff --git a/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp index 42cb72c2d1..b184f79ba8 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.cpp +++ b/rpcs3/Emu/Cell/PPUAnalyser.cpp @@ -666,8 +666,8 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) const u32 _toc = ptr[1]; // Rough Table of Contents borders - const u32 _toc_begin = _toc - 0x8000; - const u32 _toc_end = _toc + 0x8000; + //const u32 _toc_begin = _toc - 0x8000; + //const u32 _toc_end = _toc + 0x8000; // TODO: improve TOC constraints if (_toc % 4 || !vm::check_addr(_toc) || _toc >= 0x40000000 || (_toc >= start && _toc < end)) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 75464c4a3b..2607a428cd 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -626,7 +626,7 @@ static auto ppu_load_imports(std::vector& relocs, ppu_linkage_info* l } // Static module - const auto _sm = ppu_module_manager::get_module(module_name); + //const auto _sm = ppu_module_manager::get_module(module_name); // Module linkage auto& mlink = link->modules[module_name]; @@ -820,7 +820,7 @@ std::shared_ptr ppu_load_prx(const ppu_prx_object& elf, const std::stri { const u32 mem_size = ::narrow(prog.p_memsz); const u32 file_size = ::narrow(prog.p_filesz); - const u32 init_addr = ::narrow(prog.p_vaddr); + //const u32 init_addr = ::narrow(prog.p_vaddr); // Alloc segment memory const u32 addr = vm::alloc(mem_size, vm::main); @@ -892,7 +892,7 @@ std::shared_ptr ppu_load_prx(const ppu_prx_object& elf, const std::stri // Do relocations for (auto& prog : elf.progs) { - switch (const u32 p_type = prog.p_type) + switch (prog.p_type) { case 0x700000a4: { @@ -1161,7 +1161,8 @@ void ppu_load_exec(const ppu_exec_object& elf) const u32 addr = _seg.addr = vm::cast(prog.p_vaddr); const u32 size = _seg.size = ::narrow(prog.p_memsz); const u32 type = _seg.type = prog.p_type; - const u32 flag = _seg.flags = prog.p_flags; + + _seg.flags = prog.p_flags; _seg.filesz = ::narrow(prog.p_filesz); // Hash big-endian values @@ -1210,8 +1211,9 @@ void ppu_load_exec(const ppu_exec_object& elf) ppu_segment _sec; const u32 addr = _sec.addr = vm::cast(s.sh_addr); const u32 size = _sec.size = vm::cast(s.sh_size); - const u32 type = _sec.type = s.sh_type; - const u32 flag = _sec.flags = static_cast(s.sh_flags & 7); + + _sec.type = s.sh_type; + _sec.flags = static_cast(s.sh_flags & 7); _sec.filesz = 0; if (addr && size) @@ -1666,7 +1668,8 @@ std::shared_ptr ppu_load_overlay(const ppu_exec_object& elf, const const u32 addr = _seg.addr = vm::cast(prog.p_vaddr); const u32 size = _seg.size = ::narrow(prog.p_memsz); const u32 type = _seg.type = prog.p_type; - const u32 flag = _seg.flags = prog.p_flags; + + _seg.flags = prog.p_flags; _seg.filesz = ::narrow(prog.p_filesz); // Hash big-endian values @@ -1708,8 +1711,9 @@ std::shared_ptr ppu_load_overlay(const ppu_exec_object& elf, const ppu_segment _sec; const u32 addr = _sec.addr = vm::cast(s.sh_addr); const u32 size = _sec.size = vm::cast(s.sh_size); - const u32 type = _sec.type = s.sh_type; - const u32 flag = _sec.flags = static_cast(s.sh_flags & 7); + + _sec.type = s.sh_type; + _sec.flags = static_cast(s.sh_flags & 7); _sec.filesz = 0; if (addr && size) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 301f6c14f0..2fa20736a5 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1817,7 +1817,7 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value) addr &= -128; // Cache line data - auto& cline_data = vm::_ref(addr); + //auto& cline_data = vm::_ref(addr); data += 0; rsx::reservation_lock rsx_lock(addr, 128); @@ -2015,7 +2015,7 @@ extern void ppu_initialize(const ppu_module& info) for (u64 index = 0; index < 1024; index++) { - if (auto sc = ppu_get_syscall(index)) + if (ppu_get_syscall(index)) { link_table.emplace(fmt::format("%s", ppu_syscall_code(index)), reinterpret_cast(ppu_execute_syscall)); link_table.emplace(fmt::format("syscall_%u", index), reinterpret_cast(ppu_execute_syscall)); diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 49d526ba28..0ae31ffc86 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -380,7 +380,7 @@ Value* PPUTranslator::RegLoad(Value*& local) void PPUTranslator::RegStore(llvm::Value* value, llvm::Value*& local) { - const auto glb = RegInit(local); + RegInit(local); local = value; } @@ -4712,7 +4712,7 @@ void PPUTranslator::SetFPCC(Value* lt, Value* gt, Value* eq, Value* un, bool set void PPUTranslator::SetFPRF(Value* value, bool set_cr) { - const bool is32 = + //const bool is32 = value->getType()->isFloatTy() ? true : value->getType()->isDoubleTy() ? false : ensure(false); diff --git a/rpcs3/Emu/Cell/SPUDisAsm.cpp b/rpcs3/Emu/Cell/SPUDisAsm.cpp index 3fefdc911c..63ae5864e4 100644 --- a/rpcs3/Emu/Cell/SPUDisAsm.cpp +++ b/rpcs3/Emu/Cell/SPUDisAsm.cpp @@ -56,7 +56,7 @@ std::pair SPUDisAsm::try_get_const_value(u32 reg, u32 pc) const continue; } - const auto flag = s_spu_iflag.decode(opcode); + //const auto flag = s_spu_iflag.decode(opcode); // TODO: It detects spurious register modifications if (u32 dst = type & spu_itype::_quadrop ? +op0.rt4 : +op0.rt; dst == reg) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index d3138e9b4a..8b9daecfd5 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -8941,7 +8941,7 @@ struct spu_llvm if (!(spu.state.load() & (cpu_flag::wait + cpu_flag::stop + cpu_flag::dbg_global_pause))) { - const auto found = std::as_const(samples).find(spu.block_hash); + const auto found = std::as_const(samples).find(name); if (found != std::as_const(samples).end()) { diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index 34fe9613cf..f8d6510d8d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -205,7 +205,7 @@ struct lv2_file::file_view : fs::file_base u64 read(void* buffer, u64 size) override { const u64 old_pos = m_file->file.pos(); - const u64 new_pos = m_file->file.seek(m_off + m_pos); + m_file->file.seek(m_off + m_pos); const u64 result = m_file->file.read(buffer, size); ensure(old_pos == m_file->file.seek(old_pos)); @@ -1300,7 +1300,7 @@ error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr _arg, u32 } const u64 old_pos = file->file.pos(); - const u64 new_pos = file->file.seek(arg->offset); + file->file.seek(arg->offset); arg->out_size = op == 0x8000000a ? file->op_read(arg->buf, arg->size) diff --git a/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp index d460a55c57..766a5fe60e 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp @@ -1055,7 +1055,7 @@ struct network_thread { bs_t events{}; - lv2_socket& sock = *socklist[i]; + [[maybe_unused]] lv2_socket& sock = *socklist[i]; if (fds[i].revents & (POLLIN | POLLHUP) && socklist[i]->events.test_and_reset(lv2_socket::poll::read)) events += lv2_socket::poll::read; diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index b56b421059..42a4273c63 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -599,7 +599,7 @@ error_code sys_rsx_context_attribute(u32 context_id, u32 package_id, u64 a3, u64 const u32 pitch = (((a5 >> 32) & 0xFFFFFFFF) >> 8) * 0x100; const u32 comp = ((a5 & 0xFFFFFFFF) >> 26) & 0xF; const u32 base = (a5 & 0xFFFFFFFF) & 0x7FF; - const u32 bank = (((a4 >> 32) & 0xFFFFFFFF) >> 4) & 0xF; + //const u32 bank = (((a4 >> 32) & 0xFFFFFFFF) >> 4) & 0xF; const bool bound = ((a4 >> 32) & 0x3) != 0; const auto range = utils::address_range::start_length(offset, size); diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 88f61efaa1..62adb567cb 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -80,7 +80,7 @@ void sys_spu_image::load(const fs::file& stream) const u32 mem_size = nsegs * sizeof(sys_spu_segment) + ::size32(stream); const vm::ptr segs = vm::cast(vm::alloc(mem_size, vm::main)); - const u32 entry = obj.header.e_entry; + //const u32 entry = obj.header.e_entry; const u32 src = (segs + nsegs).addr(); diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 31926844d5..6e0fae69db 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -1112,10 +1112,8 @@ namespace vm { auto fill64 = [](u8* ptr, u64 data, usz count) { - u64* target = reinterpret_cast(ptr); - #ifdef _MSC_VER - __stosq(target, data, count); + __stosq(reinterpret_cast(ptr), data, count); #else __asm__ ("mov %0, %%rdi; mov %1, %%rax; mov %2, %%rcx; rep stosq;" : diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 40b55e6c19..91bfa9655b 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -415,7 +415,7 @@ namespace vm }; // Null pointer convertible to any vm::ptr* type - static null_t null; + constexpr null_t null{}; } template diff --git a/rpcs3/Emu/RSX/Capture/rsx_capture.cpp b/rpcs3/Emu/RSX/Capture/rsx_capture.cpp index a20a2aec03..0eeea99db9 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_capture.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_capture.cpp @@ -268,7 +268,7 @@ namespace rsx // i realize these are a slight copy pasta of the rsx_method implementations but its kinda unavoidable currently void capture_image_in(thread* rsx, frame_capture_data::replay_command& replay_command) { - const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation(); + //const rsx::blit_engine::transfer_operation operation = method_registers.blit_engine_operation(); const u16 clip_w = std::min(method_registers.blit_engine_output_width(), method_registers.blit_engine_clip_width()); const u16 clip_h = std::min(method_registers.blit_engine_output_height(), method_registers.blit_engine_clip_height()); @@ -276,8 +276,8 @@ namespace rsx const u16 in_w = method_registers.blit_engine_input_width(); const u16 in_h = method_registers.blit_engine_input_height(); - const blit_engine::transfer_origin in_origin = method_registers.blit_engine_input_origin(); - const blit_engine::transfer_interpolator in_inter = method_registers.blit_engine_input_inter(); + //const blit_engine::transfer_origin in_origin = method_registers.blit_engine_input_origin(); + //const blit_engine::transfer_interpolator in_inter = method_registers.blit_engine_input_inter(); const rsx::blit_engine::transfer_source_format src_color_format = method_registers.blit_engine_src_color_format(); const f32 in_x = std::floor(method_registers.blit_engine_in_x()); @@ -319,7 +319,7 @@ namespace rsx s32 in_pitch = method_registers.nv0039_input_pitch(); const u32 line_length = method_registers.nv0039_line_length(); const u32 line_count = method_registers.nv0039_line_count(); - const u8 in_format = method_registers.nv0039_input_format(); + //const u8 in_format = method_registers.nv0039_input_format(); u32 src_offset = method_registers.nv0039_input_offset(); u32 src_dma = method_registers.nv0039_input_location(); diff --git a/rpcs3/Emu/RSX/Common/BufferUtils.cpp b/rpcs3/Emu/RSX/Common/BufferUtils.cpp index c31f8bc8e5..a6cbf0b922 100644 --- a/rpcs3/Emu/RSX/Common/BufferUtils.cpp +++ b/rpcs3/Emu/RSX/Common/BufferUtils.cpp @@ -349,7 +349,7 @@ namespace const u8 attribute_sz = min_block_size >> 2; for (u32 n = 0; n < remainder; ++n) { - auto src_ptr2 = reinterpret_cast*>(src_ptr); + //auto src_ptr2 = reinterpret_cast*>(src_ptr); auto dst_ptr2 = reinterpret_cast(dst_ptr); for (u32 v = 0; v < attribute_sz; ++v) @@ -415,8 +415,8 @@ namespace const u8 attribute_sz = min_block_size >> 1; for (u32 n = 0; n < remainder; ++n) { - auto src_ptr2 = reinterpret_cast*>(src_ptr); - auto dst_ptr2 = reinterpret_cast(dst_ptr); + //auto src_ptr2 = reinterpret_cast*>(src_ptr); + //auto dst_ptr2 = reinterpret_cast(dst_ptr); for (u32 v = 0; v < attribute_sz; ++v) dst_ptr[v] = src_ptr[v]; @@ -1048,7 +1048,6 @@ namespace ensure((dst.size() >= 3 * (src.size() - 2))); u32 dst_idx = 0; - u32 src_idx = 0; bool needs_anchor = true; T anchor = invalid_index; diff --git a/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp b/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp index e8bcb1ddae..d53ed3c193 100644 --- a/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp +++ b/rpcs3/Emu/RSX/Common/ProgramStateCache.cpp @@ -13,7 +13,7 @@ usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram & usz hash = 0xCBF29CE484222325ULL; const void* instbuffer = program.data.data(); usz instIndex = 0; - bool end = false; + for (unsigned i = 0; i < program.data.size() / 4; i++) { if (program.instruction_mask[i]) @@ -33,8 +33,8 @@ usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram & vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vertex_program(const u32* data, u32 entry, RSXVertexProgram& dst_prog) { vertex_program_utils::vertex_program_metadata result{}; - u32 last_instruction_address = 0; - u32 first_instruction_address = entry; + //u32 last_instruction_address = 0; + //u32 first_instruction_address = entry; std::stack call_stack; std::pair instruction_range = { UINT32_MAX, 0 }; diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index cf09949752..cee78b7490 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -2656,7 +2656,7 @@ namespace rsx typeless_info.src_context = texture_upload_context::framebuffer_storage; } - const auto src_is_depth_format = helpers::is_gcm_depth_format(typeless_info.src_gcm_format); + //const auto src_is_depth_format = helpers::is_gcm_depth_format(typeless_info.src_gcm_format); const auto preferred_dst_format = helpers::get_sized_blit_format(dst_is_argb8, false, is_format_convert); if (cached_dest && !use_null_region) diff --git a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h index 87b95cb141..7358b5c129 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h @@ -408,8 +408,8 @@ namespace rsx }; u32 current_address = attr.address; - u16 current_src_offset = 0; - u16 current_dst_offset = 0; + //u16 current_src_offset = 0; + //u16 current_dst_offset = 0; u32 slice_size = (attr.pitch * attr.slice_h); out.reserve(count); diff --git a/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp b/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp index 9ea28763af..b692b78c6e 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp @@ -6,7 +6,7 @@ namespace { - static constexpr std::array s_reg_table = + [[maybe_unused]] constexpr std::array s_reg_table = { "in_pos_buffer", "in_weight_buffer", "in_normal_buffer", "in_diff_color_buffer", "in_spec_color_buffer", diff --git a/rpcs3/Emu/RSX/RSXFragmentProgram.h b/rpcs3/Emu/RSX/RSXFragmentProgram.h index 21efe8a6ce..3b3b08ca6e 100644 --- a/rpcs3/Emu/RSX/RSXFragmentProgram.h +++ b/rpcs3/Emu/RSX/RSXFragmentProgram.h @@ -205,7 +205,7 @@ union SRC2 }; }; -static const char* rsx_fp_input_attr_regs[] = +constexpr const char* rsx_fp_input_attr_regs[] = { "WPOS", "COL0", "COL1", "FOGC", "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 55e25af6dd..ded5d474b1 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -889,8 +889,8 @@ namespace rsx // Force aligned indices as realhw const u32 address = (0 - type_size) & get_address(rsx::method_registers.index_array_address(), rsx::method_registers.index_array_location()); - const bool is_primitive_restart_enabled = rsx::method_registers.restart_index_enabled(); - const u32 primitive_restart_index = rsx::method_registers.restart_index(); + //const bool is_primitive_restart_enabled = rsx::method_registers.restart_index_enabled(); + //const u32 primitive_restart_index = rsx::method_registers.restart_index(); const u32 first = draw_indexed_clause.min_index(); const u32 count = draw_indexed_clause.get_elements_count(); @@ -1011,8 +1011,8 @@ namespace rsx return; } - const u16 clip_x = rsx::method_registers.surface_clip_origin_x(); - const u16 clip_y = rsx::method_registers.surface_clip_origin_y(); + //const u16 clip_x = rsx::method_registers.surface_clip_origin_x(); + //const u16 clip_y = rsx::method_registers.surface_clip_origin_y(); layout.color_addresses = get_color_surface_addresses(); layout.zeta_address = get_zeta_surface_address(); @@ -1857,7 +1857,7 @@ namespace rsx texture_control |= (1 << texture_control_bits::ALPHAKILL); } - const u32 texaddr = rsx::get_address(tex.offset(), tex.location()); + //const u32 texaddr = rsx::get_address(tex.offset(), tex.location()); const u32 raw_format = tex.format(); const u32 format = raw_format & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN); diff --git a/rpcs3/Emu/RSX/VK/VKDMA.cpp b/rpcs3/Emu/RSX/VK/VKDMA.cpp index b80b70161f..e1d96f1637 100644 --- a/rpcs3/Emu/RSX/VK/VKDMA.cpp +++ b/rpcs3/Emu/RSX/VK/VKDMA.cpp @@ -12,7 +12,7 @@ namespace vk { static constexpr usz s_dma_block_length = 0x01000000; static constexpr u32 s_dma_block_mask = 0xFF000000; - static constexpr u32 s_dma_offset_mask = 0x00FFFFFF; + //static constexpr u32 s_dma_offset_mask = 0x00FFFFFF; static constexpr u32 s_page_size = 16384; static constexpr u32 s_page_align = s_page_size - 1; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 846e24b6e5..d05f720fd9 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1059,7 +1059,7 @@ void VKGSRender::clear_surface(u32 mask) if (!framebuffer_status_valid) return; - float depth_clear = 1.f; + //float depth_clear = 1.f; u32 stencil_clear = 0; u32 depth_stencil_mask = 0; @@ -2333,7 +2333,7 @@ void VKGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info* for (const auto occlusion_id : data.indices) { // We only need one hit - if (auto value = m_occlusion_query_manager->get_query_result(occlusion_id)) + if (m_occlusion_query_manager->get_query_result(occlusion_id)) { query->result = 1; break; diff --git a/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp b/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp index 9be348e403..29134021ad 100644 --- a/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp +++ b/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp @@ -42,6 +42,7 @@ private: #pragma GCC diagnostic ignored "-Wall" #pragma GCC diagnostic ignored "-Wextra" #pragma GCC diagnostic ignored "-Wold-style-cast" +#pragma GCC diagnostic ignored "-Wunused-variable" #endif #include "3rdparty/GPUOpen/include/vk_mem_alloc.h" #ifdef _MSC_VER diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index ebf6a3eeae..40af0485ea 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -495,7 +495,7 @@ namespace vk std::unique_ptr find_temporary_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps) { - const auto current_frame = vk::get_current_frame_id(); + //const auto current_frame = vk::get_current_frame_id(); for (auto &e : m_temporary_storage) { if (e.can_reuse && e.matches(format, w, h, d, mipmaps, 0)) @@ -511,7 +511,7 @@ namespace vk std::unique_ptr find_temporary_cubemap(VkFormat format, u16 size) { - const auto current_frame = vk::get_current_frame_id(); + //const auto current_frame = vk::get_current_frame_id(); for (auto &e : m_temporary_storage) { if (e.can_reuse && e.matches(format, size, size, 1, 1, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) diff --git a/rpcs3/Emu/RSX/rsx_cache.h b/rpcs3/Emu/RSX/rsx_cache.h index 587f0819a1..81528772cc 100644 --- a/rpcs3/Emu/RSX/rsx_cache.h +++ b/rpcs3/Emu/RSX/rsx_cache.h @@ -842,7 +842,7 @@ namespace rsx storage_type* find_vertex_range(uptr local_addr, upload_format fmt, u32 data_length) override { - const auto data_end = local_addr + data_length; + //const auto data_end = local_addr + data_length; for (auto &v : vertex_ranges[local_addr]) { diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index 8a5b6ef528..b42d6ecf05 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -93,19 +93,19 @@ namespace rsx namespace constants { - static std::array fragment_texture_names = + constexpr std::array fragment_texture_names = { "tex0", "tex1", "tex2", "tex3", "tex4", "tex5", "tex6", "tex7", "tex8", "tex9", "tex10", "tex11", "tex12", "tex13", "tex14", "tex15", }; - static std::array vertex_texture_names = + constexpr std::array vertex_texture_names = { "vtex0", "vtex1", "vtex2", "vtex3", }; // Local RSX memory base (known as constant) - static constexpr u32 local_mem_base = 0xC0000000; + constexpr u32 local_mem_base = 0xC0000000; } /** diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 9717a32d6d..d36151eadc 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1640,7 +1640,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool sys_log.notice("Elf path: %s", argv[0]); } - const auto _main = g_fxo->init(); + g_fxo->init(); ppu_load_exec(ppu_exec); diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index 507ad75912..4cc162d9cf 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -469,7 +469,7 @@ std::string vfs::escape(std::string_view name, bool escape_slash) case char2{u8"!"[0]}: { // Escape full-width characters 0xFF01..0xFF5e with ! (0xFF01) - switch (char2 c2 = get_char(i + 1)) + switch (get_char(i + 1)) { case char2{u8"!"[1]}: { @@ -533,7 +533,7 @@ std::string vfs::unescape(std::string_view name) { case char2{u8"!"[0]}: { - switch (char2 c2 = get_char(i + 1)) + switch (get_char(i + 1)) { case char2{u8"!"[1]}: { diff --git a/rpcs3/Input/ds4_pad_handler.cpp b/rpcs3/Input/ds4_pad_handler.cpp index 3bfc0129d3..3050c05b29 100644 --- a/rpcs3/Input/ds4_pad_handler.cpp +++ b/rpcs3/Input/ds4_pad_handler.cpp @@ -6,8 +6,8 @@ LOG_CHANNEL(ds4_log, "DS4"); namespace { - const auto THREAD_SLEEP = 1ms; //ds4 has new data every ~4ms, - const auto THREAD_SLEEP_INACTIVE = 100ms; + //const auto THREAD_SLEEP = 1ms; //ds4 has new data every ~4ms, + //const auto THREAD_SLEEP_INACTIVE = 100ms; const u32 DS4_ACC_RES_PER_G = 8192; const u32 DS4_GYRO_RES_PER_DEG_S = 16; // technically this could be 1024, but keeping it at 16 keeps us within 16 bits of precision diff --git a/rpcs3/Input/dualsense_pad_handler.cpp b/rpcs3/Input/dualsense_pad_handler.cpp index 23879e04d2..aad6702a08 100644 --- a/rpcs3/Input/dualsense_pad_handler.cpp +++ b/rpcs3/Input/dualsense_pad_handler.cpp @@ -6,11 +6,11 @@ LOG_CHANNEL(dualsense_log, "DualSense"); namespace { - const auto THREAD_SLEEP = 1ms; - const auto THREAD_SLEEP_INACTIVE = 100ms; + //const auto THREAD_SLEEP = 1ms; + //const auto THREAD_SLEEP_INACTIVE = 100ms; - const u32 DUALSENSE_ACC_RES_PER_G = 8192; - const u32 DUALSENSE_GYRO_RES_PER_DEG_S = 1024; + //const u32 DUALSENSE_ACC_RES_PER_G = 8192; + //const u32 DUALSENSE_GYRO_RES_PER_DEG_S = 1024; const u32 DUALSENSE_BLUETOOTH_REPORT_SIZE = 78; const u32 DUALSENSE_USB_REPORT_SIZE = 48; diff --git a/rpcs3/cmake_modules/ConfigureCompiler.cmake b/rpcs3/cmake_modules/ConfigureCompiler.cmake index bee92c2c65..dc658b0a5f 100644 --- a/rpcs3/cmake_modules/ConfigureCompiler.cmake +++ b/rpcs3/cmake_modules/ConfigureCompiler.cmake @@ -33,7 +33,6 @@ else() add_compile_options(-Werror=return-type) #TODO Clean the code so these are removed - add_compile_options(-Wno-unused-variable) add_compile_options(-Wno-unused-function) add_compile_options(-Wno-attributes) diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index 7693a2b7a8..6ac8d057d4 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -238,7 +238,7 @@ QCoreApplication* createApplication(int& argc, char* argv[]) if (i_rounding_2) { const auto arg_val = argv[i_rounding_2]; - const auto arg_len = std::strlen(arg_val); + //const auto arg_len = std::strlen(arg_val); s64 rounding_val_cli = 0; if (!cfg::try_to_int64(&rounding_val_cli, arg_val, static_cast(Qt::HighDpiScaleFactorRoundingPolicy::Unset), static_cast(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough))) diff --git a/rpcs3/rpcs3qt/custom_table_widget_item.cpp b/rpcs3/rpcs3qt/custom_table_widget_item.cpp index e6dbb27418..5834514600 100644 --- a/rpcs3/rpcs3qt/custom_table_widget_item.cpp +++ b/rpcs3/rpcs3qt/custom_table_widget_item.cpp @@ -33,7 +33,7 @@ bool custom_table_widget_item::operator<(const QTableWidgetItem& other) const const QVariant::Type type_l = data_l.type(); const QVariant::Type type_r = data_r.type(); - assert(type_l == type_r); + ensure(type_l == type_r); switch (type_l) { diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index 98c380388b..7de13297c3 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -405,7 +405,7 @@ void debugger_frame::UpdateUnitList() return; } - const int old_size = m_choice_units->count(); + //const int old_size = m_choice_units->count(); QVariant old_cpu = m_choice_units->currentData(); const auto on_select = [&](u32 id, cpu_thread& cpu) @@ -542,7 +542,7 @@ void debugger_frame::ShowGotoAddressDialog() { expression_input->setValidator(new QRegExpValidator(QRegExp("^(0[xX])?0*[a-fA-F0-9]{0,5}$"))); } - + // Ok/Cancel QPushButton* button_ok = new QPushButton(tr("OK")); QPushButton* button_cancel = new QPushButton(tr("Cancel")); diff --git a/rpcs3/rpcs3qt/kernel_explorer.cpp b/rpcs3/rpcs3qt/kernel_explorer.cpp index 263d87e4c5..0d8d17c457 100644 --- a/rpcs3/rpcs3qt/kernel_explorer.cpp +++ b/rpcs3/rpcs3qt/kernel_explorer.cpp @@ -197,7 +197,7 @@ void kernel_explorer::Update() return; } - static const usz additional_size = 6; + //static const usz additional_size = 6; const std::unordered_map tree_item_names = { diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index bdbf58a865..3f5686035a 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1030,9 +1030,9 @@ void main_window::SaveWindowState() void main_window::RepaintThumbnailIcons() { - const QColor new_color = gui::utils::get_label_color("thumbnail_icon_color"); + [[maybe_unused]] const QColor new_color = gui::utils::get_label_color("thumbnail_icon_color"); - const auto icon = [&new_color](const QString& path) + [[maybe_unused]] const auto icon = [&new_color](const QString& path) { return gui::utils::get_colorized_icon(QPixmap::fromImage(gui::utils::get_opaque_image_area(path)), Qt::black, new_color); }; diff --git a/rpcs3/rpcs3qt/trophy_notification_frame.cpp b/rpcs3/rpcs3qt/trophy_notification_frame.cpp index 6d089d7e9b..87d302981e 100644 --- a/rpcs3/rpcs3qt/trophy_notification_frame.cpp +++ b/rpcs3/rpcs3qt/trophy_notification_frame.cpp @@ -6,7 +6,7 @@ static const int TROPHY_TIMEOUT_MS = 7500; -constexpr auto qstr = QString::fromStdString; +//constexpr auto qstr = QString::fromStdString; trophy_notification_frame::trophy_notification_frame(const std::vector& imgBuffer, const SceNpTrophyDetails& trophy, int height) : QWidget() { diff --git a/rpcs3/util/atomic.cpp b/rpcs3/util/atomic.cpp index 32107e4d2f..c01f505aa2 100644 --- a/rpcs3/util/atomic.cpp +++ b/rpcs3/util/atomic.cpp @@ -943,8 +943,6 @@ void root_info::slot_free(uptr iptr, atomic_t* slot, u32 tls_slot) noexcept { const auto begin = reinterpret_cast(std::begin(s_hashtable)); - const auto end = reinterpret_cast(std::end(s_hashtable)); - const auto ptr = reinterpret_cast(slot) - begin; if (ptr >= sizeof(s_hashtable)) diff --git a/rpcs3/util/vm_native.cpp b/rpcs3/util/vm_native.cpp index a762afd2cf..9e273a662a 100644 --- a/rpcs3/util/vm_native.cpp +++ b/rpcs3/util/vm_native.cpp @@ -90,7 +90,7 @@ namespace utils return nullptr; } - const auto orig_size = size; + [[maybe_unused]] const auto orig_size = size; if (!use_addr) {