switch source tree from k&r to c99
This commit is contained in:
25
src/write.c
25
src/write.c
@@ -3,17 +3,16 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int FDECL(cost, (struct obj *));
|
||||
static boolean FDECL(label_known, (int, struct obj *));
|
||||
static int FDECL(write_ok, (struct obj *));
|
||||
static char *FDECL(new_book_description, (int, char *));
|
||||
static int cost(struct obj *);
|
||||
static boolean label_known(int, struct obj *);
|
||||
static int write_ok(struct obj *);
|
||||
static char *new_book_description(int, char *);
|
||||
|
||||
/*
|
||||
* returns basecost of a scroll or a spellbook
|
||||
*/
|
||||
static int
|
||||
cost(otmp)
|
||||
register struct obj *otmp;
|
||||
cost(struct obj *otmp)
|
||||
{
|
||||
if (otmp->oclass == SPBOOK_CLASS)
|
||||
return (10 * objects[otmp->otyp].oc_level);
|
||||
@@ -63,9 +62,7 @@ register struct obj *otmp;
|
||||
the discoveries list and aren't present in current inventory,
|
||||
so some scrolls with ought to yield True will end up False */
|
||||
static boolean
|
||||
label_known(scrolltype, objlist)
|
||||
int scrolltype;
|
||||
struct obj *objlist;
|
||||
label_known(int scrolltype, struct obj *objlist)
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
@@ -90,8 +87,7 @@ struct obj *objlist;
|
||||
|
||||
/* getobj callback for object to write on */
|
||||
static int
|
||||
write_ok(obj)
|
||||
struct obj *obj;
|
||||
write_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj || (obj->oclass != SCROLL_CLASS && obj->oclass != SPBOOK_CLASS))
|
||||
return GETOBJ_EXCLUDE;
|
||||
@@ -104,8 +100,7 @@ struct obj *obj;
|
||||
|
||||
/* write -- applying a magic marker */
|
||||
int
|
||||
dowrite(pen)
|
||||
register struct obj *pen;
|
||||
dowrite(struct obj *pen)
|
||||
{
|
||||
register struct obj *paper;
|
||||
char namebuf[BUFSZ] = DUMMY, *nm, *bp;
|
||||
@@ -373,9 +368,7 @@ found:
|
||||
even that's rather iffy, indicating that such descriptions probably
|
||||
ought to be eliminated (especially "cloth"!) */
|
||||
static char *
|
||||
new_book_description(booktype, outbuf)
|
||||
int booktype;
|
||||
char *outbuf;
|
||||
new_book_description(int booktype, char *outbuf)
|
||||
{
|
||||
/* subset of description strings from objects.c; if it grows
|
||||
much, we may need to add a new flag field to objects[] instead */
|
||||
|
||||
Reference in New Issue
Block a user