X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/f5bcaa7c6f42e16025c434d6cd9a2ea49b58731b..9ee179a6089b185e0a162155b0073f9cfb45b4bf:/tetris/input.c diff --git a/tetris/input.c b/tetris/input.c index cae49c8a..e5f8c12a 100644 --- a/tetris/input.c +++ b/tetris/input.c @@ -1,4 +1,4 @@ -/* $NetBSD: input.c,v 1.8 2002/12/29 15:12:17 kristerw Exp $ */ +/* $NetBSD: input.c,v 1.11 2009/05/25 04:33:53 dholland Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -76,8 +72,7 @@ * Return 0 => no input, 1 => can read() from stdin */ int -rwait(tvp) - struct timeval *tvp; +rwait(struct timeval *tvp) { struct pollfd set[1]; struct timeval starttv, endtv; @@ -104,8 +99,10 @@ again: /* NOTREACHED */ case 0: /* timed out */ - tvp->tv_sec = 0; - tvp->tv_usec = 0; + if (tvp) { + tvp->tv_sec = 0; + tvp->tv_usec = 0; + } return (0); } if (tvp) { @@ -122,7 +119,7 @@ again: * Eat any input that might be available. */ void -tsleep() +tsleep(void) { struct timeval tv; char c; @@ -138,7 +135,7 @@ tsleep() * getchar with timeout. */ int -tgetchar() +tgetchar(void) { static struct timeval timeleft; char c;