fix redundant decls and nested externs. while I am here change my copyright

to TNF.
This commit is contained in:
christos 2001-02-05 00:37:43 +00:00
parent 1f9a3967e4
commit bc32159d26
6 changed files with 36 additions and 45 deletions

View File

@ -1,7 +1,11 @@
/* $NetBSD: extern.h,v 1.2 1999/10/04 23:27:01 lukem Exp $ */ /* $NetBSD: extern.h,v 1.3 2001/02/05 00:37:43 christos Exp $ */
/* /*-
* Copyright (c) 1997 Christos Zoulas. All rights reserved. * Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -13,20 +17,23 @@
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: * must display the following acknowledgement:
* This product includes software developed by Christos Zoulas. * This product includes software developed by the NetBSD
* 4. The name of the author may not be used to endorse or promote products * Foundation, Inc. and its contributors.
* derived from this software without specific prior written permission. * 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _EXTERN_H_ #ifndef _EXTERN_H_
#define _EXTERN_H_ #define _EXTERN_H_
@ -39,7 +46,6 @@
/* alloc.c */ /* alloc.c */
long *alloc __P((unsigned)); long *alloc __P((unsigned));
long *alloc __P((unsigned));
long *enlarge __P((char *, unsigned)); long *enlarge __P((char *, unsigned));
/* hack.apply.c */ /* hack.apply.c */
@ -60,12 +66,10 @@ int dopickup __P((void));
void pickup __P((int)); void pickup __P((int));
void lookaround __P((void)); void lookaround __P((void));
int monster_nearby __P((void)); int monster_nearby __P((void));
int cansee __P((xchar, xchar));
int rroom __P((int, int)); int rroom __P((int, int));
int cansee __P((xchar, xchar)); int cansee __P((xchar, xchar));
int sgn __P((int)); int sgn __P((int));
void setsee __P((void)); void setsee __P((void));
void setsee __P((void));
void nomul __P((int)); void nomul __P((int));
int abon __P((void)); int abon __P((void));
int dbon __P((void)); int dbon __P((void));
@ -451,7 +455,6 @@ int used __P((int));
/* hack.save.c */ /* hack.save.c */
int dosave __P((void)); int dosave __P((void));
void hangup __P((int));
int dosave0 __P((int)); int dosave0 __P((int));
int dorecover __P((int)); int dorecover __P((int));
struct obj *restobjchn __P((int)); struct obj *restobjchn __P((int));
@ -466,15 +469,11 @@ void seemimic __P((struct monst *));
/* hack.shk.c */ /* hack.shk.c */
void obfree __P((struct obj *, struct obj *)); void obfree __P((struct obj *, struct obj *));
int inshop __P((void));
int dopay __P((void));
void paybill __P((void)); void paybill __P((void));
void replshk __P((struct monst *, struct monst *));
char *shkname __P((struct monst *)); char *shkname __P((struct monst *));
void shkdead __P((struct monst *)); void shkdead __P((struct monst *));
void replshk __P((struct monst *, struct monst *)); void replshk __P((struct monst *, struct monst *));
int inshop __P((void)); int inshop __P((void));
void obfree __P((struct obj *, struct obj *));
int dopay __P((void)); int dopay __P((void));
struct bill_x; struct bill_x;
struct obj *bp_to_obj __P((struct bill_x *)); struct obj *bp_to_obj __P((struct bill_x *));
@ -608,10 +607,6 @@ int gd_move __P((void));
void gddead __P((void)); void gddead __P((void));
void replgd __P((struct monst *, struct monst *)); void replgd __P((struct monst *, struct monst *));
void invault __P((void)); void invault __P((void));
void setgd __P((void));
void invault __P((void));
int gd_move __P((void));
void replgd __P((struct monst *, struct monst *));
/* hack.version.c */ /* hack.version.c */
int doversion __P((void)); int doversion __P((void));

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.h,v 1.6 2001/01/16 02:50:28 cgd Exp $ */ /* $NetBSD: hack.h,v 1.7 2001/02/05 00:37:43 christos Exp $ */
/* /*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
@ -147,7 +147,6 @@ extern char lock[];
extern char mlarge[]; extern char mlarge[];
extern char morc; extern char morc;
extern char nul[]; extern char nul[];
extern char pl_character[];
extern char plname[PL_NSIZ], pl_character[PL_CSIZ]; extern char plname[PL_NSIZ], pl_character[PL_CSIZ];
extern char quitchars[]; extern char quitchars[];
extern char sdir[]; /* defined in hack.c */ extern char sdir[]; /* defined in hack.c */
@ -165,7 +164,6 @@ extern int nroom;
extern long moves; extern long moves;
extern long wailmsg; extern long wailmsg;
extern schar xdir[], ydir[]; /* idem */ extern schar xdir[], ydir[]; /* idem */
extern struct gold *fgold;
extern struct monst *mydogs; extern struct monst *mydogs;
extern struct monst youmonst; extern struct monst youmonst;
extern struct obj *billobjs; extern struct obj *billobjs;
@ -175,7 +173,6 @@ extern struct obj *uball; /* defined if PUNISHED */
extern struct obj *uchain; /* defined iff PUNISHED */ extern struct obj *uchain; /* defined iff PUNISHED */
extern struct obj zeroobj; extern struct obj zeroobj;
extern struct permonst li_dog, dog, la_dog; extern struct permonst li_dog, dog, la_dog;
extern struct permonst mons[CMNUM + 2];
extern struct permonst pm_eel; extern struct permonst pm_eel;
extern struct permonst pm_ghost; extern struct permonst pm_ghost;
extern struct permonst pm_mail_daemon; extern struct permonst pm_mail_daemon;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.options.c,v 1.4 1997/10/19 16:58:42 christos Exp $ */ /* $NetBSD: hack.options.c,v 1.5 2001/02/05 00:37:43 christos Exp $ */
/* /*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
@ -6,10 +6,11 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hack.options.c,v 1.4 1997/10/19 16:58:42 christos Exp $"); __RCSID("$NetBSD: hack.options.c,v 1.5 2001/02/05 00:37:43 christos Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include "hack.h" #include "hack.h"
#include "extern.h" #include "extern.h"
@ -121,7 +122,6 @@ parseoptions(opts, from_env)
while (*op) { while (*op) {
num = 1; num = 1;
if (digit(*op)) { if (digit(*op)) {
/*###124 [cc] warning: implicit declaration of function `atoi'%%%*/
num = atoi(op); num = atoi(op);
while (digit(*op)) while (digit(*op))
op++; op++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.read.c,v 1.5 1998/08/30 09:19:37 veego Exp $ */ /* $NetBSD: hack.read.c,v 1.6 2001/02/05 00:37:43 christos Exp $ */
/* /*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
@ -6,7 +6,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hack.read.c,v 1.5 1998/08/30 09:19:37 veego Exp $"); __RCSID("$NetBSD: hack.read.c,v 1.6 2001/02/05 00:37:43 christos Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdlib.h> #include <stdlib.h>
@ -193,7 +193,6 @@ doread()
} }
case SCR_GENOCIDE: case SCR_GENOCIDE:
{ {
extern char genocided[], fut_geno[];
char buf[BUFSZ]; char buf[BUFSZ];
struct monst *mtmp, *mtmp2; struct monst *mtmp, *mtmp2;
@ -575,7 +574,6 @@ monstersym(ch) /* arnold@ucsfcgl */
char ch; char ch;
{ {
struct permonst *mp; struct permonst *mp;
extern struct permonst pm_eel;
/* /*
* can't genocide certain monsters * can't genocide certain monsters

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.tty.c,v 1.7 2000/07/10 10:19:25 itojun Exp $ */ /* $NetBSD: hack.tty.c,v 1.8 2001/02/05 00:37:43 christos Exp $ */
/*- /*-
* Copyright (c) 1988, 1993 * Copyright (c) 1988, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: hack.tty.c,v 1.7 2000/07/10 10:19:25 itojun Exp $"); __RCSID("$NetBSD: hack.tty.c,v 1.8 2001/02/05 00:37:43 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -50,6 +50,7 @@ __RCSID("$NetBSD: hack.tty.c,v 1.7 2000/07/10 10:19:25 itojun Exp $");
*/ */
#include <termios.h> #include <termios.h>
#include <termcap.h>
#include "hack.h" #include "hack.h"
#include "extern.h" #include "extern.h"
@ -73,7 +74,6 @@ struct termios inittyb, curttyb;
void void
gettty() gettty()
{ {
extern speed_t ospeed;
if (tcgetattr(0, &inittyb) < 0) if (tcgetattr(0, &inittyb) < 0)
perror("Hack (gettty)"); perror("Hack (gettty)");
curttyb = inittyb; curttyb = inittyb;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hack.unix.c,v 1.6 1999/04/25 19:08:34 kristerw Exp $ */ /* $NetBSD: hack.unix.c,v 1.7 2001/02/05 00:37:43 christos Exp $ */
/* /*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
@ -6,7 +6,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hack.unix.c,v 1.6 1999/04/25 19:08:34 kristerw Exp $"); __RCSID("$NetBSD: hack.unix.c,v 1.7 2001/02/05 00:37:43 christos Exp $");
#endif /* not lint */ #endif /* not lint */
/* This file collects some Unix dependencies; hack.pager.c contains some more */ /* This file collects some Unix dependencies; hack.pager.c contains some more */
@ -36,6 +36,8 @@ __RCSID("$NetBSD: hack.unix.c,v 1.6 1999/04/25 19:08:34 kristerw Exp $");
#include "hack.h" /* mainly for strchr() which depends on BSD */ #include "hack.h" /* mainly for strchr() which depends on BSD */
#include "extern.h" #include "extern.h"
extern int locknum;
void void
setrandom() setrandom()
@ -209,7 +211,6 @@ veryold(fd)
void void
getlock() getlock()
{ {
extern int hackpid, locknum;
int i = 0, fd; int i = 0, fd;
(void) fflush(stdout); (void) fflush(stdout);