Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/warp roundsleep(): Too many zeros; tv_nsec should be c...



details:   https://anonhg.NetBSD.org/src/rev/fb992d6b959a
branches:  trunk
changeset: 946194:fb992d6b959a
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Nov 21 09:24:02 2020 +0000

description:
roundsleep(): Too many zeros; tv_nsec should be compared with
500 msec, not 5000. Raised by clang for ILP32 archs.

diffstat:

 games/warp/util.h |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 2e486d789903 -r fb992d6b959a games/warp/util.h
--- a/games/warp/util.h Sat Nov 21 09:19:46 2020 +0000
+++ b/games/warp/util.h Sat Nov 21 09:24:02 2020 +0000
@@ -18,7 +18,7 @@
     /* we get fractions of seconds from calling ftime on timebuf */
 
 extern struct timespec timebuf;
-#define roundsleep(x) (clock_gettime(CLOCK_REALTIME, &timebuf),sleep(timebuf.tv_nsec > 5000000000 ?x+1:x))
+#define roundsleep(x) (clock_gettime(CLOCK_REALTIME, &timebuf),sleep(timebuf.tv_nsec > (500 * 1000 * 1000) ?x+1:x))
 
 #define waiting 0
 



Home | Main Index | Thread Index | Old Index