switch source tree from k&r to c99
This commit is contained in:
+23
-48
@@ -7,14 +7,13 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean FDECL(stock_room_goodpos, (struct mkroom *, int, int, int, int));
|
||||
static boolean FDECL(veggy_item, (struct obj * obj, int));
|
||||
static int NDECL(shkveg);
|
||||
static void FDECL(mkveggy_at, (int, int));
|
||||
static void FDECL(mkshobj_at, (const struct shclass *, int, int,
|
||||
BOOLEAN_P));
|
||||
static void FDECL(nameshk, (struct monst *, const char *const *));
|
||||
static int FDECL(shkinit, (const struct shclass *, struct mkroom *));
|
||||
static boolean stock_room_goodpos(struct mkroom *, int, int, int, int);
|
||||
static boolean veggy_item(struct obj * obj, int);
|
||||
static int shkveg(void);
|
||||
static void mkveggy_at(int, int);
|
||||
static void mkshobj_at(const struct shclass *, int, int, boolean);
|
||||
static void nameshk(struct monst *, const char *const *);
|
||||
static int shkinit(const struct shclass *, struct mkroom *);
|
||||
|
||||
#define VEGETARIAN_CLASS (MAXOCLASSES + 1)
|
||||
|
||||
@@ -370,9 +369,7 @@ init_shop_selection()
|
||||
/* decide whether an object or object type is considered vegetarian;
|
||||
for types, items which might go either way are assumed to be veggy */
|
||||
static boolean
|
||||
veggy_item(obj, otyp)
|
||||
struct obj *obj;
|
||||
int otyp; /* used iff obj is null */
|
||||
veggy_item(struct obj* obj, int otyp /* used iff obj is null */)
|
||||
{
|
||||
int corpsenm;
|
||||
char oclass;
|
||||
@@ -401,7 +398,7 @@ int otyp; /* used iff obj is null */
|
||||
}
|
||||
|
||||
static int
|
||||
shkveg()
|
||||
shkveg(void)
|
||||
{
|
||||
int i, j, maxprob, prob;
|
||||
char oclass = FOOD_CLASS;
|
||||
@@ -436,8 +433,7 @@ shkveg()
|
||||
|
||||
/* make a random item for health food store */
|
||||
static void
|
||||
mkveggy_at(sx, sy)
|
||||
int sx, sy;
|
||||
mkveggy_at(int sx, int sy)
|
||||
{
|
||||
struct obj *obj = mksobj_at(shkveg(), sx, sy, TRUE, TRUE);
|
||||
|
||||
@@ -448,10 +444,7 @@ int sx, sy;
|
||||
|
||||
/* make an object of the appropriate type for a shop square */
|
||||
static void
|
||||
mkshobj_at(shp, sx, sy, mkspecl)
|
||||
const struct shclass *shp;
|
||||
int sx, sy;
|
||||
boolean mkspecl;
|
||||
mkshobj_at(const struct shclass* shp, int sx, int sy, boolean mkspecl)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
struct permonst *ptr;
|
||||
@@ -488,9 +481,7 @@ boolean mkspecl;
|
||||
|
||||
/* extract a shopkeeper name for the given shop type */
|
||||
static void
|
||||
nameshk(shk, nlp)
|
||||
struct monst *shk;
|
||||
const char *const *nlp;
|
||||
nameshk(struct monst* shk, const char* const* nlp)
|
||||
{
|
||||
int i, trycnt, names_avail;
|
||||
const char *shname = 0;
|
||||
@@ -559,8 +550,7 @@ const char *const *nlp;
|
||||
}
|
||||
|
||||
void
|
||||
neweshk(mtmp)
|
||||
struct monst *mtmp;
|
||||
neweshk(struct monst* mtmp)
|
||||
{
|
||||
if (!mtmp->mextra)
|
||||
mtmp->mextra = newmextra();
|
||||
@@ -571,8 +561,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
void
|
||||
free_eshk(mtmp)
|
||||
struct monst *mtmp;
|
||||
free_eshk(struct monst* mtmp)
|
||||
{
|
||||
if (mtmp->mextra && ESHK(mtmp)) {
|
||||
free((genericptr_t) ESHK(mtmp));
|
||||
@@ -583,9 +572,7 @@ struct monst *mtmp;
|
||||
|
||||
/* create a new shopkeeper in the given room */
|
||||
static int
|
||||
shkinit(shp, sroom)
|
||||
const struct shclass *shp;
|
||||
struct mkroom *sroom;
|
||||
shkinit(const struct shclass* shp, struct mkroom* sroom)
|
||||
{
|
||||
register int sh, sx, sy;
|
||||
struct monst *shk;
|
||||
@@ -677,9 +664,7 @@ struct mkroom *sroom;
|
||||
}
|
||||
|
||||
static boolean
|
||||
stock_room_goodpos(sroom, rmno, sh, sx, sy)
|
||||
struct mkroom *sroom;
|
||||
int rmno, sh, sx,sy;
|
||||
stock_room_goodpos(struct mkroom* sroom, int rmno, int sh, int sx, int sy)
|
||||
{
|
||||
if (sroom->irregular) {
|
||||
if (levl[sx][sy].edge
|
||||
@@ -702,9 +687,7 @@ int rmno, sh, sx,sy;
|
||||
|
||||
/* stock a newly-created room with objects */
|
||||
void
|
||||
stock_room(shp_indx, sroom)
|
||||
int shp_indx;
|
||||
register struct mkroom *sroom;
|
||||
stock_room(int shp_indx, register struct mkroom* sroom)
|
||||
{
|
||||
/*
|
||||
* Someday soon we'll dispatch on the shdist field of shclass to do
|
||||
@@ -788,9 +771,7 @@ register struct mkroom *sroom;
|
||||
|
||||
/* does shkp's shop stock this item type? */
|
||||
boolean
|
||||
saleable(shkp, obj)
|
||||
struct monst *shkp;
|
||||
struct obj *obj;
|
||||
saleable(struct monst* shkp, struct obj* obj)
|
||||
{
|
||||
int i, shp_indx = ESHK(shkp)->shoptype - SHOPBASE;
|
||||
const struct shclass *shp = &shtypes[shp_indx];
|
||||
@@ -814,8 +795,7 @@ struct obj *obj;
|
||||
/* positive value: class; negative value: specific object type.
|
||||
can also return non-existing object class (eg. VEGETARIAN_CLASS) */
|
||||
int
|
||||
get_shop_item(type)
|
||||
int type;
|
||||
get_shop_item(int type)
|
||||
{
|
||||
const struct shclass *shp = shtypes + type;
|
||||
register int i, j;
|
||||
@@ -829,8 +809,7 @@ int type;
|
||||
|
||||
/* version of shkname() for beginning of sentence */
|
||||
char *
|
||||
Shknam(mtmp)
|
||||
struct monst *mtmp;
|
||||
Shknam(struct monst* mtmp)
|
||||
{
|
||||
char *nam = shkname(mtmp);
|
||||
|
||||
@@ -843,8 +822,7 @@ struct monst *mtmp;
|
||||
will yield some other shopkeeper's name (not necessarily one residing
|
||||
in the current game's dungeon, or who keeps same type of shop) */
|
||||
char *
|
||||
shkname(mtmp)
|
||||
struct monst *mtmp;
|
||||
shkname(struct monst* mtmp)
|
||||
{
|
||||
char *nam;
|
||||
unsigned save_isshk = mtmp->isshk;
|
||||
@@ -888,8 +866,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
boolean
|
||||
shkname_is_pname(mtmp)
|
||||
struct monst *mtmp;
|
||||
shkname_is_pname(struct monst* mtmp)
|
||||
{
|
||||
const char *shknm = ESHK(mtmp)->shknam;
|
||||
|
||||
@@ -897,9 +874,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
boolean
|
||||
is_izchak(shkp, override_hallucination)
|
||||
struct monst *shkp;
|
||||
boolean override_hallucination;
|
||||
is_izchak(struct monst* shkp, boolean override_hallucination)
|
||||
{
|
||||
const char *shknm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user