assess wizard.c static functions for nonnull
No nonnull return attributes were appropriate for wizard.c section of include/extern.h either.
This commit is contained in:
+16
-5
@@ -11,12 +11,15 @@
|
|||||||
#include "hack.h"
|
#include "hack.h"
|
||||||
|
|
||||||
static short which_arti(int);
|
static short which_arti(int);
|
||||||
static boolean mon_has_arti(struct monst *, short);
|
static boolean mon_has_arti(struct monst *, short) NONNULLARG1;
|
||||||
static struct monst *other_mon_has_arti(struct monst *, short);
|
/* other_mon_has_arti() won't blow up if passed a NULL monst,
|
||||||
static struct obj *on_ground(short);
|
* but its caller target_on() passes it a nonnull monst;
|
||||||
|
* it may return a NULL monst pointer */
|
||||||
|
static struct monst *other_mon_has_arti(struct monst *, short) NONNULLARG1;
|
||||||
|
static struct obj *on_ground(short); /* might return NULL obj pointer */
|
||||||
static boolean you_have(int);
|
static boolean you_have(int);
|
||||||
static unsigned long target_on(int, struct monst *);
|
static unsigned long target_on(int, struct monst *) NONNULLARG2;
|
||||||
static unsigned long strategy(struct monst *);
|
static unsigned long strategy(struct monst *) NONNULLARG1;
|
||||||
|
|
||||||
/* adding more neutral creatures will tend to reduce the number of monsters
|
/* adding more neutral creatures will tend to reduce the number of monsters
|
||||||
summoned by nasty(); adding more lawful creatures will reduce the number
|
summoned by nasty(); adding more lawful creatures will reduce the number
|
||||||
@@ -176,6 +179,10 @@ mon_has_arti(struct monst *mtmp, short otyp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns some monster other than mtmp that
|
||||||
|
* has arifact, or NULL monst pointer.
|
||||||
|
*/
|
||||||
static struct monst *
|
static struct monst *
|
||||||
other_mon_has_arti(struct monst *mtmp, short otyp)
|
other_mon_has_arti(struct monst *mtmp, short otyp)
|
||||||
{
|
{
|
||||||
@@ -190,6 +197,10 @@ other_mon_has_arti(struct monst *mtmp, short otyp)
|
|||||||
return (struct monst *) 0;
|
return (struct monst *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns obj of type specified if there is one
|
||||||
|
* on the ground, otherwise returns NULL obj pointer.
|
||||||
|
*/
|
||||||
static struct obj *
|
static struct obj *
|
||||||
on_ground(short otyp)
|
on_ground(short otyp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user