From 30acfb89c3dc78d3a17a76d629e3583ac3c65cf7 Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 19:12:08 +0800 Subject: [PATCH 01/11] CppCheck: Orz. fix out-bound reference of NONZEROCOEFFS in CellCameraAttributes. --- rpcs3/Emu/SysCalls/Modules/cellCamera.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.h b/rpcs3/Emu/SysCalls/Modules/cellCamera.h index f9242a4660..95c505bd6f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.h +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.h @@ -314,7 +314,8 @@ struct CellCameraAttributes u32 LED; u32 AUDIOGAIN; u32 QS; - u32 NONZEROCOEFFS[1]; +// Syphurith: Found using cppcheck. This is originally stated as an single-element array, however references its [0] and [1]. So i changed this to 2 u32 units. + u32 NONZEROCOEFFS[2]; u32 YUVFLAG; u32 JPEGFLAG; u32 BACKLIGHTCOMP; From f6392baab3fa31beba42ab7ea4c5f02c6f8d507c Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 19:14:33 +0800 Subject: [PATCH 02/11] CppCheck: Make it return value not without return, in cellSpurs.cpp. --- rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 720a9d1251..9f82dec553 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -2206,7 +2206,8 @@ s32 cellSpursCreateTasksetWithAttribute(vm::ptr spurs, vm::ptr taskset, vm::ptr task_id, vm: if (tmp_task_id >= CELL_SPURS_MAX_TASK) { - CELL_SPURS_TASK_ERROR_AGAIN; + // Syphurith: If that is intentionally done, please remove the 'return'. Or else just remove this comment. + return CELL_SPURS_TASK_ERROR_AGAIN; } taskset->m.task_info[tmp_task_id].elf_addr.set(elf_addr.addr()); From d072eba68729194dd88c724aee52ef527d56b269 Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 19:20:50 +0800 Subject: [PATCH 03/11] CppCheck: Marked out case_range that in RSXThread.cpp. It seems missing its own break;. --- rpcs3/Emu/RSX/RSXThread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index e302ec5de5..0d185c6c0a 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -200,6 +200,7 @@ u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count, cons #define case_32(offset, step) \ case_16(offset, step) \ case_16(offset + 16*step, step) +// TODO:: Syphurith: I'm not sure about whether this is correct or missing a break;. #define case_range(n, offset, step) \ case_##n(offset, step) \ index = (cmd - offset) / step @@ -368,6 +369,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const } // Texture + // TODO:: Syphurith: Ensure it don't need to break;? case 0: A=0; case 1: A=1; would always give you A=1. case_range(16, NV4097_SET_TEXTURE_FORMAT, 0x20); case_range(16, NV4097_SET_TEXTURE_OFFSET, 0x20); case_range(16, NV4097_SET_TEXTURE_FILTER, 0x20); @@ -397,7 +399,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const break; } - // Vertex Texture + // Vertex Texture + // TODO:: Syphurith: Ensure it don't need to break;? Similiar reason.. case_range(4, NV4097_SET_VERTEX_TEXTURE_FORMAT, 0x20); case_range(4, NV4097_SET_VERTEX_TEXTURE_OFFSET, 0x20); case_range(4, NV4097_SET_VERTEX_TEXTURE_FILTER, 0x20); From cd23a2ecaff7d5675dcb4399bff1e6f837e7b9a4 Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 19:29:45 +0800 Subject: [PATCH 04/11] CppCheck: About assert side-effect and remove_if that i don't know enough.. --- rpcs3/Emu/Cell/PPULLVMRecompiler.cpp | 4 +++- rpcs3/Emu/FS/vfsStreamMemory.cpp | 1 + rpcs3/Emu/SysCalls/Modules/cellDmux.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index a42007c0cf..38a7184167 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -5820,7 +5820,9 @@ void RecompilationEngine::ProcessExecutionTrace(const ExecutionTrace & execution } } } - + // TODO:: Syphurith: It is said that just remove_if would cause some troubles.. I don't know if that would cause Memleak. From CppCheck: + // The return value of std::remove_if() is ignored. This function returns an iterator to the end of the range containing those elements that should be kept. + // Elements past new end remain valid but with unspecified values. Use the erase method of the container to delete them. std::remove_if(processed_execution_trace_i->second.begin(), processed_execution_trace_i->second.end(), [](const BlockEntry * b)->bool { return b->is_compiled; }); } diff --git a/rpcs3/Emu/FS/vfsStreamMemory.cpp b/rpcs3/Emu/FS/vfsStreamMemory.cpp index 5ce30c3a7c..2f3283318f 100644 --- a/rpcs3/Emu/FS/vfsStreamMemory.cpp +++ b/rpcs3/Emu/FS/vfsStreamMemory.cpp @@ -38,6 +38,7 @@ u64 vfsStreamMemory::Write(const void* src, u64 size) u64 vfsStreamMemory::Read(void* dst, u64 size) { + // TODO:: Syphurith: Should us do anything? Since Asserts aren't included in Release builds. assert(Tell() < GetSize()); if (Tell() + size > GetSize()) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index b949c5534e..ace09d923d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -148,7 +148,7 @@ void ElementaryStream::push_au(u32 size, u64 dts, u64 pts, u64 userdata, bool ra u32 addr; { std::lock_guard lock(m_mutex); - + // TODO:: Syphurith: Should us convert this to a if statement? Since Asserts aren't included in Release builds. assert(!is_full(size)); if (put + size + 128 > memAddr + memSize) From 900389d857bc68b2d2c1784e15bb67367aebad17 Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 20:13:25 +0800 Subject: [PATCH 05/11] CppCheck: Tried to classify and marked some lines that weird. --- rpcs3/Crypto/lz.cpp | 1 + rpcs3/Crypto/sha1.cpp | 1 + rpcs3/Emu/ARMv7/Modules/sceLibc.cpp | 1 + rpcs3/Emu/Cell/SPUThread.h | 1 + rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 1 + rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 1 + rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 2 +- 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcs3/Crypto/lz.cpp b/rpcs3/Crypto/lz.cpp index 86d82d7161..f28431fc6e 100644 --- a/rpcs3/Crypto/lz.cpp +++ b/rpcs3/Crypto/lz.cpp @@ -140,6 +140,7 @@ int decompress(unsigned char *out, unsigned char *in, unsigned int size) unsigned int range = 0xFFFFFFFF; unsigned int code = (in[1] << 24) | (in[2] << 16) | (in[3] << 8) | in[4]; + // TODO:: Syphurith: There was a check against the unsigned char head. if (head < 0) would always be false.. I don't know are you tried to if (head > 0x80)? if (head < 0) // Check if we have a valid starting byte. { // The dictionary header is invalid, the data is not compressed. diff --git a/rpcs3/Crypto/sha1.cpp b/rpcs3/Crypto/sha1.cpp index 8e6177c0e7..650b1dfa88 100644 --- a/rpcs3/Crypto/sha1.cpp +++ b/rpcs3/Crypto/sha1.cpp @@ -233,6 +233,7 @@ void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen ) size_t fill; uint32_t left; + // TODO:: Syphurith: Orz. It is said that size_t is an unsigned type.. if( ilen <= 0 ) return; diff --git a/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp b/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp index 98fab490a0..85dba9cb20 100644 --- a/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp +++ b/rpcs3/Emu/ARMv7/Modules/sceLibc.cpp @@ -28,6 +28,7 @@ std::string armv7_fmt(ARMv7Context& context, vm::psv::ptr fmt, u32 g const auto start = fmt - 1; // read flags + // TODO:: Syphurith: Sorry i can not classify/understand these lines exactly.. const bool plus_sign = *fmt == '+' ? fmt++, true : false; const bool minus_sign = *fmt == '-' ? fmt++, true : false; const bool space_sign = *fmt == ' ' ? fmt++, true : false; diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index bee08966ab..4267ac40e0 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -258,6 +258,7 @@ public: sync_var.atomic_op([&out_result, &out_value, &out_count, last_value](sync_var_t& data) { + // TODO:: Syphurith: I don't know what you tried to express, exactly. if ((out_result = data.count != 0)) { out_value = data.value0; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 7c3b60c706..5cad2c2a63 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -196,6 +196,7 @@ next: goto next; } + // TODO:: Syphurith: I don't know whether we should keep this else-if now. Since the if condition is same with this one. else if (adec.reader.size < (u32)buf_size) { buf_size = adec.reader.size; diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 7b289e13b0..c03177d2a9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -168,6 +168,7 @@ next: goto next; } + // TODO:: Syphurith: Orz. The if condition above is same with this one, so this would not be executed. else if (vdec.reader.size < (u32)buf_size) { buf_size = vdec.reader.size; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index f4eb597754..780426c603 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -508,7 +508,7 @@ s32 sys_spu_thread_group_terminate(u32 id, s32 value) } } - if (group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED || group->state == SPU_THREAD_GROUP_STATUS_WAITING || group->state == SPU_THREAD_GROUP_STATUS_WAITING) + if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) { return CELL_EINVAL; } From e4a2a60f559be40afcb82c412326e802806a5fcb Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 20:26:48 +0800 Subject: [PATCH 06/11] CppCheck: End of those marking. and removed one meaningless comparation in sys_spu.cpp. --- rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 2 +- rpcs3/Gui/InterpreterDisAsm.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index 780426c603..ee8f1ca6dd 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -508,7 +508,7 @@ s32 sys_spu_thread_group_terminate(u32 id, s32 value) } } - if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) + if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) { return CELL_EINVAL; } diff --git a/rpcs3/Gui/InterpreterDisAsm.cpp b/rpcs3/Gui/InterpreterDisAsm.cpp index 632b75608c..3706141606 100644 --- a/rpcs3/Gui/InterpreterDisAsm.cpp +++ b/rpcs3/Gui/InterpreterDisAsm.cpp @@ -514,10 +514,12 @@ void InterpreterDisAsmFrame::InstrKey(wxListEvent& event) switch(event.GetKeyCode()) { case 'E': + // TODO:: Syphurith: It is said the InstructionEditorDialog would be immediately destroyed. InstructionEditorDialog(this, pc, CPU, decoder, disasm); DoUpdate(); return; case 'R': + // TODO:: Syphurith: Eh Similiar for this one. RegisterEditorDialog(this, pc, CPU, decoder, disasm); DoUpdate(); return; From 147c50e7cabac8ee930845bb8be9967efbd24bf4 Mon Sep 17 00:00:00 2001 From: luxsie Date: Sat, 11 Apr 2015 00:27:20 +0800 Subject: [PATCH 07/11] Removed some useless comments, thank Neko. --- rpcs3/Emu/Cell/SPUThread.h | 3 +-- rpcs3/Emu/SysCalls/Modules/cellDmux.cpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 4267ac40e0..760c7cebe6 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -258,8 +258,7 @@ public: sync_var.atomic_op([&out_result, &out_value, &out_count, last_value](sync_var_t& data) { - // TODO:: Syphurith: I don't know what you tried to express, exactly. - if ((out_result = data.count != 0)) + if (out_result = (data.count != 0)) { out_value = data.value0; out_count = --data.count; diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index ace09d923d..393e2cc541 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -148,7 +148,6 @@ void ElementaryStream::push_au(u32 size, u64 dts, u64 pts, u64 userdata, bool ra u32 addr; { std::lock_guard lock(m_mutex); - // TODO:: Syphurith: Should us convert this to a if statement? Since Asserts aren't included in Release builds. assert(!is_full(size)); if (put + size + 128 > memAddr + memSize) From 94441d7df3b5ead9630e8c8b49fd4e1a04245184 Mon Sep 17 00:00:00 2001 From: luxsie Date: Sat, 11 Apr 2015 01:58:12 +0800 Subject: [PATCH 08/11] Restore what is directly truncated in sys_spu.cpp. @danilaml that may be someone used a wrong constant for the third condition. --- rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index ee8f1ca6dd..0f83676866 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -508,7 +508,8 @@ s32 sys_spu_thread_group_terminate(u32 id, s32 value) } } - if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) + // TODO:: Syphurith: Thank @danilaml (first) and let us talk about this mistake/typo. Have you used the wrong constant for the third condition? + if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) { return CELL_EINVAL; } From 02c263fc19661ac1f866518db48c30697a1293a5 Mon Sep 17 00:00:00 2001 From: luxsie Date: Sat, 11 Apr 2015 13:31:28 +0800 Subject: [PATCH 09/11] Remove comments in confirmed files. --- rpcs3/Emu/FS/vfsStreamMemory.cpp | 1 - rpcs3/Emu/RSX/RSXThread.cpp | 3 --- rpcs3/Emu/SysCalls/Modules/cellCamera.h | 1 - rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp | 2 -- rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 3 +-- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/rpcs3/Emu/FS/vfsStreamMemory.cpp b/rpcs3/Emu/FS/vfsStreamMemory.cpp index 2f3283318f..5ce30c3a7c 100644 --- a/rpcs3/Emu/FS/vfsStreamMemory.cpp +++ b/rpcs3/Emu/FS/vfsStreamMemory.cpp @@ -38,7 +38,6 @@ u64 vfsStreamMemory::Write(const void* src, u64 size) u64 vfsStreamMemory::Read(void* dst, u64 size) { - // TODO:: Syphurith: Should us do anything? Since Asserts aren't included in Release builds. assert(Tell() < GetSize()); if (Tell() + size > GetSize()) { diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 0d185c6c0a..6bc9344ca0 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -200,7 +200,6 @@ u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count, cons #define case_32(offset, step) \ case_16(offset, step) \ case_16(offset + 16*step, step) -// TODO:: Syphurith: I'm not sure about whether this is correct or missing a break;. #define case_range(n, offset, step) \ case_##n(offset, step) \ index = (cmd - offset) / step @@ -369,7 +368,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const } // Texture - // TODO:: Syphurith: Ensure it don't need to break;? case 0: A=0; case 1: A=1; would always give you A=1. case_range(16, NV4097_SET_TEXTURE_FORMAT, 0x20); case_range(16, NV4097_SET_TEXTURE_OFFSET, 0x20); case_range(16, NV4097_SET_TEXTURE_FILTER, 0x20); @@ -400,7 +398,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const } // Vertex Texture - // TODO:: Syphurith: Ensure it don't need to break;? Similiar reason.. case_range(4, NV4097_SET_VERTEX_TEXTURE_FORMAT, 0x20); case_range(4, NV4097_SET_VERTEX_TEXTURE_OFFSET, 0x20); case_range(4, NV4097_SET_VERTEX_TEXTURE_FILTER, 0x20); diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.h b/rpcs3/Emu/SysCalls/Modules/cellCamera.h index 95c505bd6f..12ae95270a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.h +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.h @@ -314,7 +314,6 @@ struct CellCameraAttributes u32 LED; u32 AUDIOGAIN; u32 QS; -// Syphurith: Found using cppcheck. This is originally stated as an single-element array, however references its [0] and [1]. So i changed this to 2 u32 units. u32 NONZEROCOEFFS[2]; u32 YUVFLAG; u32 JPEGFLAG; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 9f82dec553..f2474f841c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -2206,7 +2206,6 @@ s32 cellSpursCreateTasksetWithAttribute(vm::ptr spurs, vm::ptr taskset, vm::ptr task_id, vm: if (tmp_task_id >= CELL_SPURS_MAX_TASK) { - // Syphurith: If that is intentionally done, please remove the 'return'. Or else just remove this comment. return CELL_SPURS_TASK_ERROR_AGAIN; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index 0f83676866..ee8f1ca6dd 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -508,8 +508,7 @@ s32 sys_spu_thread_group_terminate(u32 id, s32 value) } } - // TODO:: Syphurith: Thank @danilaml (first) and let us talk about this mistake/typo. Have you used the wrong constant for the third condition? - if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) + if ((group->state <= SPU_THREAD_GROUP_STATUS_INITIALIZED) || (group->state == SPU_THREAD_GROUP_STATUS_WAITING)) { return CELL_EINVAL; } From 0233fbff518fea53dd8ce394ce68331f81546b44 Mon Sep 17 00:00:00 2001 From: luxsie Date: Mon, 13 Apr 2015 00:37:58 +0800 Subject: [PATCH 10/11] Thanks to @Nekotekina, about his patience on SPUThread.h. --- rpcs3/Emu/Cell/SPUThread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 760c7cebe6..95706fe60c 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -258,7 +258,7 @@ public: sync_var.atomic_op([&out_result, &out_value, &out_count, last_value](sync_var_t& data) { - if (out_result = (data.count != 0)) + if ((out_result = (data.count != 0))) { out_value = data.value0; out_count = --data.count; From 0f1bb8545dd474111939d97a564472505784c610 Mon Sep 17 00:00:00 2001 From: luxsie Date: Sat, 18 Apr 2015 03:12:25 +0800 Subject: [PATCH 11/11] Tab to Space. --- rpcs3/Crypto/sha1.cpp | 2 +- rpcs3/Emu/Cell/PPULLVMRecompiler.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Crypto/sha1.cpp b/rpcs3/Crypto/sha1.cpp index 650b1dfa88..7cede4b205 100644 --- a/rpcs3/Crypto/sha1.cpp +++ b/rpcs3/Crypto/sha1.cpp @@ -233,7 +233,7 @@ void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen ) size_t fill; uint32_t left; - // TODO:: Syphurith: Orz. It is said that size_t is an unsigned type.. + // TODO:: Syphurith: Orz. It is said that size_t is an unsigned type.. if( ilen <= 0 ) return; diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index 38a7184167..3dfa186687 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -5820,9 +5820,9 @@ void RecompilationEngine::ProcessExecutionTrace(const ExecutionTrace & execution } } } - // TODO:: Syphurith: It is said that just remove_if would cause some troubles.. I don't know if that would cause Memleak. From CppCheck: - // The return value of std::remove_if() is ignored. This function returns an iterator to the end of the range containing those elements that should be kept. - // Elements past new end remain valid but with unspecified values. Use the erase method of the container to delete them. + // TODO:: Syphurith: It is said that just remove_if would cause some troubles.. I don't know if that would cause Memleak. From CppCheck: + // The return value of std::remove_if() is ignored. This function returns an iterator to the end of the range containing those elements that should be kept. + // Elements past new end remain valid but with unspecified values. Use the erase method of the container to delete them. std::remove_if(processed_execution_trace_i->second.begin(), processed_execution_trace_i->second.end(), [](const BlockEntry * b)->bool { return b->is_compiled; }); }