diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-02-19 19:39:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-02-19 19:39:42 +0000 |
commit | 3923126b85f9e8a77cab9a41b5a62125acd5b4cd (patch) | |
tree | 1a8b19c5db03f8c989fc8228811837b182feb7a3 /games | |
parent | cc03bdb70090357d2393b6ec82e3cde4d5ce5edd (diff) |
We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.
Diffstat (limited to 'games')
-rw-r--r-- | games/adventure/hdr.h | 6 | ||||
-rw-r--r-- | games/cribbage/io.c | 27 | ||||
-rw-r--r-- | games/hunt/hunt/display.c | 6 | ||||
-rw-r--r-- | games/larn/io.c | 20 | ||||
-rw-r--r-- | games/mille/misc.c | 21 | ||||
-rw-r--r-- | games/sail/pl_7.c | 40 | ||||
-rw-r--r-- | games/sail/sync.c | 36 |
7 files changed, 12 insertions, 144 deletions
diff --git a/games/adventure/hdr.h b/games/adventure/hdr.h index fcbdded5dc0..cf2c71511eb 100644 --- a/games/adventure/hdr.h +++ b/games/adventure/hdr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hdr.h,v 1.8 2001/08/06 22:59:05 pjanzen Exp $ */ +/* $OpenBSD: hdr.h,v 1.9 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: hdr.h,v 1.2 1995/03/21 12:05:02 cgd Exp $ */ /*- @@ -163,8 +163,4 @@ int turns, lmwarn, iwest, knfloc, detail, /* various flags & counters */ int demo, newloc, limit; /* We need to get a little tricky to avoid strings */ -#ifdef __STDC__ #define DECR(a,b,c,d,e) decr(*#a+'+',*#b+'-',*#c+'#',*#d+'&',*#e+'%') -#else -#define DECR(a,b,c,d,e) decr('a'+'+','b'+'-','c'+'#','d'+'&','e'+'%') -#endif diff --git a/games/cribbage/io.c b/games/cribbage/io.c index 142db231ba5..f44ea1eeeb5 100644 --- a/games/cribbage/io.c +++ b/games/cribbage/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.6 2001/08/17 23:14:30 pjanzen Exp $ */ +/* $OpenBSD: io.c,v 1.7 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $ */ /*- @@ -49,12 +49,7 @@ static char rcsid[] = "$NetBSD: io.c,v 1.7 1995/03/21 15:08:53 cgd Exp $"; #include <string.h> #include <termios.h> #include <unistd.h> - -#ifdef __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include "deck.h" #include "cribbage.h" @@ -401,21 +396,11 @@ int Mpos = 0; static int Newpos = 0; void -#ifdef __STDC__ msg(const char *fmt, ...) -#else -msg(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vsprintf(&Msgbuf[Newpos], fmt, ap); Newpos = strlen(Msgbuf); va_end(ap); @@ -427,21 +412,11 @@ msg(fmt, va_alist) * Add things to the current message */ void -#ifdef __STDC__ addmsg(const char *fmt, ...) -#else -addmsg(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#ifdef __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vsprintf(&Msgbuf[Newpos], fmt, ap); Newpos = strlen(Msgbuf); va_end(ap); diff --git a/games/hunt/hunt/display.c b/games/hunt/hunt/display.c index 57da669b28c..07fcd2d9dc1 100644 --- a/games/hunt/hunt/display.c +++ b/games/hunt/hunt/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.3 2000/02/10 11:13:11 d Exp $ */ +/* $OpenBSD: display.c,v 1.4 2002/02/19 19:39:36 millert Exp $ */ /* * Display abstraction. @@ -92,11 +92,7 @@ display_open() void display_beep() { -#ifdef __STDC__ (void) putchar('\a'); -#else - (void) putchar(CTRL('G')); -#endif } /* diff --git a/games/larn/io.c b/games/larn/io.c index 5adc9cba855..8f0b45734a1 100644 --- a/games/larn/io.c +++ b/games/larn/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.7 2000/06/29 07:55:41 pjanzen Exp $ */ +/* $OpenBSD: io.c,v 1.8 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: io.c,v 1.7 1997/10/18 20:03:26 christos Exp $ */ /* @@ -61,7 +61,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: io.c,v 1.7 2000/06/29 07:55:41 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: io.c,v 1.8 2002/02/19 19:39:36 millert Exp $"; #endif /* not lint */ #include "header.h" @@ -116,11 +116,7 @@ static char saveeof, saveeol; #endif /* not TERMIO or TERMIOS */ #ifndef NOVARARGS /* if we have varargs */ -#ifdef __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #else /* NOVARARGS */ /* if we don't have varargs */ typedef char *va_list; #define va_dcl int va_alist; @@ -250,26 +246,14 @@ sprintf(str) } #else /* lint */ /* VARARGS */ -#ifdef __STDC__ void lprintf(const char *fmt, ...) -#else -void -lprintf(va_alist) -va_dcl -#endif { va_list ap; /* pointer for variable argument list */ char *outb, *tmpb; long wide, left, cont, n; /* data for lprintf */ char db[12]; /* %d buffer in lprintf */ -#ifndef __STDC__ - char *fmt; - va_start(ap); /* initialize the var args pointer */ - fmt = va_arg(ap, char *); /* pointer to format string */ -#else va_start(ap, fmt); -#endif if (lpnt >= lpend) lflush(); outb = lpnt; diff --git a/games/mille/misc.c b/games/mille/misc.c index bc9eeaba250..719c330691e 100644 --- a/games/mille/misc.c +++ b/games/mille/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.7 2001/09/03 21:36:12 pjanzen Exp $ */ +/* $OpenBSD: misc.c,v 1.8 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: misc.c,v 1.4 1995/03/24 05:01:54 cgd Exp $ */ /* @@ -38,18 +38,13 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: misc.c,v 1.7 2001/09/03 21:36:12 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: misc.c,v 1.8 2002/02/19 19:39:36 millert Exp $"; #endif #endif /* not lint */ #include <sys/file.h> #include <termios.h> - -#if __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif +#include <stdarg.h> #include "mille.h" @@ -60,21 +55,11 @@ static char rcsid[] = "$OpenBSD: misc.c,v 1.7 2001/09/03 21:36:12 pjanzen Exp $" #define NUMSAFE 4 bool -#if __STDC__ error(char *str, ...) -#else -error(str, arg) - char *str; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, str); -#else - va_start(ap); -#endif wmove(Score, ERR_Y, ERR_X); vwprintw(Score, str, ap); wclrtoeol(Score); diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index c78e068f47b..9ebd23654b4 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pl_7.c,v 1.4 2001/09/05 22:32:28 deraadt Exp $ */ +/* $OpenBSD: pl_7.c,v 1.5 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: pl_7.c,v 1.6 1995/04/22 10:37:17 cgd Exp $ */ /* @@ -38,17 +38,13 @@ #if 0 static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: pl_7.c,v 1.4 2001/09/05 22:32:28 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pl_7.c,v 1.5 2002/02/19 19:39:36 millert Exp $"; #endif #endif /* not lint */ #include <sys/ttydefaults.h> #include "player.h" -#ifdef __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <unistd.h> #include <err.h> @@ -168,25 +164,12 @@ newturn(n) /*VARARGS2*/ void -#ifdef __STDC__ Signal(char *fmt, struct ship *ship, ...) -#else -Signal(va_alist) - va_dcl -#endif { va_list ap; char format[BUFSIZ]; -#ifndef __STDC__ - char *fmt; - struct ship *ship; - va_start(ap); - fmt = va_arg(ap, const char *); - ship = va_arg(ap, struct ship *); -#else va_start(ap, ship); -#endif if (!done_curses) { va_end(va); return; @@ -194,33 +177,18 @@ Signal(va_alist) if (*fmt == '\7') putchar(*fmt++); fmtship(format, sizeof(format), fmt, ship); -#ifdef __STDC__ (void) vw_printw(scroll_w, format, ap); -#else - (void) vwprintw(scroll_w, format, ap); -#endif va_end(ap); Scroll(); } /*VARARGS2*/ void -#ifdef __STDC__ Msg(char *fmt, ...) -#else -Msg(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - char *fmt; - va_start(ap); - fmt = va_arg(ap, const char *); -#else va_start(ap, fmt); -#endif if (!done_curses) { va_end(ap); @@ -228,11 +196,7 @@ Msg(va_alist) } if (*fmt == '\7') putchar(*fmt++); -#ifdef __STDC__ (void) vw_printw(scroll_w, fmt, ap); -#else - (void) vwprintw(scroll_w, fmt, ap); -#endif va_end(ap); Scroll(); } diff --git a/games/sail/sync.c b/games/sail/sync.c index 97f9e6ef71a..e0832531838 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sync.c,v 1.2 1999/01/18 06:20:54 pjanzen Exp $ */ +/* $OpenBSD: sync.c,v 1.3 2002/02/19 19:39:36 millert Exp $ */ /* $NetBSD: sync.c,v 1.9 1998/08/30 09:19:40 veego Exp $ */ /* @@ -39,17 +39,13 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: sync.c,v 1.2 1999/01/18 06:20:54 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: sync.c,v 1.3 2002/02/19 19:39:36 millert Exp $"; #endif #endif /* not lint */ #include <fcntl.h> #include <errno.h> -#ifdef __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #include <stdlib.h> #include <unistd.h> #include <sys/file.h> @@ -100,28 +96,13 @@ fmtship(buf, len, fmt, ship) /*VARARGS3*/ void -#ifdef __STDC__ makesignal(struct ship *from, const char *fmt, struct ship *ship, ...) -#else -makesignal(va_alias) - va_dcl -#endif { char message[BUFSIZ]; char format[BUFSIZ]; va_list ap; -#ifndef __STDC__ - struct ship *from; - const char *fmt; - struct ship *ship; - va_start(ap); - from = va_arg(ap, struct ship *); - fmt = va_arg(ap, const char *); - ship = va_arg(ap, struct ship *); -#else va_start(ap, ship); -#endif fmtship(format, sizeof(format), fmt, ship); (void) vsprintf(message, format, ap); va_end(ap); @@ -129,25 +110,12 @@ makesignal(va_alias) } void -#ifdef __STDC__ makemsg(struct ship *from, const char *fmt, ...) -#else -makemsg(va_alias) - va_dcl -#endif { char message[BUFSIZ]; va_list ap; -#ifndef __STDC__ - struct ship *from; - const char *fmt; - va_start(ap); - from = va_arg(ap, struct ship *); - fmt = va_arg(ap, const char *); -#else va_start(ap, fmt); -#endif (void) vsprintf(message, fmt, ap); va_end(ap); Writestr(W_SIGNAL, from, message); |