From b462731cbc1198051cd39ad2f95b1027e441067d Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 7 Jun 2009 18:30:39 +0000 Subject: ANSIfy function declarations. All object file diffs inspected. --- hack/hack.c | 69 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 30 insertions(+), 39 deletions(-) (limited to 'hack/hack.c') diff --git a/hack/hack.c b/hack/hack.c index 19eaf4c4..72c2ee9c 100644 --- a/hack/hack.c +++ b/hack/hack.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.c,v 1.7 2006/11/24 19:46:58 christos Exp $ */ +/* $NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.c,v 1.7 2006/11/24 19:46:58 christos Exp $"); +__RCSID("$NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $"); #endif /* not lint */ #include "hack.h" @@ -74,7 +74,7 @@ __RCSID("$NetBSD: hack.c,v 1.7 2006/11/24 19:46:58 christos Exp $"); * teleporting 3. when walking out of a lit room */ void -unsee() +unsee(void) { int x, y; struct rm *lev; @@ -110,10 +110,11 @@ unsee() * hack.do.c: seeoff(1) - go up or down the stairs in hack.trap.c:seeoff(1) * - fall through trapdoor */ +/* mode: */ + /* 1 to redo @, 0 to leave them *//* 1 means + * misc movement, 0 means blindness */ void -seeoff(mode) - int mode; /* 1 to redo @, 0 to leave them *//* 1 means - * misc movement, 0 means blindness */ +seeoff(int mode) { int x, y; struct rm *lev; @@ -140,7 +141,7 @@ seeoff(mode) } void -domove() +domove(void) { xchar oldx, oldy; struct monst *mtmp = NULL; @@ -381,9 +382,7 @@ nodrag: ; } void -movobj(obj, ox, oy) - struct obj *obj; - int ox, oy; +movobj(struct obj *obj, int ox, int oy) { /* Some dirty programming to get display right */ freeobj(obj); @@ -395,7 +394,7 @@ movobj(obj, ox, 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."); @@ -559,7 +558,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 = 0, y0 = 0, m0 = 0, i0 = 9; int corrct = 0, noturn = 0; @@ -670,7 +669,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; @@ -690,8 +689,7 @@ monster_nearby() #ifdef QUEST int -cansee(x, y) - xchar x, y; +cansee(xchar x, xchar y) { int dx, dy, adx, ady, sdx, sdy, dmax, d; if (Blind) @@ -735,8 +733,7 @@ cansee(x, y) } int -rroom(x, y) - int x, y; +rroom(int x, int y) { return (IS_ROOM(levl[u.ux + x][u.uy + y].typ)); } @@ -744,8 +741,7 @@ rroom(x, y) #else int -cansee(x, y) - xchar x, y; +cansee(xchar x, xchar y) { if (Blind || u.uswallow) return (0); @@ -759,15 +755,14 @@ cansee(x, y) #endif /* QUEST */ int -sgn(a) - int a; +sgn(int a) { return ((a > 0) ? 1 : (a == 0) ? 0 : -1); } #ifdef QUEST void -setsee() +setsee(void) { int x, y; @@ -785,7 +780,7 @@ setsee() #else void -setsee() +setsee(void) { int x, y; @@ -828,8 +823,7 @@ setsee() #endif /* QUEST */ void -nomul(nval) - int nval; +nomul(int nval) { if (multi < 0) return; @@ -838,7 +832,7 @@ nomul(nval) } int -abon() +abon(void) { if (u.ustr == 3) return (-3); @@ -857,7 +851,7 @@ abon() } int -dbon() +dbon(void) { if (u.ustr < 6) return (-1); @@ -877,9 +871,10 @@ dbon() return (6); } +/* may kill you; cause may be poison or */ +/* monster like 'A' */ void -losestr(num) /* may kill you; cause may be poison or */ - int num; /* monster like 'A' */ +losestr(int num) { u.ustr -= num; while (u.ustr < 3) { @@ -891,9 +886,7 @@ losestr(num) /* may kill you; cause may be poison or */ } void -losehp(n, knam) - int n; - const char *knam; +losehp(int n, const char *knam) { u.uhp -= n; if (u.uhp > u.uhpmax) @@ -906,9 +899,7 @@ losehp(n, knam) } void -losehp_m(n, mtmp) - int n; - struct monst *mtmp; +losehp_m(int n, struct monst *mtmp) { u.uhp -= n; flags.botl = 1; @@ -917,7 +908,7 @@ losehp_m(n, mtmp) } void -losexp() +losexp(void) { /* hit by V or W */ int num; @@ -933,7 +924,7 @@ losexp() } int -inv_weight() +inv_weight(void) { struct obj *otmp = invent; int wt = (u.ugold + 500) / 1000; @@ -957,7 +948,7 @@ inv_weight() } int -inv_cnt() +inv_cnt(void) { struct obj *otmp = invent; int ct = 0; @@ -969,7 +960,7 @@ inv_cnt() } long -newuexp() +newuexp(void) { return (10 * (1L << (u.ulevel - 1))); } -- cgit v1.2.3-56-ge451