Module Name:    src
Committed By:   dholland
Date:           Sat Mar 22 23:31:28 UTC 2014

Modified Files:
        src/games/battlestar: command5.c

Log Message:
avoid unnecessary floating point ops


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/battlestar/command5.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/battlestar/command5.c
diff -u src/games/battlestar/command5.c:1.4 src/games/battlestar/command5.c:1.5
--- src/games/battlestar/command5.c:1.4	Tue Jun 19 05:46:08 2012
+++ src/games/battlestar/command5.c	Sat Mar 22 23:31:28 2014
@@ -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(".");

Reply via email to