nonnull for some static functions during recent analysis

This commit is contained in:
nhmall
2023-12-16 10:51:59 -05:00
parent 516d428c40
commit c5a5b55c15
14 changed files with 36 additions and 32 deletions

View File

@@ -8,9 +8,9 @@
static boolean no_bones_level(d_level *);
static void goodfruit(int);
static void resetobjs(struct obj *, boolean);
static void give_to_nearby_mon(struct obj *, coordxy, coordxy);
static boolean fixuporacle(struct monst *);
static void remove_mon_from_bones(struct monst *);
static void give_to_nearby_mon(struct obj *, coordxy, coordxy) NONNULLARG1;
static boolean fixuporacle(struct monst *) NONNULLARG1;
static void remove_mon_from_bones(struct monst *) NONNULLARG1;
static void set_ghostly_objlist(struct obj *objchain);
static boolean

View File

@@ -10,8 +10,8 @@ static void mkcavepos(coordxy, coordxy, int, boolean, boolean);
static void mkcavearea(boolean);
static int dig(void);
static void dig_up_grave(coord *);
static boolean watchman_canseeu(struct monst *);
static int adj_pit_checks(coord *, char *);
static boolean watchman_canseeu(struct monst *) NONNULLARG1;
static int adj_pit_checks(coord *, char *) NONNULLARG2;
static void pit_flow(struct trap *, schar);
static boolean furniture_handled(coordxy, coordxy, boolean);

View File

@@ -124,14 +124,15 @@
#include "hack.h"
static void show_mon_or_warn(coordxy, coordxy, int);
static void display_monster(coordxy, coordxy, struct monst *, int, boolean);
static void display_monster(coordxy, coordxy,
struct monst *, int, boolean) NONNULLPTRS;
static int swallow_to_glyph(int, int);
static void display_warning(struct monst *);
static void display_warning(struct monst *) NONNULLARG1;
static int check_pos(coordxy, coordxy, int);
static void get_bkglyph_and_framecolor(coordxy x, coordxy y, int *, uint32 *);
static int tether_glyph(coordxy, coordxy);
static void mimic_light_blocking(struct monst *);
static void mimic_light_blocking(struct monst *) NONNULLARG1;
#ifdef UNBUFFERED_GLYPHINFO
static glyph_info *glyphinfo_at(coordxy, coordxy, int);
#endif

View File

@@ -20,12 +20,12 @@ static void gloc_filter_done(void);
static boolean gather_locs_interesting(coordxy, coordxy, int);
static void gather_locs(coord **, int *, int);
static void truncate_to_map(int *, int *, schar, schar);
static void getpos_refresh(int *);
static void getpos_refresh(int *) NONNULLARG1;
static char *name_from_player(char *, const char *, const char *);
static void do_mgivenname(void);
static boolean alreadynamed(struct monst *, char *, char *);
static void do_oname(struct obj *);
static char *docall_xname(struct obj *);
static boolean alreadynamed(struct monst *, char *, char *) NONNULLPTRS;
static void do_oname(struct obj *) NONNULLARG1;
static char *docall_xname(struct obj *) NONNULLARG1;
static void namefloorobj(void);
extern const char what_is_an_unknown_object[]; /* from pager.c */

View File

@@ -7,7 +7,7 @@
static int pet_type(void);
static void set_mon_lastmove(struct monst *);
static int mon_leave(struct monst *);
static int mon_leave(struct monst *) NONNULLARG1;
static boolean keep_mon_accessible(struct monst *);
enum arrival {

View File

@@ -20,7 +20,7 @@ static int find_friends(struct monst *, struct monst *, int);
static struct monst *best_target(struct monst *);
static long score_targ(struct monst *, struct monst *);
static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
coordxy);
coordxy) NONNULLARG1;
/* pick a carried item for pet to drop */
struct obj *

View File

@@ -14,16 +14,17 @@
static void kickdmg(struct monst *, boolean);
static boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
static void kick_monster(struct monst *, coordxy, coordxy);
static int kick_object(coordxy, coordxy, char *);
static int kick_object(coordxy, coordxy, char *) NONNULLARG3;
static int really_kick_object(coordxy, coordxy);
static char *kickstr(char *, const char *);
static boolean watchman_thief_arrest(struct monst *);
static boolean watchman_door_damage(struct monst *, coordxy, coordxy);
static char *kickstr(char *, const char *) NONNULLPTRS;
static boolean watchman_thief_arrest(struct monst *) NONNULLPTRS;
static boolean watchman_door_damage(struct monst *,
coordxy, coordxy) NONNULLARG1;
static void kick_dumb(coordxy, coordxy);
static void kick_ouch(coordxy, coordxy, const char *);
static void kick_ouch(coordxy, coordxy, const char *) NONNULLARG3;
static void kick_door(coordxy, coordxy, int);
static void otransit_msg(struct obj *, boolean, boolean, long);
static void drop_to(coord *, schar, coordxy, coordxy);
static void drop_to(coord *, schar, coordxy, coordxy) NONNULLARG1;
static const char kick_passes_thru[] = "kick passes harmlessly through";

