diff options
59 files changed, 417 insertions, 381 deletions
diff --git a/games/hack/alloc.c b/games/hack/alloc.c index d6289bcb929..5ab17ea1c2c 100644 --- a/games/hack/alloc.c +++ b/games/hack/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: alloc.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,6 +62,7 @@ */ #include <stdlib.h> + #include "hack.h" void * diff --git a/games/hack/def.flag.h b/games/hack/def.flag.h index 1a00ea706bd..731bb591cea 100644 --- a/games/hack/def.flag.h +++ b/games/hack/def.flag.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.flag.h,v 1.3 2003/03/16 21:22:35 camield Exp $*/ +/* $OpenBSD: def.flag.h,v 1.4 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: def.flag.h,v 1.3 1995/03/23 08:29:22 cgd Exp $*/ /* @@ -100,4 +100,3 @@ struct flag { }; extern struct flag flags; - diff --git a/games/hack/def.gold.h b/games/hack/def.gold.h index 4998972f355..35a19aa4940 100644 --- a/games/hack/def.gold.h +++ b/games/hack/def.gold.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.gold.h,v 1.3 2003/03/16 21:22:35 camield Exp $*/ +/* $OpenBSD: def.gold.h,v 1.4 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: def.gold.h,v 1.3 1995/03/23 08:29:27 cgd Exp $*/ /* @@ -69,5 +69,5 @@ struct gold { }; extern struct gold *fgold; -struct gold *g_at(); +struct gold *g_at(int, int); #define newgold() (struct gold *) alloc(sizeof(struct gold)) diff --git a/games/hack/def.monst.h b/games/hack/def.monst.h index 7af4c31e152..9818a0d1aa4 100644 --- a/games/hack/def.monst.h +++ b/games/hack/def.monst.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.monst.h,v 1.4 2003/03/16 21:22:35 camield Exp $*/ +/* $OpenBSD: def.monst.h,v 1.5 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: def.monst.h,v 1.3 1995/03/23 08:29:30 cgd Exp $*/ /* @@ -110,7 +110,7 @@ struct monst { extern struct monst *fmon; extern struct monst *fallen_down; -struct monst *m_at(); +struct monst *m_at(int, int); /* these are in mspeed */ #define MSLOW 1 /* slow monster */ diff --git a/games/hack/def.objects.h b/games/hack/def.objects.h index 61656426838..1c655a296e4 100644 --- a/games/hack/def.objects.h +++ b/games/hack/def.objects.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.objects.h,v 1.4 2003/05/19 06:30:56 pjanzen Exp $*/ +/* $OpenBSD: def.objects.h,v 1.5 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: def.objects.h,v 1.3 1995/03/23 08:29:36 cgd Exp $*/ /* @@ -63,8 +63,6 @@ */ /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */ -#include "config.h" - struct objclass objects[] = { { "strange object", NULL, NULL, 1, 0, diff --git a/games/hack/def.trap.h b/games/hack/def.trap.h index ca02b014638..ce66a2ab0ca 100644 --- a/games/hack/def.trap.h +++ b/games/hack/def.trap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.trap.h,v 1.3 2003/03/16 21:22:35 camield Exp $*/ +/* $OpenBSD: def.trap.h,v 1.4 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: def.trap.h,v 1.3 1995/03/23 08:29:41 cgd Exp $*/ /* @@ -71,7 +71,7 @@ struct trap { }; extern struct trap *ftrap; -struct trap *t_at(); +struct trap *t_at(int, int); #define newtrap() (struct trap *) alloc(sizeof(struct trap)) /* various kinds of traps */ diff --git a/games/hack/hack.Decl.c b/games/hack/hack.Decl.c index 449bb3f3d32..e8cdd822a71 100644 --- a/games/hack/hack.Decl.c +++ b/games/hack/hack.Decl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.Decl.c,v 1.6 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.Decl.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,7 +61,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" +#include "hack.h" + char nul[40]; /* contains zeros */ char plname[PL_NSIZ]; /* player name */ char lock[PL_NSIZ+4] = "1lock"; /* long enough for login name .99 */ diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c index 508cbb1ec4d..32a862b028e 100644 --- a/games/hack/hack.apply.c +++ b/games/hack/hack.apply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.apply.c,v 1.6 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.apply.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" -#include "def.edog.h" +#include "def.edog.h" +#include "hack.h" + extern int (*occupation)(void); extern char *occtxt; extern char quitchars[]; @@ -80,7 +81,7 @@ static int dig(void); static int use_pick_axe(struct obj *); int -doapply() +doapply(void) { struct obj *obj; int res = 1; @@ -128,7 +129,6 @@ doapply() return(res); } -/* ARGSUSED */ static void use_camera(struct obj *obj) { @@ -284,7 +284,6 @@ bchit(int ddx, int ddy, int range, char sym) return(mtmp); } -/* ARGSUSED */ static void use_whistle(struct obj *obj) { @@ -301,7 +300,6 @@ use_whistle(struct obj *obj) } } -/* ARGSUSED */ static void use_magic_whistle(struct obj *obj) { @@ -319,7 +317,7 @@ static coord dig_pos; static boolean dig_down; static int -dig() +dig(void) { struct rm *lev; int dpx = dig_pos.x, dpy = dig_pos.y; @@ -392,13 +390,13 @@ dig() /* When will hole be finished? Very rough indication used by shopkeeper. */ int -holetime() +holetime(void) { return( (occupation == dig) ? (250 - dig_effort)/20 : -1); } void -dighole() +dighole(void) { struct trap *ttmp = t_at(u.ux, u.uy); diff --git a/games/hack/hack.bones.c b/games/hack/hack.bones.c index 9c93b813ab7..9ce8d916a81 100644 --- a/games/hack/hack.bones.c +++ b/games/hack/hack.bones.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.bones.c,v 1.9 2015/11/11 01:12:10 deraadt Exp $ */ +/* $OpenBSD: hack.bones.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,7 +62,9 @@ */ #include <unistd.h> + #include "hack.h" + extern char plname[PL_NSIZ]; extern struct permonst pm_ghost; @@ -70,7 +72,7 @@ char bones[] = "bones_xx"; /* save bones and possessions of a deceased adventurer */ void -savebones() +savebones(void) { int fd; struct obj *otmp; @@ -135,7 +137,7 @@ savebones() } int -getbones() +getbones(void) { int fd,x,y,ok; diff --git a/games/hack/hack.c b/games/hack/hack.c index 30b8b203508..8049e6cf62a 100644 --- a/games/hack/hack.c +++ b/games/hack/hack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.c,v 1.9 2014/03/11 07:41:10 guenther Exp $ */ +/* $OpenBSD: hack.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" #include <stdio.h> +#include "hack.h" + extern char *nomovemsg; extern char *exclam(); @@ -79,7 +80,7 @@ static int inv_cnt(void); * 3. when walking out of a lit room */ void -unsee() +unsee(void) { int x,y; struct rm *lev; @@ -142,7 +143,7 @@ seeoff(int mode) /* 1 to redo @, 0 to leave them */ } void -domove() +domove(void) { xchar oldx,oldy; struct monst *mtmp; @@ -386,7 +387,7 @@ movobj(struct obj *obj, int ox, int oy) } int -dopickup() +dopickup(void) { if(!g_at(u.ux,u.uy) && !o_at(u.ux,u.uy)) { pline("There is nothing here to pick up."); @@ -534,7 +535,7 @@ pickup(int all) /* turn around a corner if that is the only way we can proceed */ /* do not turn left or right twice */ void -lookaround() +lookaround(void) { int x, y, i, x0, y0, m0, i0 = 9; int corrct = 0, noturn = 0; @@ -629,7 +630,7 @@ lookaround() /* something like lookaround, but we are not running */ /* react only to monsters that might hit us */ int -monster_nearby() +monster_nearby(void) { int x,y; struct monst *mtmp; @@ -714,7 +715,7 @@ sgn(int a) #ifdef QUEST void -setsee() +setsee(void) { int x,y; @@ -730,9 +731,8 @@ setsee() } #else - void -setsee() +setsee(void) { int x,y; @@ -775,7 +775,7 @@ nomul(int nval) } int -abon() +abon(void) { if(u.ustr == 3) return(-3); else if(u.ustr < 6) return(-2); @@ -787,7 +787,7 @@ abon() } int -dbon() +dbon(void) { if(u.ustr < 6) return(-1); else if(u.ustr < 16) return(0); @@ -835,7 +835,7 @@ losehp_m(int n, struct monst *mtmp) /* hit by V or W */ void -losexp() +losexp(void) { int num; @@ -851,7 +851,7 @@ losexp() } int -inv_weight() +inv_weight(void) { struct obj *otmp = invent; int wt = (u.ugold + 500)/1000; @@ -873,7 +873,7 @@ inv_weight() } static int -inv_cnt() +inv_cnt(void) { struct obj *otmp = invent; int ct = 0; @@ -886,7 +886,7 @@ inv_cnt() } long -newuexp() +newuexp(void) { return(10*(1L << (u.ulevel-1))); } diff --git a/games/hack/hack.cmd.c b/games/hack/hack.cmd.c index 106136cf67e..bff457e837d 100644 --- a/games/hack/hack.cmd.c +++ b/games/hack/hack.cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.cmd.c,v 1.8 2015/10/24 18:26:13 mmcc Exp $ */ +/* $OpenBSD: hack.cmd.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" -#include "def.func_tab.h" -#include <ctype.h> +#include <ctype.h> + +#include "def.func_tab.h" +#include "hack.h" struct func_tab cmdlist[]={ { '\020', doredotopl }, @@ -235,7 +236,7 @@ rhack(char *cmd) } int -doextcmd() /* here after # - now read a full-word command */ +doextcmd(void) /* here after # - now read a full-word command */ { char buf[BUFSZ]; struct ext_func_tab *efp = extcmdlist; @@ -297,7 +298,7 @@ getdir(boolean s) } void -confdir() +confdir(void) { int x = rn2(8); u.dx = xdir[x]; @@ -306,7 +307,7 @@ confdir() #ifdef QUEST void -finddir() +finddir(void) { int i, ui = u.di; diff --git a/games/hack/hack.do.c b/games/hack/hack.do.c index 8b2457cd8b1..435b653ddfe 100644 --- a/games/hack/hack.do.c +++ b/games/hack/hack.do.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.do.c,v 1.9 2015/11/11 01:12:10 deraadt Exp $ */ +/* $OpenBSD: hack.do.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -65,6 +65,7 @@ #include <stdlib.h> #include <unistd.h> + #include "hack.h" extern boolean level_exists[]; @@ -74,7 +75,7 @@ extern char *nomovemsg; static int drop(struct obj *); int -dodrop() +dodrop(void) { return(drop(getobj("0$#", "drop"))); } @@ -137,13 +138,13 @@ dropy(struct obj *obj) /* drop several things */ int -doddrop() +doddrop(void) { return(ggetobj("drop", drop, 0)); } int -dodown() +dodown(void) { if(u.ux != xdnstair || u.uy != ydnstair) { pline("You can't go down here."); @@ -163,7 +164,7 @@ dodown() } int -doup() +doup(void) { if(u.ux != xupstair || u.uy != yupstair) { pline("You can't go up here."); @@ -304,13 +305,13 @@ goto_level(int newlevel, boolean at_stairs) } int -donull() +donull(void) { return(1); /* Do nothing, but let other things happen */ } int -dopray() +dopray(void) { nomovemsg = "You finished your prayer."; nomul(-3); @@ -318,7 +319,7 @@ dopray() } int -dothrow() +dothrow(void) { struct obj *obj; struct monst *mon; @@ -547,7 +548,7 @@ set_wounded_legs(long side, int timex) } void -heal_legs() +heal_legs(void) { if(Wounded_legs) { if((Wounded_legs & BOTH_SIDES) == BOTH_SIDES) diff --git a/games/hack/hack.do_name.c b/games/hack/hack.do_name.c index b4845d58c42..07d928f2867 100644 --- a/games/hack/hack.do_name.c +++ b/games/hack/hack.do_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.do_name.c,v 1.10 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.do_name.c,v 1.11 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" #include <stdio.h> #include <stdlib.h> + +#include "hack.h" + extern char plname[]; static void do_oname(struct obj *); static char *lmonnam(struct monst *); @@ -110,7 +112,7 @@ getpos(int force, char *goal) } int -do_mname() +do_mname(void) { char buf[BUFSZ]; coord cc; @@ -205,7 +207,7 @@ do_oname(struct obj *obj) } int -ddocall() +ddocall(void) { struct obj *obj; diff --git a/games/hack/hack.do_wear.c b/games/hack/hack.do_wear.c index d4f9f172550..8027e93d056 100644 --- a/games/hack/hack.do_wear.c +++ b/games/hack/hack.do_wear.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.do_wear.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.do_wear.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include <stdlib.h> #include "hack.h" + extern char *nomovemsg; extern char quitchars[]; @@ -78,7 +77,7 @@ off_msg(struct obj *otmp) } int -doremarm() +doremarm(void) { struct obj *otmp; if(!uarm && !uarmh && !uarms && !uarmg) { @@ -104,7 +103,7 @@ doremarm() } int -doremring() +doremring(void) { if(!uleft && !uright){ pline("Not wearing any ring."); @@ -132,7 +131,6 @@ doremring() /* might look at morc here %% */ } } - /* NOTREACHED */ return(0); } @@ -181,7 +179,7 @@ armoroff(struct obj *otmp) } int -doweararm() +doweararm(void) { struct obj *otmp; int delay; @@ -242,7 +240,7 @@ doweararm() } int -dowearring() +dowearring(void) { struct obj *otmp; long mask = 0; @@ -350,7 +348,7 @@ ringoff(struct obj *obj) } void -find_ac() +find_ac(void) { int uac = 10; @@ -368,7 +366,7 @@ find_ac() } void -glibr() +glibr(void) { struct obj *otmp; int xfl = 0; @@ -397,7 +395,7 @@ glibr() } struct obj * -some_armor() +some_armor(void) { struct obj *otmph = uarm; @@ -408,7 +406,7 @@ some_armor() } void -corrode_armor() +corrode_armor(void) { struct obj *otmph = some_armor(); diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c index 104478e90e4..ce2bac3e076 100644 --- a/games/hack/hack.dog.c +++ b/games/hack/hack.dog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.dog.c,v 1.8 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.dog.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,10 +61,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" -#include "hack.mfndpos.h" -extern struct monst *makemon(); #include "def.edog.h" +#include "hack.h" +#include "hack.mfndpos.h" + +extern struct monst *makemon(struct permonst *, int, int); static void initedog(struct monst *); static int dogfood(struct obj *); @@ -78,7 +79,7 @@ struct permonst la_dog = void -makedog() +makedog(void) { struct monst *mtmp = makemon(&li_dog,u.ux,u.uy); @@ -104,7 +105,7 @@ struct monst *fallen_down = 0; /* monsters that fell through a trapdoor */ /* they will appear on the next level @ goes to, even if he goes up! */ void -losedogs() +losedogs(void) { struct monst *mtmp; @@ -123,7 +124,7 @@ losedogs() } void -keepdogs() +keepdogs(void) { struct monst *mtmp; diff --git a/games/hack/hack.eat.c b/games/hack/hack.eat.c index 527d8056f2b..beb97494ed5 100644 --- a/games/hack/hack.eat.c +++ b/games/hack/hack.eat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.eat.c,v 1.9 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.eat.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include "hack.h" +#include <stdio.h> + +#include "hack.h" + char POISONOUS[] = "ADKSVabhks"; extern char *nomovemsg; extern void (*afternmv)(void); @@ -110,14 +112,14 @@ static void newuhs(boolean); static int eatcorpse(struct obj *); void -init_uhunger() +init_uhunger(void) { u.uhunger = 900; u.uhs = NOT_HUNGRY; } int -opentin() +opentin(void) { int r; @@ -152,14 +154,14 @@ opentin() } void -Meatdone() +Meatdone(void) { u.usym = '@'; prme(); } int -doeat() +doeat(void) { struct obj *otmp; struct objclass *ftmp; @@ -333,7 +335,7 @@ eatx: } void -gethungry() +gethungry(void) { --u.uhunger; if(moves % 2) { @@ -367,7 +369,7 @@ lesshungry(int num) } void -unfaint() +unfaint(void) { u.uhs = FAINTING; flags.botl = 1; @@ -523,7 +525,6 @@ eatcorpse(struct obj *otmp) pline("You turn to stone."); killer = "dead cockatrice"; done("died"); - /* NOTREACHED */ case 'a': if(Stoned) { pline("What a pity - you just destroyed a future piece of art!"); diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c index 559904d1c51..421dc2a6d19 100644 --- a/games/hack/hack.end.c +++ b/games/hack/hack.end.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.end.c,v 1.14 2015/12/16 14:21:50 tb Exp $ */ +/* $OpenBSD: hack.end.c,v 1.15 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -66,6 +66,7 @@ #include <stdlib.h> #include <signal.h> #include <unistd.h> + #include "hack.h" #define newttentry() (struct toptenentry *) alloc(sizeof(struct toptenentry)) @@ -111,11 +112,10 @@ done1(int notused) return; } done("quit"); - /* NOTREACHED */ } int -done2() +done2(void) { done1(0); return(0); @@ -296,7 +296,7 @@ done(char *st1) } static void -topten() +topten(void) { int uid = getuid(); int rank, rank0 = -1, rank1 = 0; @@ -452,7 +452,7 @@ unlock: } static void -outheader() +outheader(void) { char linebuf[BUFSZ]; char *bp; @@ -578,7 +578,7 @@ ordin(int n) } void -clearlocks() +clearlocks(void) { int x; diff --git a/games/hack/hack.engrave.c b/games/hack/hack.engrave.c index fe64b7d5ce7..f48c871ce90 100644 --- a/games/hack/hack.engrave.c +++ b/games/hack/hack.engrave.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.engrave.c,v 1.7 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.engrave.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdlib.h> -#include "hack.h" +#include <stdlib.h> + +#include "hack.h" extern char *nomovemsg; extern char nul[]; @@ -195,7 +196,7 @@ make_engr_at(int x, int y, char *s) } int -doengrave() +doengrave(void) { int len; char *sp; diff --git a/games/hack/hack.fight.c b/games/hack/hack.fight.c index 1fe6976dabd..c06c36b431a 100644 --- a/games/hack/hack.fight.c +++ b/games/hack/hack.fight.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.fight.c,v 1.9 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.fight.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include "hack.h" +#include <stdio.h> + +#include "hack.h" + extern struct permonst li_dog, dog, la_dog; static boolean far_noise; diff --git a/games/hack/hack.h b/games/hack/hack.h index c72c011dadb..4fa5eafc297 100644 --- a/games/hack/hack.h +++ b/games/hack/hack.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.h,v 1.12 2015/12/26 00:26:39 mestre Exp $*/ +/* $OpenBSD: hack.h,v 1.13 2016/01/09 18:33:15 mestre Exp $*/ /* $NetBSD: hack.h,v 1.3 1995/03/23 08:30:21 cgd Exp $*/ /* @@ -62,39 +62,40 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" -#include <string.h> #include <fcntl.h> #include <stdarg.h> +#include <string.h> #define Null(type) ((struct type *) 0) -#include "def.objclass.h" +#include "config.h" +#include "def.objclass.h" typedef struct { xchar x,y; } coord; -#include "def.mkroom.h" -#include "def.monst.h" /* uses coord */ -#include "def.gold.h" -#include "def.trap.h" -#include "def.obj.h" -#include "def.flag.h" -#include "def.wseg.h" +#include "def.mkroom.h" +#include "def.monst.h" /* uses coord */ +#include "def.gold.h" +#include "def.trap.h" +#include "def.obj.h" +#include "def.flag.h" +#include "def.wseg.h" #define plur(x) (((x) == 1) ? "" : "s") #define BUFSZ 256 /* for getlin buffers */ #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */ -#include "def.rm.h" -#include "def.permonst.h" +#include "def.rm.h" +#include "def.permonst.h" extern xchar xdnstair, ydnstair, xupstair, yupstair; /* stairs up and down. */ extern xchar dlevel; #define newstring(x) (char *) alloc((unsigned)(x)) + #include "hack.onames.h" #define ON 1 diff --git a/games/hack/hack.invent.c b/games/hack/hack.invent.c index 5c6c8aa342b..b5a4a564ae2 100644 --- a/games/hack/hack.invent.c +++ b/games/hack/hack.invent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.invent.c,v 1.12 2015/10/24 17:37:56 mmcc Exp $ */ +/* $OpenBSD: hack.invent.c,v 1.13 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,10 +61,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <ctype.h> -#include <stdlib.h> -#include <stdio.h> -#include "hack.h" +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> + +#include "hack.h" extern struct obj zeroobj; extern char morc; @@ -664,7 +665,7 @@ xprname(struct obj *obj, char let) } int -ddoinv() +ddoinv(void) { doinv((char *) 0); return(0); @@ -702,7 +703,7 @@ doinv(char *lets) } int -dotypeinv() /* free after Robert Viduya */ +dotypeinv(void) /* free after Robert Viduya */ /* Changed to one type only, so he doesn't have to type cr */ { char c, ilet; @@ -775,7 +776,7 @@ dotypeinv() /* free after Robert Viduya */ /* look at what is here */ int -dolook() +dolook(void) { struct obj *otmp, *otmp0; struct gold *gold; @@ -874,7 +875,7 @@ extern char *occtxt; static long goldcounted; int -countgold() +countgold(void) { if((goldcounted += 100*(u.ulevel + 1)) >= u.ugold) { long eps = 0; @@ -887,7 +888,7 @@ countgold() } int -doprgold() +doprgold(void) { if(!u.ugold) pline("You do not carry any gold."); @@ -905,7 +906,7 @@ doprgold() /* --- end of gold counting section --- */ int -doprwep() +doprwep(void) { if(!uwep) pline("You are empty handed."); else prinv(uwep); @@ -913,7 +914,7 @@ doprwep() } int -doprarm() +doprarm(void) { if(!uarm && !uarmg && !uarms && !uarmh) pline("You are not wearing any armor."); @@ -933,7 +934,7 @@ doprarm() } int -doprring() +doprring(void) { if(!uleft && !uright) pline("You are not wearing any rings."); diff --git a/games/hack/hack.ioctl.c b/games/hack/hack.ioctl.c index d675750082e..6c69a5d191c 100644 --- a/games/hack/hack.ioctl.c +++ b/games/hack/hack.ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.ioctl.c,v 1.8 2015/12/05 13:37:43 tb Exp $ */ +/* $OpenBSD: hack.ioctl.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -66,18 +66,19 @@ define the same constants, and the C preprocessor complains. */ #include <stdio.h> #include <termios.h> -#include "config.h" + #include "hack.h" + struct termios termios; void -getioctls() +getioctls(void) { (void) tcgetattr(fileno(stdin), &termios); } void -setioctls() +setioctls(void) { (void) tcsetattr(fileno(stdin), TCSADRAIN, &termios); } @@ -85,7 +86,7 @@ setioctls() #ifdef SUSPEND #include <signal.h> int -dosuspend() +dosuspend(void) { #ifdef SIGTSTP if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) { diff --git a/games/hack/hack.lev.c b/games/hack/hack.lev.c index 170f9b2df2f..d2796bfaa7b 100644 --- a/games/hack/hack.lev.c +++ b/games/hack/hack.lev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.lev.c,v 1.9 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.lev.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> #include <stdlib.h> #include <unistd.h> + #include "hack.h" extern struct obj *billobjs; @@ -322,7 +322,7 @@ mread(int fd, char *buf, unsigned len) } void -mklev() +mklev(void) { extern boolean in_mklev; diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c index 5d2ce344734..b9d81efd9cc 100644 --- a/games/hack/hack.main.c +++ b/games/hack/hack.main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.main.c,v 1.20 2016/01/07 16:00:32 tb Exp $ */ +/* $OpenBSD: hack.main.c,v 1.21 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,13 +61,13 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/types.h> #include <sys/stat.h> -#include <stdlib.h> + #include <stdio.h> -#include <stdarg.h> +#include <stdlib.h> #include <signal.h> #include <unistd.h> + #include "hack.h" #ifdef QUEST @@ -476,7 +476,7 @@ glo(int foo) * It may still contain a suffix denoting pl_character. */ void -askname() +askname(void) { int c,ct; @@ -555,7 +555,7 @@ chdirx(char *dir, boolean wr) #endif void -stop_occupation() +stop_occupation(void) { if(occupation) { pline("You stop %s.", occtxt); diff --git a/games/hack/hack.makemon.c b/games/hack/hack.makemon.c index c97cf179eca..e607b6d545b 100644 --- a/games/hack/hack.makemon.c +++ b/games/hack/hack.makemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.makemon.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.makemon.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,7 +61,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" +#include "hack.h" + extern char fut_geno[]; extern struct obj *mkobj_at(); struct monst zeromonst; diff --git a/games/hack/hack.mhitu.c b/games/hack/hack.mhitu.c index e4c4c744013..2913ac20465 100644 --- a/games/hack/hack.mhitu.c +++ b/games/hack/hack.mhitu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.mhitu.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.mhitu.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" -extern struct monst *makemon(); +#include "hack.h" + +extern struct monst *makemon(struct permonst *, int, int); /* * mhitu: monster hits you diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c index 8d673e0cb29..18e3cdfa939 100644 --- a/games/hack/hack.mklev.c +++ b/games/hack/hack.mklev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.mklev.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.mklev.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <stdio.h> #include <stdlib.h> -#include <unistd.h> + #include "hack.h" #define somex() ((random()%(croom->hx-croom->lx+1))+croom->lx) @@ -105,7 +105,7 @@ static void makevtele(void); static void makeniche(boolean); void -makelevel() +makelevel(void) { struct mkroom *croom, *troom; unsigned tryct; @@ -209,7 +209,7 @@ makelevel() } int -makerooms() +makerooms(void) { struct rectangle *rsp; int lx, ly, hx, hy, lowx, lowy, hix, hiy, dx, dy; @@ -512,7 +512,7 @@ chk: } static void -makecorridors() +makecorridors(void) { int a,b; @@ -677,14 +677,14 @@ join(int a, int b) } static void -make_niches() +make_niches(void) { int ct = rnd(nroom/2 + 1); while(ct--) makeniche(FALSE); } static void -makevtele() +makevtele(void) { makeniche(TRUE); } diff --git a/games/hack/hack.mkmaze.c b/games/hack/hack.mkmaze.c index c2631c1bae5..815fd623dae 100644 --- a/games/hack/hack.mkmaze.c +++ b/games/hack/hack.mkmaze.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.mkmaze.c,v 1.5 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.mkmaze.c,v 1.6 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,6 +62,7 @@ */ #include "hack.h" + extern struct permonst pm_wizard; struct permonst hell_hound = { "hell hound", 'd', 12, 14, 2, 3, 6, 0 }; @@ -72,7 +73,7 @@ static int okay(int, int, int); void -makemaz() +makemaz(void) { int x,y; int zx,zy; @@ -191,7 +192,7 @@ okay(int x, int y, int dir) } coord -mazexy() +mazexy(void) { coord mm; diff --git a/games/hack/hack.mkshop.c b/games/hack/hack.mkshop.c index 165e32330b0..9eb5c082f8e 100644 --- a/games/hack/hack.mkshop.c +++ b/games/hack/hack.mkshop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.mkshop.c,v 1.8 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.mkshop.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -65,9 +65,10 @@ #ifndef QUEST #include "hack.h" #include "def.eshk.h" + #define ESHK ((struct eshk *)(&(shk->mextra[0]))) -extern struct monst *makemon(); -extern struct obj *mkobj_at(); +extern struct monst *makemon(struct permonst *, int, int); +extern struct obj *mkobj_at(int, int, int); extern int nroom; extern char shtypes[]; /* = "=/)%?!["; 8 types: 7 specialized, 1 mixed */ schar shprobs[] = { 3,3,5,5,10,10,14,50 }; /* their probabilities */ @@ -80,7 +81,7 @@ static int dist2(int, int, int, int); static int sq(int); void -mkshop() +mkshop(void) { struct mkroom *sroom; int sh,sx,sy,i = -1; @@ -262,7 +263,7 @@ mkzoo(int type) } struct permonst * -morguemon() +morguemon(void) { extern struct permonst pm_ghost; int i = rn2(100), hd = rn2(dlevel); @@ -273,7 +274,7 @@ morguemon() } void -mkswamp() /* Michiel Huisjes & Fred de Wilde */ +mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ { struct mkroom *sroom; int sx,sy,i,eelct = 0; diff --git a/games/hack/hack.mon.c b/games/hack/hack.mon.c index 12d1aab6e28..f4486873b71 100644 --- a/games/hack/hack.mon.c +++ b/games/hack/hack.mon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.mon.c,v 1.10 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.mon.c,v 1.11 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,6 +62,7 @@ */ #include <stdlib.h> + #include "hack.h" #include "hack.mfndpos.h" @@ -79,7 +80,7 @@ static void dmonsfree(void); static int ishuman(struct monst *); void -movemon() +movemon(void) { struct monst *mtmp; int fr; @@ -698,7 +699,7 @@ monfree(struct monst *mtmp) } static void -dmonsfree() +dmonsfree(void) { struct monst *mtmp; @@ -838,7 +839,7 @@ kludge(char *str, char *arg) } void -rescham() /* force all chameleons to become normal */ +rescham(void) /* force all chameleons to become normal */ { struct monst *mtmp; diff --git a/games/hack/hack.monst.c b/games/hack/hack.monst.c index d9dd0857607..b3e433b26c4 100644 --- a/games/hack/hack.monst.c +++ b/games/hack/hack.monst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.monst.c,v 1.6 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.monst.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,6 +63,7 @@ #include "hack.h" #include "def.eshk.h" + extern char plname[PL_NSIZ]; struct permonst mons[CMNUM+2] = { diff --git a/games/hack/hack.o_init.c b/games/hack/hack.o_init.c index 814576f10be..3e31aa93549 100644 --- a/games/hack/hack.o_init.c +++ b/games/hack/hack.o_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.o_init.c,v 1.6 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.o_init.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,11 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include <string.h> -#include "config.h" /* for typedefs */ -#include "hack.h" -#include "def.objects.h" +#include <stdio.h> + +#include "hack.h" +#include "def.objects.h" static void setgemprobs(void); static int interesting_to_discover(int); @@ -82,7 +81,7 @@ letindex(char let) } void -init_objects() +init_objects(void) { int i, j, first, last, sum, end; char let, *tmp; @@ -144,7 +143,7 @@ probtype(char let) } static void -setgemprobs() +setgemprobs(void) { int j,first; extern xchar dlevel; @@ -164,7 +163,7 @@ setgemprobs() } void -oinit() /* level dependent initialization */ +oinit(void) /* level dependent initialization */ { setgemprobs(); } @@ -205,7 +204,7 @@ restnames(int fd) } int -dodiscovered() /* free after Robert Viduya */ +dodiscovered(void) /* free after Robert Viduya */ { int i, end; int ct = 0; diff --git a/games/hack/hack.objnam.c b/games/hack/hack.objnam.c index d336eca0323..a6e19dceef1 100644 --- a/games/hack/hack.objnam.c +++ b/games/hack/hack.objnam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.objnam.c,v 1.10 2015/10/24 18:49:39 mmcc Exp $ */ +/* $OpenBSD: hack.objnam.c,v 1.11 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,10 +61,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include "hack.h" +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> + +#include "hack.h" + #define PREFIX 15 extern int bases[]; diff --git a/games/hack/hack.options.c b/games/hack/hack.options.c index 2134589313b..27a527a3113 100644 --- a/games/hack/hack.options.c +++ b/games/hack/hack.options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.options.c,v 1.11 2015/10/24 17:56:42 mmcc Exp $ */ +/* $OpenBSD: hack.options.c,v 1.12 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -64,13 +64,13 @@ #include <ctype.h> #include <stdio.h> #include <stdlib.h> -#include "config.h" + #include "hack.h" static void parseoptions(char *, boolean); void -initoptions() +initoptions(void) { char *opts; @@ -236,7 +236,7 @@ bad: } int -doset() +doset(void) { char buf[BUFSZ]; diff --git a/games/hack/hack.pager.c b/games/hack/hack.pager.c index 61d382c92ab..1a2789268a4 100644 --- a/games/hack/hack.pager.c +++ b/games/hack/hack.pager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.pager.c,v 1.21 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.pager.c,v 1.22 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -65,13 +65,14 @@ /* Also readmail() and doshell(), and generally the things that contact the outside world. */ -#include <sys/types.h> -#include <libgen.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> +#include <libgen.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + #include "hack.h" + extern int CO, LI; /* usually COLNO and ROWNO+2 */ extern char *CD; extern char quitchars[]; @@ -79,7 +80,7 @@ extern char quitchars[]; static void page_more(FILE *, int); int -dowhatis() +dowhatis(void) { FILE *fp; char bufr[BUFSZ+6]; @@ -163,14 +164,14 @@ static boolean whole_screen = TRUE; #define PAGMIN 12 /* minimum # of lines for page below level map */ void -set_whole_screen() +set_whole_screen(void) { /* called in termcap as soon as LI is known */ whole_screen = (LI-ROWNO-2 <= PAGMIN || !CD); } #ifdef NEWS int -readnews() +readnews(void) { int ret; @@ -346,7 +347,7 @@ cleanup: } int -dohelp() +dohelp(void) { char c; @@ -410,7 +411,7 @@ page_file(char *fnam, boolean silent) #ifdef UNIX #ifdef SHELL int -dosh() +dosh(void) { char *str; @@ -426,7 +427,7 @@ dosh() } #endif /* SHELL */ -#include <sys/wait.h> +#include <sys/wait.h> int child(int wt) diff --git a/games/hack/hack.potion.c b/games/hack/hack.potion.c index 8238c02a1c3..0592dc5e2a9 100644 --- a/games/hack/hack.potion.c +++ b/games/hack/hack.potion.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.potion.c,v 1.6 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.potion.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,14 +62,15 @@ */ #include "hack.h" + extern char *nomovemsg; extern struct monst youmonst; -extern struct monst *makemon(); +extern struct monst *makemon(struct permonst *, int, int); static void ghost_from_bottle(void); int -dodrink() +dodrink(void) { struct obj *otmp,*objs; struct monst *mtmp; @@ -252,7 +253,7 @@ use_it: } void -pluslvl() +pluslvl(void) { int num; @@ -413,7 +414,7 @@ potionbreathe(struct obj *obj) * -- become a jug? Etc. */ int -dodip() +dodip(void) { struct obj *potion, *obj; @@ -433,7 +434,7 @@ dodip() } static void -ghost_from_bottle() +ghost_from_bottle(void) { extern struct permonst pm_ghost; struct monst *mtmp; diff --git a/games/hack/hack.pri.c b/games/hack/hack.pri.c index 7bb633c0ca2..3dab8b132d2 100644 --- a/games/hack/hack.pri.c +++ b/games/hack/hack.pri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.pri.c,v 1.12 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.pri.c,v 1.13 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -64,7 +64,7 @@ #include <curses.h> #include <stdio.h> #include <stdlib.h> -#include <stdarg.h> + #include "hack.h" xchar scrlx, scrhx, scrly, scrhy; /* corners of new area on screen */ @@ -75,7 +75,7 @@ extern char *CD; static void cornbot(int); void -swallowed() +swallowed(void) { char ulook[] = "|@|"; ulook[1] = u.usym; @@ -221,7 +221,7 @@ Tmp_at(schar x, schar y) } void -setclipped() +setclipped(void) { error("Hack needs a screen of size at least %d by %d.\n", ROWNO+2, COLNO); @@ -245,20 +245,20 @@ at(xchar x, xchar y, char ch) } void -prme() +prme(void) { if(!Invisible) at(u.ux,u.uy,u.usym); } int -doredraw() +doredraw(void) { docrt(); return(0); } void -docrt() +docrt(void) { int x,y; struct rm *room; @@ -340,13 +340,13 @@ docorner(int xmin, int ymax) } void -curs_on_u() +curs_on_u(void) { curs(u.ux, u.uy+2); } void -pru() +pru(void) { if(u.udispl && (Invisible || u.udisx != u.ux || u.udisy != u.uy)) /* if(! levl[u.udisx][u.udisy].new) */ @@ -571,7 +571,7 @@ unpobj(struct obj *obj) } void -seeobjs() +seeobjs(void) { struct obj *obj, *obj2; @@ -590,7 +590,7 @@ seeobjs() } void -seemons() +seemons(void) { struct monst *mtmp; @@ -635,7 +635,7 @@ unpmon(struct monst *mon) } void -nscr() +nscr(void) { int x,y; struct rm *room; @@ -666,7 +666,7 @@ cornbot(int lth) } void -bot() +bot(void) { char *ob = oldbot, *nb = newbot, *bp; int i; @@ -737,7 +737,7 @@ mstatusline(mtmp) struct monst *mtmp; { #endif /* WAN_PROBING */ void -cls() +cls(void) { if(flags.toplin == 1) more(); diff --git a/games/hack/hack.read.c b/games/hack/hack.read.c index bdda6e31a70..cd09bf022d5 100644 --- a/games/hack/hack.read.c +++ b/games/hack/hack.read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.read.c,v 1.8 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.read.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,12 +62,13 @@ */ #include <stdlib.h> + #include "hack.h" static boolean monstersym(char); int -doread() +doread(void) { struct obj *scroll; boolean confused = (Confusion != 0); diff --git a/games/hack/hack.rip.c b/games/hack/hack.rip.c index 454b70ddfc8..546888bbfd6 100644 --- a/games/hack/hack.rip.c +++ b/games/hack/hack.rip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.rip.c,v 1.8 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.rip.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,6 +62,7 @@ */ #include <stdio.h> + #include "hack.h" extern char plname[]; @@ -83,7 +84,7 @@ static const char ripbot[] = "\ static void center(int, char *); void -outrip() +outrip(void) { char buf[BUFSZ]; diff --git a/games/hack/hack.rumors.c b/games/hack/hack.rumors.c index c73e6f9897e..8713d71d58f 100644 --- a/games/hack/hack.rumors.c +++ b/games/hack/hack.rumors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.rumors.c,v 1.8 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.rumors.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,8 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include "hack.h" /* for RUMORFILE and BSD (index) */ +#include <stdio.h> + +#include "hack.h" /* for RUMORFILE and BSD (index) */ + #define CHARSZ 8 /* number of bits in a char */ int n_rumors = 0; int n_used_rumors = -1; @@ -109,7 +111,7 @@ outline(FILE *rumf) } void -outrumor() +outrumor(void) { int rn,i; FILE *rumf; diff --git a/games/hack/hack.save.c b/games/hack/hack.save.c index 481cecede80..900196f9c5a 100644 --- a/games/hack/hack.save.c +++ b/games/hack/hack.save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.save.c,v 1.12 2015/11/11 01:12:10 deraadt Exp $ */ +/* $OpenBSD: hack.save.c,v 1.13 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,10 +61,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <signal.h> #include <stdio.h> #include <stdlib.h> -#include <signal.h> #include <unistd.h> + #include "hack.h" extern char genocided[60]; /* defined in Decl.c */ @@ -75,7 +76,7 @@ extern char pl_character[PL_CSIZ]; static int dosave0(int); int -dosave() +dosave(void) { if(dosave0(0)) { settty("Be seeing you ...\n"); diff --git a/games/hack/hack.search.c b/games/hack/hack.search.c index 3a1d865d126..899a2623ade 100644 --- a/games/hack/hack.search.c +++ b/games/hack/hack.search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.search.c,v 1.5 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.search.c,v 1.6 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,8 +63,9 @@ #include "hack.h" +/* returns number of things found */ int -findit() /* returns number of things found */ +findit(void) { int num; xchar zx,zy; @@ -108,7 +109,7 @@ findit() /* returns number of things found */ } int -dosearch() +dosearch(void) { xchar x,y; struct trap *trap; @@ -158,7 +159,7 @@ dosearch() } int -doidtrap() +doidtrap(void) { struct trap *trap; int x,y; diff --git a/games/hack/hack.shk.c b/games/hack/hack.shk.c index 25d555441b7..91586debb60 100644 --- a/games/hack/hack.shk.c +++ b/games/hack/hack.shk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.shk.c,v 1.12 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.shk.c,v 1.13 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,6 +63,7 @@ #include <stdio.h> #include <stdlib.h> + #include "hack.h" #ifdef QUEST @@ -77,7 +78,7 @@ obfree(struct obj *obj, struct obj *merge) } int -inshop() +inshop(void) { return(0); } @@ -99,13 +100,13 @@ splitbill(struct obj *ign, struct obj *ign2) {} int -dopay() +dopay(void) { return(0); } void -paybill() +paybill(void) {} int @@ -141,8 +142,8 @@ shkname(struct monst *ign) } #else /* QUEST */ -#include "hack.mfndpos.h" -#include "def.eshk.h" +#include "hack.mfndpos.h" +#include "def.eshk.h" #define ESHK(mon) ((struct eshk *)(&(mon->mextra[0]))) #define NOTANGRY(mon) mon->mpeaceful @@ -186,7 +187,7 @@ static void pay(long, struct monst *); static int dopayobj(struct bill_x *); static struct obj *bp_to_obj(struct bill_x *); static int getprice(struct obj *); -static int realhunger(); +static int realhunger(void); /* called in do_name.c */ char * @@ -221,7 +222,7 @@ replshk(struct monst *mtmp, struct monst *mtmp2) /* caller has checked that shopkeeper exists */ /* either we paid or left the shop or he just died */ static void -setpaid() +setpaid(void) { struct obj *obj; struct monst *mtmp; @@ -248,7 +249,7 @@ setpaid() /* delivers result in total */ /* caller has checked that shopkeeper exists */ static void -addupbill() +addupbill(void) { int ct = ESHK(shopkeeper)->billct; struct bill_x *bp = bill; @@ -261,7 +262,7 @@ addupbill() } int -inshop() +inshop(void) { int roomno = inroom(u.ux,u.uy); @@ -441,7 +442,7 @@ pay(long tmp, struct monst *shkp) } int -dopay() +dopay(void) { long ltmp; struct bill_x *bp; @@ -605,7 +606,7 @@ dopayobj(struct bill_x *bp) /* routine called after dying (or quitting) with nonempty bill */ void -paybill() +paybill(void) { if(shlevel == dlevel && shopkeeper && ESHK(shopkeeper)->billct){ addupbill(); @@ -769,9 +770,9 @@ pline("Thank you for your contribution to restock this recently plundered shop." plur(ltmp)); } +/* int mode; 0: deliver count 1: paged */ int doinvbill(int mode) -/* int mode; 0: deliver count 1: paged */ { struct bill_x *bp; struct obj *obj; @@ -895,7 +896,7 @@ getprice(struct obj *obj) /* not completely foolproof */ static int -realhunger() +realhunger(void) { int tmp = u.uhunger; struct obj *otmp = invent; diff --git a/games/hack/hack.steal.c b/games/hack/hack.steal.c index 1d9c979dca8..1f5c361f728 100644 --- a/games/hack/hack.steal.c +++ b/games/hack/hack.steal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.steal.c,v 1.6 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.steal.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,13 +62,14 @@ */ #include <stdlib.h> + #include "hack.h" extern void (*afternmv)(void); /* actually returns something that fits in an int */ long -somegold() +somegold(void) { return( (u.ugold < 100) ? u.ugold : (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) ); @@ -105,7 +106,7 @@ static unsigned stealoid; /* object to be stolen */ static unsigned stealmid; /* monster doing the stealing */ void -stealarm() +stealarm(void) { struct monst *mtmp; struct obj *otmp; diff --git a/games/hack/hack.termcap.c b/games/hack/hack.termcap.c index 2674be3e5fc..fe61f3bae46 100644 --- a/games/hack/hack.termcap.c +++ b/games/hack/hack.termcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.termcap.c,v 1.8 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.termcap.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,14 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <termios.h> #include <curses.h> +#include <stdlib.h> #include <term.h> -#include "config.h" /* for ROWNO and COLNO */ #include "hack.h" static char tbuf[512]; @@ -85,7 +81,7 @@ static int xputc(int); static void xputs(char *); void -startup() +startup(void) { char *term; char *tptr; @@ -144,14 +140,14 @@ startup() } void -start_screen() +start_screen(void) { xputs(TI); xputs(VS); } void -end_screen() +end_screen(void) { xputs(VE); xputs(TE); @@ -160,10 +156,11 @@ end_screen() /* Cursor movements */ extern xchar curx, cury; +/* int x, y; not xchar: perhaps xchar is unsigned and + * curx-x would be unsigned as well + */ void curs(int x, int y) -/* int x, y; not xchar: perhaps xchar is unsigned and - curx-x would be unsigned as well */ { if (y == cury && x == curx) return; @@ -250,7 +247,7 @@ xputs(char *s) } void -cl_end() +cl_end(void) { if(CE) xputs(CE); @@ -268,14 +265,14 @@ cl_end() } void -clr_screen() +clr_screen(void) { xputs(CL); curx = cury = 1; } void -home() +home(void) { if(HO) xputs(HO); @@ -287,34 +284,37 @@ home() } void -standoutbeg() +standoutbeg(void) { if(SO) xputs(SO); } void -standoutend() +standoutend(void) { if(SE) xputs(SE); } void -backsp() +backsp(void) { xputs(BC); curx--; } void -hackbell() +hackbell(void) { (void) putchar('\007'); /* curx does not change */ (void) fflush(stdout); } +/* free after Robert Viduya + * must only be called with curx = 1 + */ void -cl_eos() /* free after Robert Viduya */ -{ /* must only be called with curx = 1 */ +cl_eos(void) +{ if(CD) xputs(CD); diff --git a/games/hack/hack.timeout.c b/games/hack/hack.timeout.c index e456c999ad3..9383bf9161f 100644 --- a/games/hack/hack.timeout.c +++ b/games/hack/hack.timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.timeout.c,v 1.6 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.timeout.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,12 +61,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" +#include "hack.h" static void stoned_dialogue(void); void -hacktimeout() +hacktimeout(void) { struct prop *upp; @@ -115,7 +115,7 @@ char *stoned_texts[] = { }; static void -stoned_dialogue() +stoned_dialogue(void) { long i = (Stoned & TIMEOUT); diff --git a/games/hack/hack.topl.c b/games/hack/hack.topl.c index 541ed1680ad..9d0092f7862 100644 --- a/games/hack/hack.topl.c +++ b/games/hack/hack.topl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.topl.c,v 1.11 2015/09/27 05:13:11 guenther Exp $ */ +/* $OpenBSD: hack.topl.c,v 1.12 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,8 +62,8 @@ */ #include <stdio.h> -#include <stdarg.h> #include <stdlib.h> + #include "hack.h" extern int CO; @@ -82,7 +82,7 @@ static void xmore(char *); int -doredotopl() +doredotopl(void) { if(last_redone_topl) last_redone_topl = last_redone_topl->next_topl; @@ -96,7 +96,7 @@ doredotopl() } static void -redotoplin() +redotoplin(void) { home(); if(strchr(toplines, '\n')) cl_end(); @@ -110,7 +110,7 @@ redotoplin() } void -remember_topl() +remember_topl(void) { struct topl *tl; int cnt = OTLMAX; @@ -173,7 +173,7 @@ xmore(char *s) } void -more() +more(void) { xmore(""); } @@ -185,7 +185,7 @@ cmore(char *s) } void -clrlin() +clrlin(void) { if(flags.toplin) { home(); diff --git a/games/hack/hack.track.c b/games/hack/hack.track.c index 57f9284a15a..a43ad10e0a6 100644 --- a/games/hack/hack.track.c +++ b/games/hack/hack.track.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.track.c,v 1.5 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.track.c,v 1.6 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -70,14 +70,14 @@ int utcnt = 0; int utpnt = 0; void -initrack() +initrack(void) { utcnt = utpnt = 0; } /* add to track */ void -settrack() +settrack(void) { if(utcnt < UTSZ) utcnt++; if(utpnt == UTSZ) utpnt = 0; diff --git a/games/hack/hack.trap.c b/games/hack/hack.trap.c index 234055e336c..42d53c5f046 100644 --- a/games/hack/hack.trap.c +++ b/games/hack/hack.trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.trap.c,v 1.8 2015/10/24 18:49:39 mmcc Exp $ */ +/* $OpenBSD: hack.trap.c,v 1.9 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,9 +61,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <ctype.h> -#include <stdlib.h> -#include "hack.h" +#include <ctype.h> +#include <stdlib.h> + +#include "hack.h" char vowels[] = "aeiou"; @@ -304,7 +305,7 @@ selftouch(char *arg) } void -float_up() +float_up(void) { if(u.utrap) { if(u.utraptype == TT_PIT) { @@ -318,7 +319,7 @@ float_up() } int -float_down() +float_down(void) { struct trap *trap; @@ -338,7 +339,7 @@ float_down() } static void -vtele() +vtele(void) { struct mkroom *croom; @@ -357,7 +358,7 @@ vtele() } void -tele() +tele(void) { coord cc; int nux,nuy; @@ -413,7 +414,7 @@ teleok(int x, int y) } int -dotele() +dotele(void) { extern char pl_character[]; @@ -455,7 +456,7 @@ placebc(int attach) } void -unplacebc() +unplacebc(void) { if(!carried(uball)){ freeobj(uball); @@ -466,7 +467,7 @@ unplacebc() } void -level_tele() +level_tele(void) { int newlevel; @@ -519,7 +520,7 @@ level_tele() } void -drown() +drown(void) { pline("You fall into a pool!"); pline("You can't swim!"); diff --git a/games/hack/hack.tty.c b/games/hack/hack.tty.c index a3e8641e7e5..321e978ce40 100644 --- a/games/hack/hack.tty.c +++ b/games/hack/hack.tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.tty.c,v 1.14 2016/01/07 18:25:52 millert Exp $ */ +/* $OpenBSD: hack.tty.c,v 1.15 2016/01/09 18:33:15 mestre Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -94,17 +94,17 @@ /* With thanks to the people who sent code for SYSV - hpscdi!jon, arnold@ucsf-cgl, wcs@bo95b, cbcephus!pds and others. */ -#include "hack.h" -#include <stdio.h> -#include <stdarg.h> -#include <stdlib.h> -#include <termios.h> +#include <stdio.h> +#include <stdlib.h> +#include <termios.h> + +#include "hack.h" static char erase_char, kill_char; static boolean settty_needed = FALSE; struct termios inittyb, curttyb; -static void setctty(); +static void setctty(void); /* * Get initial state of terminal, @@ -112,7 +112,7 @@ static void setctty(); * Called by startup() in termcap.c and after returning from ! or ^Z */ void -gettty() +gettty(void) { if(tcgetattr(0, &inittyb) < 0) perror("Hack (gettty)"); @@ -145,14 +145,14 @@ settty(char *s) } static void -setctty() +setctty(void) { if(tcsetattr(0, TCSADRAIN, &curttyb) < 0) perror("Hack (setctty)"); } void -setftty() +setftty(void) { int change = 0; flags.cbreak = ON; @@ -245,7 +245,7 @@ getlin(char *bufp) } void -getret() +getret(void) { cgetret(""); } @@ -287,7 +287,7 @@ xwaitforspace(char *s) } char * -parse() +parse(void) { static char inputline[COLNO]; int foo; @@ -318,7 +318,7 @@ parse() } char -readchar() +readchar(void) { int sym; @@ -331,7 +331,7 @@ readchar() } void -end_of_input() +end_of_input(void) { settty("End of input?\n"); clearlocks(); diff --git a/games/hack/hack.u_init.c b/games/hack/hack.u_init.c index a51a269efc8..7ae202ff915 100644 --- a/games/hack/hack.u_init.c +++ b/games/hack/hack.u_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.u_init.c,v 1.10 2015/10/24 17:40:38 mmcc Exp $ */ +/* $OpenBSD: hack.u_init.c,v 1.11 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -64,8 +64,9 @@ #include <ctype.h> #include <stdio.h> #include <stdlib.h> -#include <signal.h> + #include "hack.h" + #define UNDEF_TYP 0 #define UNDEF_SPE '\177' extern char plname[]; @@ -157,7 +158,7 @@ static void wiz_inv(void); #endif void -u_init() +u_init(void) { int i; char exper = 'y', pc; @@ -379,7 +380,7 @@ ini_inv(struct trobj *trop) #ifdef WIZARD static void -wiz_inv() +wiz_inv(void) { struct trobj *trop = &Extra_objs[0]; char *ep = getenv("INVENT"); @@ -408,7 +409,7 @@ wiz_inv() #endif /* WIZARD */ void -plnamesuffix() +plnamesuffix(void) { char *p; diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index f0eef097307..9d4afb2750d 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.unix.c,v 1.16 2015/11/11 01:12:10 deraadt Exp $ */ +/* $OpenBSD: hack.unix.c,v 1.17 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -72,18 +72,17 @@ * - determination of what files are "very old" */ -#include <sys/types.h> /* for time_t and stat */ -#include <sys/stat.h> -#include <sys/time.h> +#include <sys/stat.h> -#include <err.h> -#include <errno.h> -#include <limits.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include "hack.h" +#include <err.h> +#include <errno.h> +#include <limits.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include "hack.h" static struct tm *getlt(void); @@ -94,7 +93,7 @@ static void mdrush(struct monst *, boolean); #endif static struct tm * -getlt() +getlt(void) { time_t date; struct tm *localtime(); @@ -104,13 +103,13 @@ getlt() } int -getyear() +getyear(void) { return(1900 + getlt()->tm_year); } char * -getdate() +getdate(void) { static char datestr[7]; struct tm *lt = getlt(); @@ -120,10 +119,14 @@ getdate() return(datestr); } +/* + * 0-7, with 0: new, 4: full + * moon period: 29.5306 days + * year: 365.2422 days + */ int -phase_of_the_moon() /* 0-7, with 0: new, 4: full */ -{ /* moon period: 29.5306 days */ - /* year: 365.2422 days */ +phase_of_the_moon(void) +{ struct tm *lt = getlt(); int epact, diy, golden; @@ -137,7 +140,7 @@ phase_of_the_moon() /* 0-7, with 0: new, 4: full */ } int -night() +night(void) { int hour = getlt()->tm_hour; @@ -145,7 +148,7 @@ night() } int -midnight() +midnight(void) { return(getlt()->tm_hour == 0); } @@ -232,7 +235,7 @@ veryold(int fd) } void -getlock() +getlock(void) { extern int hackpid, locknum; int i = 0, fd; @@ -260,7 +263,6 @@ getlock() } getret(); error(""); - /*NOTREACHED*/ } regularize(lock); @@ -339,7 +341,7 @@ static char *mailbox; static long laststattime; void -getmailstatus() +getmailstatus(void) { if(!(mailbox = getenv("MAIL"))) return; @@ -354,7 +356,7 @@ getmailstatus() } void -ckmailstatus() +ckmailstatus(void) { if(!mailbox #ifdef MAILCKFREQ @@ -378,7 +380,7 @@ ckmailstatus() } static void -newmail() +newmail(void) { /* produce a scroll of mail */ struct obj *obj; @@ -461,7 +463,7 @@ mdrush(struct monst *md, boolean away) } void -readmail() +readmail(void) { #ifdef DEF_MAILREADER /* This implies that UNIX is defined */ char *mr = 0; diff --git a/games/hack/hack.vault.c b/games/hack/hack.vault.c index d37b2c7fa4c..daf31240e1b 100644 --- a/games/hack/hack.vault.c +++ b/games/hack/hack.vault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.vault.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.vault.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,21 +61,23 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <stdlib.h> -#include "hack.h" +#include <stdlib.h> + +#include "hack.h" + #ifdef QUEST void -setgd() +setgd(void) {} int -gd_move() +gd_move(void) { return(2); } void -gddead() +gddead(void) {} void @@ -83,13 +85,11 @@ replgd(struct monst *mtmp, struct monst *mtmp2) {} void -invault() +invault(void) {} #else - - -extern struct monst *makemon(); +extern struct monst *makemon(struct permonst *, int, int); #define FCSIZ (ROWNO+COLNO) struct fakecorridor { xchar fx,fy,ftyp; @@ -114,7 +114,7 @@ static int goldincorridor(void); static void -restfakecorr() +restfakecorr(void) { int fcx,fcy,fcbeg; struct rm *crm; @@ -137,7 +137,7 @@ restfakecorr() } static int -goldincorridor() +goldincorridor(void) { int fci; @@ -148,7 +148,7 @@ goldincorridor() } void -setgd() +setgd(void) { struct monst *mtmp; @@ -161,7 +161,7 @@ setgd() } void -invault() +invault(void) { int tmp = inroom(u.ux, u.uy); @@ -248,7 +248,7 @@ fnd: } int -gd_move() +gd_move(void) { int x,y,dx,dy,gx,gy,nx,ny,typ; struct fakecorridor *fcp; @@ -335,7 +335,7 @@ newpos: } void -gddead() +gddead(void) { guard = 0; } diff --git a/games/hack/hack.version.c b/games/hack/hack.version.c index 90dbc07faba..fa26722abad 100644 --- a/games/hack/hack.version.c +++ b/games/hack/hack.version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.version.c,v 1.6 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.version.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,11 +61,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "date.h" -#include "hack.h" +#include "date.h" +#include "hack.h" int -doversion() +doversion(void) { pline("%s 1.0.3 - last edit %s.", ( #ifdef QUEST diff --git a/games/hack/hack.wield.c b/games/hack/hack.wield.c index ecbadf1bb13..0da35e5b25f 100644 --- a/games/hack/hack.wield.c +++ b/games/hack/hack.wield.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.wield.c,v 1.6 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.wield.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -61,7 +61,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hack.h" +#include "hack.h" + extern struct obj zeroobj; void @@ -71,7 +72,7 @@ setuwep(struct obj *obj) } int -dowield() +dowield(void) { struct obj *wep; int res = 0; @@ -108,7 +109,7 @@ dowield() } void -corrode_weapon() +corrode_weapon(void) { if(!uwep || uwep->olet != WEAPON_SYM) return; /* %% */ if(uwep->rustfree) diff --git a/games/hack/hack.wizard.c b/games/hack/hack.wizard.c index 36cf021782a..283440dcefd 100644 --- a/games/hack/hack.wizard.c +++ b/games/hack/hack.wizard.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.wizard.c,v 1.6 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.wizard.c,v 1.7 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -64,7 +64,9 @@ /* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */ #include <stdlib.h> + #include "hack.h" + extern struct permonst pm_wizard; static void clonewiz(struct monst *); @@ -76,7 +78,7 @@ char wizapp[] = "@DNPTUVXcemntx"; /* If he has found the Amulet, make the wizard appear after some time */ void -amulet() +amulet(void) { struct obj *otmp; struct monst *mtmp; @@ -229,7 +231,7 @@ inrange(struct monst *mtmp) } void -aggravate() +aggravate(void) { struct monst *mtmp; diff --git a/games/hack/hack.worm.c b/games/hack/hack.worm.c index 79130d66947..ed9f847f17d 100644 --- a/games/hack/hack.worm.c +++ b/games/hack/hack.worm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.worm.c,v 1.7 2014/03/11 08:05:15 guenther Exp $ */ +/* $OpenBSD: hack.worm.c,v 1.8 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,7 +62,9 @@ */ #include <stdlib.h> + #include "hack.h" + #ifndef NOWORM struct wseg *wsegs[32]; /* linked list, tail first */ struct wseg *wheads[32]; diff --git a/games/hack/hack.zap.c b/games/hack/hack.zap.c index 445150a7ce4..ccc37171020 100644 --- a/games/hack/hack.zap.c +++ b/games/hack/hack.zap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.zap.c,v 1.10 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.zap.c,v 1.11 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,6 +62,7 @@ */ #include <stdlib.h> + #include "hack.h" extern struct monst youmonst; @@ -184,7 +185,7 @@ bhito(struct obj *obj, struct obj *otmp) } int -dozap() +dozap(void) { struct obj *obj; xchar zx,zy; @@ -694,7 +695,7 @@ fracture_rock(struct obj *obj) } static void -burn_scrolls() +burn_scrolls(void) { struct obj *obj, *obj2; int cnt = 0; diff --git a/games/hack/makedefs.c b/games/hack/makedefs.c index 1a80ab91448..bd7c1e72521 100644 --- a/games/hack/makedefs.c +++ b/games/hack/makedefs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makedefs.c,v 1.9 2016/01/07 16:00:32 tb Exp $ */ +/* $OpenBSD: makedefs.c,v 1.10 2016/01/09 18:33:15 mestre Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -133,7 +133,7 @@ char line[LINSZ], *lp = line, *lp0 = line, *lpe = line; int eof; void -readline() +readline(void) { int n = read(fd, lp0, (line+LINSZ)-lp0); @@ -146,7 +146,7 @@ readline() } char -nextchar() +nextchar(void) { if(lp == lpe){ readline(); @@ -191,7 +191,7 @@ loop: } int -getentry() +getentry(void) { int inbraces = 0, inparens = 0, stringseen = 0, commaseen = 0; int prefix = 0; |