aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-01-23 20:16:01 -0500
committerDavid Robillard <d@drobilla.net>2025-01-31 17:07:54 -0500
commit306c5c66344c2a05ab7c5e0d845b9e36a633aa5b (patch)
treeab28daf39dbc6624112a6c481aeda8e6f23b912a /src
parentef551ed4b85bc29b3eb48775faeadcf41596c40a (diff)
downloadpugl-306c5c66344c2a05ab7c5e0d845b9e36a633aa5b.tar.gz
pugl-306c5c66344c2a05ab7c5e0d845b9e36a633aa5b.tar.bz2
pugl-306c5c66344c2a05ab7c5e0d845b9e36a633aa5b.zip
Windows: Avoid using a floating point loop counter
Diffstat (limited to 'src')
-rw-r--r--src/win.c4
1 files changed, 3 insertions, 1 deletions
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);
}
}