View File

@@ -4,7 +4,7 @@
#include "hack.h"
static int explosionmask(struct monst *, uchar, char);
static int explosionmask(struct monst *, uchar, char) NONNULLARG1;
static void engulfer_explosion_msg(uchar, char);
/* Note: Arrays are column first, while the screen is row first */

View File

@@ -9,9 +9,9 @@
static void dowatersnakes(void);
static void dowaterdemon(void);
static void dowaternymph(void);
static void gush(coordxy, coordxy, genericptr_t);
static void gush(coordxy, coordxy, genericptr_t) NONNULLARG3;
static void dofindgem(void);
static boolean watchman_warn_fountain(struct monst *);
static boolean watchman_warn_fountain(struct monst *) NONNULLARG1;
DISABLE_WARNING_FORMAT_NONLITERAL

View File

@@ -14,16 +14,17 @@ static boolean findtravelpath(int);
static boolean trapmove(coordxy, coordxy, struct trap *);
static schar u_simple_floortyp(coordxy, coordxy);
static boolean swim_move_danger(coordxy, coordxy);
static boolean domove_bump_mon(struct monst *, int);
static boolean domove_bump_mon(struct monst *, int) NONNULLARG1;
static boolean domove_attackmon_at(struct monst *, coordxy, coordxy,
boolean *);
boolean *) NONNULLPTRS;
static boolean domove_fight_ironbars(coordxy, coordxy);
static boolean domove_fight_web(coordxy, coordxy);
static boolean domove_swap_with_pet(struct monst *, coordxy, coordxy);
static boolean domove_swap_with_pet(struct monst *,
coordxy, coordxy) NONNULLARG1;
static boolean domove_fight_empty(coordxy, coordxy);
static boolean air_turbulence(void);
static void slippery_ice_fumbling(void);
static boolean impaired_movement(coordxy *, coordxy *);
static boolean impaired_movement(coordxy *, coordxy *) NONNULLPTRS;
static boolean avoid_moving_on_trap(coordxy, coordxy, boolean);
static boolean avoid_moving_on_liquid(coordxy, coordxy, boolean);
static boolean avoid_running_into_trap_or_liquid(coordxy, coordxy);
@@ -32,7 +33,7 @@ static boolean carrying_too_much(void);
static boolean escape_from_sticky_mon(coordxy, coordxy);
static void domove_core(void);
static void maybe_smudge_engr(coordxy, coordxy, coordxy, coordxy);
static struct monst *monstinroom(struct permonst *, int);
static struct monst *monstinroom(struct permonst *, int) NONNULLARG1;
static boolean furniture_present(int, int);
static void move_update(boolean);
static int pickup_checks(void);

View File

@@ -15,7 +15,7 @@ static char *loot_xname(struct obj *);
static int invletter_value(char);
static int QSORTCALLBACK sortloot_cmp(const genericptr, const genericptr);
static void reorder_invent(void);
static struct obj *addinv_core0(struct obj *, struct obj *, boolean);
static struct obj *addinv_core0(struct obj *, struct obj *, boolean) NONNULLARG1;
static void noarmor(boolean);
static void invdisp_nothing(const char *, const char *);
static boolean worn_wield_only(struct obj *);

View File

@@ -42,7 +42,8 @@
#define LSF_SHOW 0x1 /* display the light source */
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
static light_source *new_light_core(coordxy, coordxy, int, int, anything *);
static light_source *new_light_core(coordxy, coordxy,
int, int, anything *) NONNULLPTRS;
static void discard_flashes(void);
static void write_ls(NHFILE *, light_source *);
static int maybe_write_ls(NHFILE *, int, boolean);

View File

@@ -13,7 +13,7 @@ static void mksobj_init(struct obj *, boolean);
static int item_on_ice(struct obj *);
static void shrinking_glob_gone(struct obj *);
static void obj_timer_checks(struct obj *, coordxy, coordxy, int);
static void container_weight(struct obj *);
static void container_weight(struct obj *) NONNULLARG1;
static struct obj *save_mtraits(struct obj *, struct monst *);
static void objlist_sanity(struct obj *, int, const char *);
static void shop_obj_sanity(struct obj *, const char *);

View File

@@ -10,7 +10,7 @@ static void monshoot(struct monst *, struct obj *, struct obj *);
static boolean ucatchgem(struct obj *, struct monst *);
static const char* breathwep_name(int);
static boolean drop_throw(struct obj *, boolean, coordxy, coordxy);
static int m_lined_up(struct monst *, struct monst *);
static int m_lined_up(struct monst *, struct monst *) NONNULLARG12;
#define URETREATING(x, y) \
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))