Return negative for UnscheduleEvent().

It usually won't be, but it could be negative.

Also some other minor warnings.
This commit is contained in:
Unknown W. Brackets 2013-04-05 20:42:20 -07:00
parent 832edb0a8f
commit 0918ec8598
9 changed files with 14 additions and 14 deletions

View File

@ -271,9 +271,9 @@ void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata)
}
// Returns cycles left in timer.
u64 UnscheduleEvent(int event_type, u64 userdata)
s64 UnscheduleEvent(int event_type, u64 userdata)
{
u64 result = 0;
s64 result = 0;
if (!first)
return result;
while(first)

View File

@ -93,7 +93,7 @@ namespace CoreTiming
void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata=0);
void ScheduleEvent_Threadsafe(s64 cyclesIntoFuture, int event_type, u64 userdata=0);
void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata=0);
u64 UnscheduleEvent(int event_type, u64 userdata);
s64 UnscheduleEvent(int event_type, u64 userdata);
void RemoveEvent(int event_type);
void RemoveThreadsafeEvent(int event_type);

View File

@ -165,7 +165,7 @@ bool __KernelUnlockEventFlagForThread(EventFlag *e, EventFlagTh &th, u32 &error,
if (timeoutPtr != 0 && eventFlagWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(eventFlagWaitTimer, th.tid);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(eventFlagWaitTimer, th.tid);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -205,7 +205,7 @@ bool __KernelUnlockMbxForThread(Mbx *m, MbxWaitingThread &th, u32 &error, int re
if (timeoutPtr != 0 && mbxWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mbxWaitTimer, th.first);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mbxWaitTimer, th.first);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -804,7 +804,7 @@ bool __KernelUnlockVplForThread(VPL *vpl, VplWaitingThread &threadInfo, u32 &err
if (timeoutPtr != 0 && vplWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(vplWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(vplWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}

View File

@ -264,7 +264,7 @@ bool __KernelUnlockMutexForThread(Mutex *mutex, SceUID threadID, u32 &error, int
if (timeoutPtr != 0 && mutexWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}
@ -289,7 +289,7 @@ void __KernelMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && mutexWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
mutex->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else
@ -759,7 +759,7 @@ bool __KernelUnlockLwMutexForThread(LwMutex *mutex, T workarea, SceUID threadID,
if (timeoutPtr != 0 && lwMutexWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
}
@ -931,7 +931,7 @@ void __KernelLwMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && lwMutexWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
mutex->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else

View File

@ -121,7 +121,7 @@ bool __KernelUnlockSemaForThread(Semaphore *s, SceUID threadID, u32 &error, int
if (timeoutPtr != 0 && semaWaitTimer != -1)
{
// Remove any event for this thread.
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
if (cyclesLeft < 0)
cyclesLeft = 0;
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
@ -149,7 +149,7 @@ void __KernelSemaBeginCallback(SceUID threadID, SceUID prevCallbackId)
if (timeoutPtr != 0 && semaWaitTimer != -1)
{
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
s->pausedWaitTimeouts[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
}
else

View File

@ -116,7 +116,7 @@ int sceKernelSysClock2USec(u32 sysclockPtr, u32 highPtr, u32 lowPtr)
int sceKernelSysClock2USecWide(u32 lowClock, u32 highClock, u32 lowPtr, u32 highPtr)
{
u64 sysClock = lowClock | ((u64)highClock << 32);
DEBUG_LOG(HLE, "sceKernelSysClock2USecWide(clock = %llu, lo = %08x, hi = %08x)", clock, lowPtr, highPtr);
DEBUG_LOG(HLE, "sceKernelSysClock2USecWide(clock = %llu, lo = %08x, hi = %08x)", sysClock, lowPtr, highPtr);
if (Memory::IsValidAddress(lowPtr)) {
Memory::Write_U32((u32)(sysClock / 1000000), lowPtr);
if (Memory::IsValidAddress(highPtr))

View File

@ -92,7 +92,7 @@ void __KernelScheduleVTimer(VTimer *vt, u64 schedule) {
CoreTiming::ScheduleEvent(usToCycles(vt->nvt.schedule + 372), vtimerTimer, vt->GetUID());
}
void __rescheduleVTimer(SceUID id, u32 delay) {
void __rescheduleVTimer(SceUID id, int delay) {
u32 error;
VTimer *vt = kernelObjects.Get<VTimer>(id, error);