]> granicus.if.org Git - nethack/commitdiff
move struct propname to a header file
authornhmall <nhmall@nethack.org>
Tue, 6 Sep 2022 11:22:55 +0000 (07:22 -0400)
committernhmall <nhmall@nethack.org>
Tue, 6 Sep 2022 11:22:55 +0000 (07:22 -0400)
In doing so, avoid repeated layout declaration in cmd.c

include/timeout.h
src/cmd.c
src/timeout.c

index 45aab9545d869aad667c94a1f6052b4532903dd9..f3a853b680e8f13d54c1e5c1c114782cf43c410a 100644 (file)
@@ -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 */
index e2d9d1687685abb29e2848b312948e2c5d8b9918..e6d0d5a1faf26742371b1cbd6d03d45e9e05666e 100644 (file)
--- 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;
index ed3a8ed38668e826696c61e83da865e0d08d2252..d4f01fca86c81376ce5c5929fc2782fb69d23b62 100644 (file)
@@ -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" },