Source-Changes-HG archive

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

[src/trunk]: src/games/worms Properly handle -d 1000, OK'd by jsm



details:   https://anonhg.NetBSD.org/src/rev/6abd6f92c3a8
branches:  trunk
changeset: 565108:6abd6f92c3a8
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Mon Mar 29 20:30:03 2004 +0000

description:
Properly handle -d 1000, OK'd by jsm

diffstat:

 games/worms/worms.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 59478c48cc46 -r 6abd6f92c3a8 games/worms/worms.c
--- a/games/worms/worms.c       Mon Mar 29 17:08:25 2004 +0000
+++ b/games/worms/worms.c       Mon Mar 29 20:30:03 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: worms.c,v 1.14 2004/02/08 22:21:57 jsm Exp $   */
+/*     $NetBSD: worms.c,v 1.15 2004/03/29 20:30:03 hubertf Exp $       */
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)worms.c    8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: worms.c,v 1.14 2004/02/08 22:21:57 jsm Exp $");
+__RCSID("$NetBSD: worms.c,v 1.15 2004/03/29 20:30:03 hubertf Exp $");
 #endif
 #endif /* not lint */
 
@@ -292,7 +292,12 @@
                        endwin();
                        exit(0);
                }
-               if (delay) usleep(delay);
+               if (delay) {
+                       if (delay % 1000000 != 0)
+                               usleep(delay % 1000000);
+                       if (delay >= 1000000)
+                               sleep(delay / 1000000);
+               }
                for (n = 0, w = &worm[0]; n < number; n++, w++) {
                        if ((x = w->xpos[h = w->head]) < 0) {
                                mvaddch(y = w->ypos[h] = bottom,



Home | Main Index | Thread Index | Old Index