Skip to content

Commit

Permalink
__STDC__ is always defined on NetBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed May 26, 2002
1 parent bf840df commit 7fd8f3d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 140 deletions.
31 changes: 3 additions & 28 deletions games/cribbage/io.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $ */
/* $NetBSD: io.c,v 1.15 2002/05/26 00:12:11 wiz Exp $ */

/*-
* Copyright (c) 1980, 1993
Expand Down Expand Up @@ -38,24 +38,19 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $");
__RCSID("$NetBSD: io.c,v 1.15 2002/05/26 00:12:11 wiz Exp $");
#endif
#endif /* not lint */

#include <ctype.h>
#include <curses.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>

#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif

#include "deck.h"
#include "cribbage.h"
#include "cribcur.h"
Expand Down Expand Up @@ -392,21 +387,11 @@ int Mpos = 0;
static int Newpos = 0;

void
#if __STDC__
msg(const char *fmt, ...)
#else
msg(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;

#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
Newpos = strlen(Msgbuf);
va_end(ap);
Expand All @@ -418,21 +403,11 @@ msg(fmt, va_alist)
* Add things to the current message
*/
void
#if __STDC__
addmsg(const char *fmt, ...)
#else
addmsg(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;

#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
Newpos = strlen(Msgbuf);
va_end(ap);
Expand Down
8 changes: 2 additions & 6 deletions games/hack/extern.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.4 2001/03/25 20:43:58 jsm Exp $ */
/* $NetBSD: extern.h,v 1.5 2002/05/26 00:12:12 wiz Exp $ */

/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -37,12 +37,8 @@
*/
#ifndef _EXTERN_H_
#define _EXTERN_H_
#include <stdio.h>
#ifndef __STDC__
#include <varargs.h>
#else
#include <stdarg.h>
#endif
#include <stdio.h>

/* alloc.c */
long *alloc __P((unsigned));
Expand Down
15 changes: 2 additions & 13 deletions games/hack/hack.main.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* $NetBSD: hack.main.c,v 1.6 2001/03/25 20:44:01 jsm Exp $ */
/* $NetBSD: hack.main.c,v 1.7 2002/05/26 00:12:12 wiz Exp $ */

/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.main.c,v 1.6 2001/03/25 20:44:01 jsm Exp $");
__RCSID("$NetBSD: hack.main.c,v 1.7 2002/05/26 00:12:12 wiz Exp $");
#endif /* not lint */

#include <signal.h>
Expand Down Expand Up @@ -466,22 +466,11 @@ askname()

/* VARARGS1 */
void
#ifdef __STDC__
impossible(const char *s, ...)
#else
impossible(va_alist)
va_dcl
#endif
{
va_list ap;
#ifndef __STDC__
const char *s;

va_start(ap);
s = va_arg(ap, const char *);
#else
va_start(ap, s);
#endif
vpline(s, ap);
va_end(ap);
pline("Program in disorder - perhaps you'd better Quit.");
Expand Down
16 changes: 3 additions & 13 deletions games/hack/hack.pri.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* $NetBSD: hack.pri.c,v 1.6 2001/03/25 20:44:02 jsm Exp $ */
/* $NetBSD: hack.pri.c,v 1.7 2002/05/26 00:12:12 wiz Exp $ */

/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.pri.c,v 1.6 2001/03/25 20:44:02 jsm Exp $");
__RCSID("$NetBSD: hack.pri.c,v 1.7 2002/05/26 00:12:12 wiz Exp $");
#endif /* not lint */

#include "hack.h"
Expand Down Expand Up @@ -40,21 +40,11 @@ swallowed()
boolean panicking;

void
#ifdef __STDC__
panic(const char *fmt, ...)
#else
panic(va_alist)
va_dcl
#endif
{
va_list ap;
#ifndef __STDC__
const char *fmt;
va_start(ap);
fmt = va_arg(ap, const char *);
#else

va_start(ap, fmt);
#endif
if (panicking++)
exit(1); /* avoid loops - this should never happen */
home();
Expand Down
16 changes: 3 additions & 13 deletions games/hack/hack.topl.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* $NetBSD: hack.topl.c,v 1.5 2001/03/25 20:44:03 jsm Exp $ */
/* $NetBSD: hack.topl.c,v 1.6 2002/05/26 00:12:12 wiz Exp $ */

/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*/

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hack.topl.c,v 1.5 2001/03/25 20:44:03 jsm Exp $");
__RCSID("$NetBSD: hack.topl.c,v 1.6 2002/05/26 00:12:12 wiz Exp $");
#endif /* not lint */

#include <stdlib.h>
Expand Down Expand Up @@ -143,21 +143,11 @@ clrlin()
}

void
#ifdef __STDC__
pline(const char *fmt, ...)
#else
pline(va_alist)
va_dcl
#endif
{
va_list ap;
#ifndef __STDC__
const char *fmt;
va_start(ap);
fmt = va_arg(ap, const char *);
#else

va_start(ap, fmt);
#endif
vpline(fmt, ap);
va_end(ap);
}
Expand Down
15 changes: 2 additions & 13 deletions games/hack/hack.tty.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: hack.tty.c,v 1.9 2001/03/25 20:44:03 jsm Exp $ */
/* $NetBSD: hack.tty.c,v 1.10 2002/05/26 00:12:12 wiz Exp $ */

/*-
* Copyright (c) 1988, 1993
Expand Down Expand Up @@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: hack.tty.c,v 1.9 2001/03/25 20:44:03 jsm Exp $");
__RCSID("$NetBSD: hack.tty.c,v 1.10 2002/05/26 00:12:12 wiz Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -143,22 +143,11 @@ setftty()
/* fatal error */
/* VARARGS1 */
void
#ifdef __STDC__
error(const char *fmt, ...)
#else
error(va_alist)
va_dcl
#endif
{
va_list ap;
#ifndef __STDC__
const char *fmt;

va_start(ap);
fmt = va_arg(ap, const char *);
#else
va_start(ap, fmt);
#endif
if (settty_needed)
settty((char *) 0);
vprintf(fmt, ap);
Expand Down
24 changes: 5 additions & 19 deletions games/hunt/huntd/terminal.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $ */
/* $NetBSD: terminal.c,v 1.3 2002/05/26 00:12:13 wiz Exp $ */
/*
* Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
Expand All @@ -7,16 +7,12 @@

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $");
__RCSID("$NetBSD: terminal.c,v 1.3 2002/05/26 00:12:13 wiz Exp $");
#endif /* not lint */

#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
# include "hunt.h"
# define TERM_WIDTH 80 /* Assume terminals are 80-char wide */
#include "hunt.h"
#define TERM_WIDTH 80 /* Assume terminals are 80-char wide */

/*
* cgoto:
Expand Down Expand Up @@ -110,22 +106,12 @@ ref(pp)
* Send a command to the given user
*/
void
#if __STDC__
sendcom(PLAYER *pp, int command, ...)
#else
sendcom(pp, command, va_alist)
PLAYER *pp;
int command;
va_dcl
#endif
{
va_list ap;
int arg1, arg2;
#if __STDC__

va_start(ap, command);
#else
va_start(ap);
#endif
(void) putc(command, pp->p_output);
switch (command & 0377) {
case MOVE:
Expand Down
20 changes: 2 additions & 18 deletions games/larn/io.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: io.c,v 1.13 2001/11/02 18:27:00 christos Exp $ */
/* $NetBSD: io.c,v 1.14 2002/05/26 00:12:13 wiz Exp $ */

/*
* io.c Larn is copyrighted 1986 by Noah Morgan.
Expand Down Expand Up @@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: io.c,v 1.13 2001/11/02 18:27:00 christos Exp $");
__RCSID("$NetBSD: io.c,v 1.14 2002/05/26 00:12:13 wiz Exp $");
#endif /* not lint */

#include "header.h"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -249,26 +245,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;
Expand Down
Loading

0 comments on commit 7fd8f3d

Please sign in to comment.