From 68a7e2994c14efa10d4ec2b800e74d6bfdc00953 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 26 Mar 2017 12:05:47 -0700 Subject: [PATCH] Tweaked pdcurses message pump patch to avoid potential overflows. Also updated musikboix.rc's FileDescription field to be more inline with what other apps display here. --- src/3rdparty/win32_src/pdcurses/pdcutil.c | 12 ++++++------ src/musikbox/musikbox.rc | Bin 5138 -> 5096 bytes 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/win32_src/pdcurses/pdcutil.c b/src/3rdparty/win32_src/pdcurses/pdcutil.c index 5a7a718ed..54b9858cf 100644 --- a/src/3rdparty/win32_src/pdcurses/pdcutil.c +++ b/src/3rdparty/win32_src/pdcurses/pdcutil.c @@ -16,10 +16,10 @@ void PDC_napms(int ms) /* 'ms' = milli, _not_ microseconds! */ { /* RR: keep GUI window responsive while PDCurses sleeps */ MSG msg; - int start, end, sleepMs; + DWORD start, end, delta; extern bool PDC_bDone; - start = (int) GetTickCount(); + start = GetTickCount(); //PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); @@ -30,10 +30,10 @@ void PDC_napms(int ms) /* 'ms' = milli, _not_ microseconds! */ DispatchMessage(&msg); } - end = (int) GetTickCount(); - sleepMs = ms - (end - start); - sleepMs = (sleepMs < 0) ? 0 : sleepMs; - Sleep((DWORD) sleepMs); + end = GetTickCount(); + delta = end - start; + delta = ms > delta ? ms - delta : 0; + Sleep(delta); } const char *PDC_sysname(void) diff --git a/src/musikbox/musikbox.rc b/src/musikbox/musikbox.rc index 7c9da7b12022989c32f247d3929133e1815e07a5..7ea5a43054e45cc44500020afb356594ec6c0bfe 100644 GIT binary patch delta 16 XcmbQF@j`t=1n=Z3ew)qvcth9#IMoIZ delta 74 zcmaE%K1pLk1g~Wxg91YdLn=cNLoP!mLmopSLk@#3LlTfK28yNtWpf!yf$U6%WFWf$ UD4WPo2~t1#Ag}J`DZC+U0E