Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/snake/snake Do not pass usleep() values >= 1 million. ...
details: https://anonhg.NetBSD.org/src/rev/5ddfbb8b396f
branches: trunk
changeset: 346122:5ddfbb8b396f
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Jun 27 08:46:04 2016 +0000
description:
Do not pass usleep() values >= 1 million. From Henning Petersen in PR 51286
diffstat:
games/snake/snake/snake.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r b86a326465b6 -r 5ddfbb8b396f games/snake/snake/snake.c
--- a/games/snake/snake/snake.c Mon Jun 27 08:18:34 2016 +0000
+++ b/games/snake/snake/snake.c Mon Jun 27 08:46:04 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $ */
+/* $NetBSD: snake.c,v 1.29 2016/06/27 08:46:04 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $");
+__RCSID("$NetBSD: snake.c,v 1.29 2016/06/27 08:46:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -97,6 +97,7 @@
#endif
#define pchar(point, c) mvaddch((point)->line + 1, (point)->col + 1, (c))
+/* note t must be < 20 due to restrictions of usleep() */
#define delay(t) usleep(t * 50000);
static struct point you;
@@ -892,7 +893,8 @@
bonus = ((random() >> 8) & 0377) % 10;
mvprintw(lcnt + 1, 0, "%d\n", bonus);
refresh();
- delay(30);
+ delay(15);
+ delay(15);
if (bonus == i) {
spacewarp(1);
logit("bonus");
Home |
Main Index |
Thread Index |
Old Index