diff options
author | dholland <dholland@NetBSD.org> | 2014-03-22 23:31:28 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2014-03-22 23:31:28 +0000 |
commit | 82159d673f616b12554c28d5ac54f515fec21e91 (patch) | |
tree | 7a0c52c95d1dc35611f8c24161d7dc98f6a94029 /battlestar | |
parent | bab8acbebbc3abc9c5408dc3c4b9a0f9a7be035a (diff) | |
download | bsdgames-darwin-82159d673f616b12554c28d5ac54f515fec21e91.tar.gz bsdgames-darwin-82159d673f616b12554c28d5ac54f515fec21e91.tar.zst bsdgames-darwin-82159d673f616b12554c28d5ac54f515fec21e91.zip |
avoid unnecessary floating point ops
Diffstat (limited to 'battlestar')
-rw-r--r-- | battlestar/command5.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/battlestar/command5.c b/battlestar/command5.c index e5fc3a37..fa92ee04 100644 --- a/battlestar/command5.c +++ b/battlestar/command5.c @@ -1,4 +1,4 @@ -/* $NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $ */ +/* $NetBSD: command5.c,v 1.5 2014/03/22 23:31:28 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $"); +__RCSID("$NetBSD: command5.c,v 1.5 2014/03/22 23:31:28 dholland Exp $"); #endif #endif /* not lint */ @@ -186,10 +186,13 @@ zzz(void) { int oldtime; int n; + int zzztime; + + zzztime = (3 * CYCLE) / 4; oldtime = ourtime; - if ((snooze - ourtime) < (0.75 * CYCLE)) { - ourtime += 0.75 * CYCLE - (snooze - ourtime); + if ((snooze - ourtime) < zzztime) { + ourtime += zzztime - (snooze - ourtime); printf("<zzz>"); for (n = 0; n < ourtime - oldtime; n++) printf("."); |