From 0078faef8b0e1da5a731cb0c5bbbd89efb98eb4a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 29 Jun 2014 19:02:41 -0700 Subject: [PATCH] Fix some log semicolons that might affect logic. But, these should all be right. --- Core/HLE/sceKernelMsgPipe.cpp | 23 +++++++++------------ Core/HLE/sceKernelThread.cpp | 36 ++++++++++++++++----------------- Core/MIPS/ARM/ArmCompBranch.cpp | 16 +++++++-------- Core/MIPS/x86/CompBranch.cpp | 16 +++++++-------- 4 files changed, 40 insertions(+), 51 deletions(-) diff --git a/Core/HLE/sceKernelMsgPipe.cpp b/Core/HLE/sceKernelMsgPipe.cpp index 7799569969..f3b3a5a0b7 100644 --- a/Core/HLE/sceKernelMsgPipe.cpp +++ b/Core/HLE/sceKernelMsgPipe.cpp @@ -603,30 +603,26 @@ bool __KernelCheckResumeMsgPipeReceive(MsgPipe *m, MsgPipeWaitingThread &waitInf return true; } -void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) -{ +void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) { u32 error; u32 waitValue = __KernelGetWaitValue(threadID, error); u32 timeoutPtr = __KernelGetWaitTimeoutPtr(threadID, error); SceUID uid = __KernelGetWaitID(threadID, WAITTYPE_MSGPIPE, error); MsgPipe *ko = uid == 0 ? NULL : kernelObjects.Get(uid, error); - if (ko == NULL) - { + if (ko == NULL) { ERROR_LOG_REPORT(SCEKERNEL, "__KernelMsgPipeEndCallback: Invalid object"); return; } - switch (waitValue) - { + switch (waitValue) { case MSGPIPE_WAIT_VALUE_SEND: { MsgPipeWaitingThread dummy; auto result = HLEKernel::WaitEndCallback(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeSend, dummy, ko->sendWaitingThreads, ko->pausedSendWaits); - if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) - DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback") - else if (result == HLEKernel::WAIT_CB_TIMED_OUT) - { + if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) { + DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback"); + } else if (result == HLEKernel::WAIT_CB_TIMED_OUT) { // It was re-added to the the waiting threads list, but it timed out. Let's remove it. ko->RemoveSendWaitingThread(threadID); } @@ -637,10 +633,9 @@ void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) { MsgPipeWaitingThread dummy; auto result = HLEKernel::WaitEndCallback(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeReceive, dummy, ko->receiveWaitingThreads, ko->pausedReceiveWaits); - if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) - DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback") - else if (result == HLEKernel::WAIT_CB_TIMED_OUT) - { + if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) { + DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback"); + } else if (result == HLEKernel::WAIT_CB_TIMED_OUT) { // It was re-added to the the waiting threads list, but it timed out. Let's remove it. ko->RemoveReceiveWaitingThread(threadID); } diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index d916f4ed84..384f3e157d 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2507,32 +2507,30 @@ int sceKernelChangeCurrentThreadAttr(u32 clearAttr, u32 setAttr) return 0; } -int sceKernelChangeThreadPriority(SceUID threadID, int priority) -{ - if (threadID == 0) +int sceKernelChangeThreadPriority(SceUID threadID, int priority) { + if (threadID == 0) { threadID = currentThread; + } + // 0 means the current (running) thread's priority, not target's. - if (priority == 0) - { + if (priority == 0) { Thread *cur = __GetCurrentThread(); - if (!cur) - ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority) - else + if (!cur) { + ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority); + } else { priority = cur->nt.currentPriority; + } } u32 error; Thread *thread = kernelObjects.Get(threadID, error); - if (thread) - { - if (thread->isStopped()) - { + if (thread) { + if (thread->isStopped()) { ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): thread is dormant", threadID, priority); return SCE_KERNEL_ERROR_DORMANT; } - if (priority < 0x08 || priority > 0x77) - { + if (priority < 0x08 || priority > 0x77) { ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): bogus priority", threadID, priority); return SCE_KERNEL_ERROR_ILLEGAL_PRIORITY; } @@ -2544,17 +2542,17 @@ int sceKernelChangeThreadPriority(SceUID threadID, int priority) thread->nt.currentPriority = priority; threadReadyQueue.prepare(thread->nt.currentPriority); - if (thread->isRunning()) + if (thread->isRunning()) { thread->nt.status = (thread->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY; - if (thread->isReady()) + } + if (thread->isReady()) { threadReadyQueue.push_back(thread->nt.currentPriority, threadID); + } hleEatCycles(450); hleReSchedule("change thread priority"); return 0; - } - else - { + } else { ERROR_LOG(SCEKERNEL, "%08x=sceKernelChangeThreadPriority(%i, %i) failed - no such thread", error, threadID, priority); return error; } diff --git a/Core/MIPS/ARM/ArmCompBranch.cpp b/Core/MIPS/ARM/ArmCompBranch.cpp index f186574e4e..77270651a6 100644 --- a/Core/MIPS/ARM/ArmCompBranch.cpp +++ b/Core/MIPS/ARM/ArmCompBranch.cpp @@ -398,8 +398,7 @@ void Jit::Comp_VBranch(MIPSOpcode op) } } -void Jit::Comp_Jump(MIPSOpcode op) -{ +void Jit::Comp_Jump(MIPSOpcode op) { if (js.inDelaySlot) { ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart); return; @@ -408,18 +407,17 @@ void Jit::Comp_Jump(MIPSOpcode op) u32 targetAddr = (js.compilerPC & 0xF0000000) | off; // Might be a stubbed address or something? - if (!Memory::IsValidAddress(targetAddr)) - { - if (js.nextExit == 0) - ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr) - else + if (!Memory::IsValidAddress(targetAddr)) { + if (js.nextExit == 0) { + ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr); + } else { js.compiling = false; + } // TODO: Mark this block dirty or something? May be indication it will be changed by imports. return; } - switch (op >> 26) - { + switch (op >> 26) { case 2: //j CompileDelaySlot(DELAYSLOT_NICE); if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions) { diff --git a/Core/MIPS/x86/CompBranch.cpp b/Core/MIPS/x86/CompBranch.cpp index 165943a016..3849c58ffe 100644 --- a/Core/MIPS/x86/CompBranch.cpp +++ b/Core/MIPS/x86/CompBranch.cpp @@ -516,8 +516,7 @@ void Jit::Comp_VBranch(MIPSOpcode op) } } -void Jit::Comp_Jump(MIPSOpcode op) -{ +void Jit::Comp_Jump(MIPSOpcode op) { CONDITIONAL_LOG; if (js.inDelaySlot) { ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart); @@ -527,18 +526,17 @@ void Jit::Comp_Jump(MIPSOpcode op) u32 targetAddr = (js.compilerPC & 0xF0000000) | off; // Might be a stubbed address or something? - if (!Memory::IsValidAddress(targetAddr)) - { - if (js.nextExit == 0) - ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr) - else + if (!Memory::IsValidAddress(targetAddr)) { + if (js.nextExit == 0) { + ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr); + } else { js.compiling = false; + } // TODO: Mark this block dirty or something? May be indication it will be changed by imports. return; } - switch (op >> 26) - { + switch (op >> 26) { case 2: //j CompileDelaySlot(DELAYSLOT_NICE); if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions)