mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-28 16:54:32 +00:00
Change sleep duration to unsigned
This commit is contained in:
1 parent
98210be217
commit
a879f89736
3 files changed
+8
-8
No files matched your search
+3
-3
@@ -401,7 +401,7 @@ static void inputSendThreadProc(void* context) {
|
||||
// Delay for batching if required
|
||||
if (now < lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS) {
|
||||
flushInputOnControlStream();
|
||||
PltSleepMs((int)(lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS - now));
|
||||
PltSleepMs((uint32_t)(lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS - now));
|
||||
now = PltGetMillis();
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ static void inputSendThreadProc(void* context) {
|
||||
// Delay for batching if required
|
||||
if (now < lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS) {
|
||||
flushInputOnControlStream();
|
||||
PltSleepMs((int)(lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS - now));
|
||||
PltSleepMs((uint32_t)(lastMousePacketTime + MOUSE_BATCHING_INTERVAL_MS - now));
|
||||
now = PltGetMillis();
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ static void inputSendThreadProc(void* context) {
|
||||
// Delay for batching if required
|
||||
if (now < lastPenPacketTime + PEN_BATCHING_INTERVAL_MS) {
|
||||
flushInputOnControlStream();
|
||||
PltSleepMs((int)(lastPenPacketTime + PEN_BATCHING_INTERVAL_MS - now));
|
||||
PltSleepMs((uint32_t)(lastPenPacketTime + PEN_BATCHING_INTERVAL_MS - now));
|
||||
now = PltGetMillis();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -104,7 +104,7 @@ void* ThreadProc(void* context) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void PltSleepMs(int ms) {
|
||||
void PltSleepMs(uint32_t ms) {
|
||||
#if defined(LC_WINDOWS)
|
||||
SleepEx(ms, FALSE);
|
||||
#elif defined(__3DS__)
|
||||
@@ -120,9 +120,9 @@ void PltSleepMs(int ms) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void PltSleepMsInterruptible(PLT_THREAD* thread, int ms) {
|
||||
void PltSleepMsInterruptible(PLT_THREAD* thread, uint32_t ms) {
|
||||
while (ms > 0 && !PltIsThreadInterrupted(thread)) {
|
||||
int msToSleep = ms < INTERRUPT_PERIOD_MS ? ms : INTERRUPT_PERIOD_MS;
|
||||
uint32_t msToSleep = ms < INTERRUPT_PERIOD_MS ? ms : INTERRUPT_PERIOD_MS;
|
||||
PltSleepMs(msToSleep);
|
||||
ms -= msToSleep;
|
||||
}
|
||||
|
||||
@@ -73,5 +73,5 @@ void PltSignalConditionVariable(PLT_COND* cond);
|
||||
void PltBroadcastConditionVariable(PLT_COND* cond);
|
||||
void PltWaitForConditionVariable(PLT_COND* cond, PLT_MUTEX* mutex);
|
||||
|
||||
void PltSleepMs(int ms);
|
||||
void PltSleepMsInterruptible(PLT_THREAD* thread, int ms);
|
||||
void PltSleepMs(uint32_t ms);
|
||||
void PltSleepMsInterruptible(PLT_THREAD* thread, uint32_t ms);
|
||||
Reference in new issue
Block a user