X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/dc5073e330c76cc92c679f0aa3aae6fe8218b1dd..4c76b7ec11ea4a4c4f121d6623ddec249e227899:/worm/worm.c diff --git a/worm/worm.c b/worm/worm.c index 19e697ec..2c166128 100644 --- a/worm/worm.c +++ b/worm/worm.c @@ -1,4 +1,4 @@ -/* $NetBSD: worm.c,v 1.22 2001/08/31 07:15:44 jsm Exp $ */ +/* $NetBSD: worm.c,v 1.28 2008/08/08 16:10:47 drochner Exp $ */ /* * Copyright (c) 1980, 1993 @@ -12,11 +12,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. * @@ -35,15 +31,15 @@ #include #ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ - The Regents of the University of California. All rights reserved.\n"); +__COPYRIGHT("@(#) Copyright (c) 1980, 1993\ + The Regents of the University of California. All rights reserved."); #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: worm.c,v 1.22 2001/08/31 07:15:44 jsm Exp $"); +__RCSID("$NetBSD: worm.c,v 1.28 2008/08/08 16:10:47 drochner Exp $"); #endif #endif /* not lint */ @@ -84,17 +80,17 @@ int visible_len; int lastch; char outbuf[BUFSIZ]; -void crash __P((void)) __attribute__((__noreturn__)); -void display __P((const struct body *, char)); -int main __P((int, char **)); -void leave __P((int)) __attribute__((__noreturn__)); -void life __P((void)); -void newpos __P((struct body *)); -void process __P((int)); -void prize __P((void)); -int rnd __P((int)); -void setup __P((void)); -void wake __P((int)); +void crash(void) __dead; +void display(const struct body *, char); +int main(int, char **); +void leave(int) __dead; +void life(void); +void newpos(struct body *); +void process(int); +void prize(void); +int rnd(int); +void setup(void); +void wake(int); int main(argc, argv) @@ -110,8 +106,9 @@ main(argc, argv) signal(SIGALRM, wake); signal(SIGINT, leave); signal(SIGQUIT, leave); - initscr(); - crmode(); + if (!initscr()) + errx(0, "couldn't initialize screen"); + cbreak(); noecho(); #ifdef KEY_LEFT keypad(stdscr, TRUE); @@ -217,7 +214,7 @@ leave(dummy) void wake(dummy) - int dummy __attribute__((__unused__)); + int dummy __unused; { signal(SIGALRM, wake); fflush(stdout);