From 306c5c66344c2a05ab7c5e0d845b9e36a633aa5b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 23 Jan 2025 20:16:01 -0500 Subject: Windows: Avoid using a floating point loop counter --- src/win.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/win.c') diff --git a/src/win.c b/src/win.c index fe8d1b4..77d6800 100644 --- a/src/win.c +++ b/src/win.c @@ -1150,11 +1150,13 @@ puglUpdate(PuglWorld* world, double timeout) st = puglDispatchWinEvents(world); } else { const double endTime = startTime + timeout - minWaitSeconds; - for (double t = startTime; t < endTime; t = puglGetTime(world)) { + double t = startTime; + while (!st && t < endTime) { if ((st = puglPollWinEvents(world, endTime - t)) || (st = puglDispatchWinEvents(world))) { break; } + t = puglGetTime(world); } } -- cgit v1.2.1