From 741d2929b4d3bc15356ef5c198dd27c181925268 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 22 Dec 2023 13:10:39 -0500 Subject: [PATCH 1/3] assess worn.c static functions for nonnull --- src/worn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/worn.c b/src/worn.c index 4b9507ced..aa8f44c41 100644 --- a/src/worn.c +++ b/src/worn.c @@ -5,10 +5,10 @@ #include "hack.h" -static void m_lose_armor(struct monst *, struct obj *, boolean); -static void clear_bypass(struct obj *); -static void m_dowear_type(struct monst *, long, boolean, boolean); -static int extra_pref(struct monst *, struct obj *); +static void m_lose_armor(struct monst *, struct obj *, boolean) NONNULLPTRS; +static void clear_bypass(struct obj *) NO_NNARGS; +static void m_dowear_type(struct monst *, long, boolean, boolean) NONNULLARG1; +static int extra_pref(struct monst *, struct obj *) NONNULLARG1; const struct worn { long w_mask; From 92250aa15dc64047a481e0d097b2746c85785d53 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 22 Dec 2023 13:18:04 -0500 Subject: [PATCH 2/3] assess worm.c static functions for nonnull --- src/worm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worm.c b/src/worm.c index 6ff5bdb76..6d1266ed9 100644 --- a/src/worm.c +++ b/src/worm.c @@ -14,12 +14,12 @@ struct wseg { coordxy wx, wy; /* the segment's position */ }; -static void toss_wsegs(struct wseg *, boolean); +static void toss_wsegs(struct wseg *, boolean) NO_NNARGS; static void shrink_worm(int); #if 0 static void random_dir(int, int, int *, int *); #endif -static struct wseg *create_worm_tail(int); +static struct wseg *create_worm_tail(int); /* may return NULL */ /* Description of long worm implementation. * From 34d6cf105ef1f8019462ffe0639bded0fdb828bf Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 22 Dec 2023 13:54:51 -0500 Subject: [PATCH 3/3] zap.c, write.c, worn.c, worm.c nonnull returns --- include/extern.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/extern.h b/include/extern.h index 27d1736af..49664ca9f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3724,7 +3724,7 @@ extern void zapsetup(void); extern void zapwrapup(void); extern void weffects(struct obj *) NONNULLARG1; extern int spell_damage_bonus(int); -extern const char *exclam(int force); +extern const char *exclam(int force) NONNULL; extern void hit(const char *, struct monst *, const char *) NONNULLPTRS; extern void miss(const char *, struct monst *) NONNULLPTRS; extern struct monst *bhit(coordxy, coordxy, int, enum bhit_call_types, @@ -3751,7 +3751,7 @@ extern void destroy_item(int, int); extern int destroy_mitem(struct monst *, int, int) NONNULLARG1; extern int resist(struct monst *, char, int, int) NONNULLARG1; extern void makewish(void); -extern const char *flash_str(int, boolean); +extern const char *flash_str(int, boolean) NONNULL; /* ### unixmain.c, windsys.c ### */