-/* $NetBSD: hack.steal.c,v 1.5 2003/04/02 18:36:40 jsm Exp $ */
+/* $NetBSD: hack.steal.c,v 1.8 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.steal.c,v 1.5 2003/04/02 18:36:40 jsm Exp $");
+__RCSID("$NetBSD: hack.steal.c,v 1.8 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
-long /* actually returns something that fits in an
- * int */
-somegold()
+static int stealarm(void);
+
+/*
+ * actually returns something that fits in an int
+ */
+long
+somegold(void)
{
return ((u.ugold < 100) ? u.ugold :
(u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold));
}
void
-stealgold(mtmp)
- struct monst *mtmp;
+stealgold(struct monst *mtmp)
{
struct gold *gold = g_at(u.ux, u.uy);
long tmp;
}
/* steal armor after he finishes taking it off */
-unsigned stealoid; /* object to be stolen */
-unsigned stealmid; /* monster doing the stealing */
-int
-stealarm()
+static unsigned stealoid; /* object to be stolen */
+static unsigned stealmid; /* monster doing the stealing */
+static int
+stealarm(void)
{
struct monst *mtmp;
struct obj *otmp;
/* (or at least, when N should flee now) */
/* avoid stealing the object stealoid */
int
-steal(mtmp)
- struct monst *mtmp;
+steal(struct monst *mtmp)
{
struct obj *otmp;
int tmp;
if (Punished && otmp == uball) {
Punished = 0;
freeobj(uchain);
- free((char *) uchain);
+ free(uchain);
uchain = (struct obj *) 0;
uball->spe = 0;
uball = (struct obj *) 0; /* superfluous */
}
void
-mpickobj(mtmp, otmp)
- struct monst *mtmp;
- struct obj *otmp;
+mpickobj(struct monst *mtmp, struct obj *otmp)
{
otmp->nobj = mtmp->minvent;
mtmp->minvent = otmp;
}
int
-stealamulet(mtmp)
- struct monst *mtmp;
+stealamulet(struct monst *mtmp)
{
struct obj *otmp;
/* release the objects the killed animal has stolen */
void
-relobj(mtmp, show)
- struct monst *mtmp;
- int show;
+relobj(struct monst *mtmp, int show)
{
struct obj *otmp, *otmp2;