Remove an unneeded layer of macro indirection.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 23 Sep 2024 02:21:47 +0000 (22:21 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 23 Sep 2024 07:35:52 +0000 (03:35 -0400)
actions.c
advent.h
main.c

index 27b790456b4572a5e63471aa0eee560354a00eb4..107b298758e29a03a4d3e6c55bc885ebbcbbb255 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -407,7 +407,7 @@ static phase_codes_t vcarry(verb_t verb, obj_t obj) {
        }
        if ((obj == BIRD || obj == CAGE) &&
            (game.objects[BIRD].prop == BIRD_CAGED ||
-            OBJECT_STASHED(BIRD) == BIRD_CAGED)) {
+            PROP_STASHIFY(game.objects[BIRD].prop) == BIRD_CAGED)) {
                /* expression maps BIRD to CAGE and CAGE to BIRD */
                carry(BIRD + CAGE - obj, game.loc);
        }
index 9f306c1821e7642a078b4f72d3ec5e59e22fc894..9841037ae92f7c74ec02e20f42e15957aa054135 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -61,7 +61,7 @@
  * STATE_NOTFOUND is only set on treasures. Non-treasures start the
  * game in STATE_FOUND.
  *
- * OBJECT_STASHED is supposed to map a state property value to a
+ * PROP_STASHIFY is supposed to map a state property value to a
  * negative range, where the object cannot be picked up but the value
  * can be recovered later.  Various objects get this property when
  * the cave starts to close. Only seems to be significant for the bird
 #define OBJECT_IS_NOTFOUND2(g, o) (!g.objects[o].found)
 #define OBJECT_SET_SEEN(obj) game.objects[object].found = true
 #endif
-#define OBJECT_STASHED(obj) PROP_STASHIFY(game.objects[obj].prop)
 
 #define PROMPT "> "
 
diff --git a/main.c b/main.c
index 4db38363a540a3cbd6091b43c27d423733972964..688cfc74f7a9859e134de35a4e6f074a5e22e84a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1276,7 +1276,7 @@ static bool do_command(void) {
                                            (OBJECT_IS_NOTFOUND(i) ||
                                             OBJECT_IS_STASHED(i))) {
                                                game.objects[i].prop =
-                                                   OBJECT_STASHED(i);
+                                                   PROP_STASHIFY(game.objects[i].prop);
                                        }
                                }
                        }