switch source tree from k&r to c99

This commit is contained in:
nhmall
2021-01-26 21:06:16 -05:00
parent a2a9cb7b4f
commit f963c5aca7
232 changed files with 12099 additions and 17782 deletions
+27 -37
View File
@@ -5,13 +5,12 @@
#include "hack.h"
static int NDECL(stealarm);
static int NDECL(unstolenarm);
static const char *FDECL(equipname, (struct obj *));
static int stealarm(void);
static int unstolenarm(void);
static const char *equipname(struct obj *);
static const char *
equipname(otmp)
register struct obj *otmp;
equipname(register struct obj* otmp)
{
return ((otmp == uarmu) ? shirt_simple_name(otmp)
: (otmp == uarmf) ? boots_simple_name(otmp)
@@ -24,8 +23,7 @@ register struct obj *otmp;
/* proportional subset of gold; return value actually fits in an int */
long
somegold(lmoney)
long lmoney;
somegold(long lmoney)
{
#ifdef LINT /* long conv. ok */
int igold = 0;
@@ -60,8 +58,7 @@ long lmoney;
* Deals in gold only, as leprechauns don't care for lesser coins.
*/
struct obj *
findgold(chain)
register struct obj *chain;
findgold(register struct obj* chain)
{
while (chain && chain->otyp != GOLD_PIECE)
chain = chain->nobj;
@@ -72,8 +69,7 @@ register struct obj *chain;
* Steal gold coins only. Leprechauns don't care for lesser coins.
*/
void
stealgold(mtmp)
register struct monst *mtmp;
stealgold(register struct monst* mtmp)
{
register struct obj *fgold = g_at(u.ux, u.uy);
register struct obj *ygold;
@@ -135,7 +131,7 @@ register struct monst *mtmp;
/* monster who was stealing from hero has just died */
void
thiefdead()
thiefdead(void)
{
/* hero is busy taking off an item of armor which takes multiple turns */
g.stealmid = 0;
@@ -205,9 +201,9 @@ stealarm(VOID_ARGS)
/* An object you're wearing has been taken off by a monster (theft or
seduction). Also used if a worn item gets transformed (stone to flesh). */
void
remove_worn_item(obj, unchain_ball)
struct obj *obj;
boolean unchain_ball; /* whether to unpunish or just unwield */
remove_worn_item(
struct obj *obj,
boolean unchain_ball) /* whether to unpunish or just unwield */
{
if (donning(obj))
cancel_don();
@@ -266,9 +262,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */
* Nymphs and monkeys won't steal coins.
*/
int
steal(mtmp, objnambuf)
struct monst *mtmp;
char *objnambuf;
steal(struct monst* mtmp, char* objnambuf)
{
struct obj *otmp;
int tmp, could_petrify, armordelay, olddelay, icnt,
@@ -499,9 +493,7 @@ char *objnambuf;
/* Returns 1 if otmp is free'd, 0 otherwise. */
int
mpickobj(mtmp, otmp)
register struct monst *mtmp;
register struct obj *otmp;
mpickobj(register struct monst* mtmp, register struct obj* otmp)
{
int freed_otmp;
boolean snuff_otmp = FALSE;
@@ -548,8 +540,7 @@ register struct obj *otmp;
/* called for AD_SAMU (the Wizard and quest nemeses) */
void
stealamulet(mtmp)
struct monst *mtmp;
stealamulet(struct monst* mtmp)
{
char buf[BUFSZ];
struct obj *otmp = 0, *obj = 0;
@@ -631,10 +622,10 @@ struct monst *mtmp;
/* when a mimic gets poked with something, it might take that thing
(at present, only implemented for when the hero does the poking) */
void
maybe_absorb_item(mon, obj, ochance, achance)
struct monst *mon;
struct obj *obj;
int ochance, achance; /* percent chance for ordinary item, artifact */
maybe_absorb_item(
struct monst *mon,
struct obj *obj,
int ochance, int achance) /* percent chance for ordinary item, artifact */
{
if (obj == uball || obj == uchain || obj->oclass == ROCK_CLASS
|| obj_resists(obj, 100 - ochance, 100 - achance)
@@ -674,10 +665,10 @@ int ochance, achance; /* percent chance for ordinary item, artifact */
/* drop one object taken from a (possibly dead) monster's inventory */
void
mdrop_obj(mon, obj, verbosely)
struct monst *mon;
struct obj *obj;
boolean verbosely;
mdrop_obj(
struct monst *mon,
struct obj *obj,
boolean verbosely)
{
int omx = mon->mx, omy = mon->my;
boolean update_mon = FALSE;
@@ -719,8 +710,7 @@ boolean verbosely;
even leaving the game entirely; when that happens, prevent them from
taking the Amulet, invocation items, or quest artifact with them */
void
mdrop_special_objs(mon)
struct monst *mon;
mdrop_special_objs(struct monst* mon)
{
struct obj *obj, *otmp;
@@ -749,10 +739,10 @@ struct monst *mon;
/* release the objects the creature is carrying */
void
relobj(mtmp, show, is_pet)
struct monst *mtmp;
int show;
boolean is_pet; /* If true, pet should keep wielded/worn items */
relobj(
struct monst *mtmp,
int show,
boolean is_pet) /* If true, pet should keep wielded/worn items */
{
struct obj *otmp;
int omx = mtmp->mx, omy = mtmp->my;