From 402b2bf5c864c04a673658d6ad9bed159b581ca6 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 6 Sep 2022 07:22:55 -0400 Subject: [PATCH] move struct propname to a header file In doing so, avoid repeated layout declaration in cmd.c --- include/timeout.h | 5 +++++ src/cmd.c | 5 +---- src/timeout.c | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/timeout.h b/include/timeout.h index 45aab9545..f3a853b68 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -60,4 +60,9 @@ typedef struct fe { Bitfield(needs_fixup, 1); /* does arg need to be patched? */ } timer_element; +struct propname { + int prop_num; + const char *prop_name; +}; + #endif /* TIMEOUT_H */ diff --git a/src/cmd.c b/src/cmd.c index e2d9d1687..e6d0d5a1f 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1952,10 +1952,7 @@ static int wiz_intrinsic(void) { if (wizard) { - extern const struct propname { - int prop_num; - const char *prop_name; - } propertynames[]; /* timeout.c */ + extern const struct propname propertynames[]; /* timeout.c */ static const char wizintrinsic[] = "#wizintrinsic"; static const char fmt[] = "You are%s %s."; winid win; diff --git a/src/timeout.c b/src/timeout.c index ed3a8ed38..d4f01fca8 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -21,10 +21,7 @@ static void cleanup_burn(ANY_P *, long); /* used by wizard mode #timeout and #wizintrinsic; order by 'interest' for timeout countdown, where most won't occur in normal play */ -const struct propname { - int prop_num; - const char *prop_name; -} propertynames[] = { +const struct propname propertynames[] = { { INVULNERABLE, "invulnerable" }, { STONED, "petrifying" }, { SLIMED, "becoming slime" },