Code cleanup.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 14 Jul 2017 17:10:13 +0000 (13:10 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 14 Jul 2017 17:10:13 +0000 (13:10 -0400)
actions.c
advent.h
misc.c

index 6cff55ced3181400525f8601eb8ead9f5e1659da..48de9d04a7f84763343d71627243b142e14a9470 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -545,9 +545,7 @@ static int discard(verb_t verb, obj_t obj)
         } else
             rspeak(OK_MAN);
 
         } else
             rspeak(OK_MAN);
 
-        game.prop[BIRD] = BIRD_UNCAGED;
-        if (FOREST(game.loc))
-            game.prop[BIRD] = BIRD_FOREST_UNCAGED;
+       game.prop[BIRD] = FOREST(game.loc) ? BIRD_FOREST_UNCAGED : BIRD_UNCAGED;
         drop(obj, game.loc);
         return GO_CLEAROBJ;
     }
         drop(obj, game.loc);
         return GO_CLEAROBJ;
     }
index 7eb54dc744d3e694edf5055b252b0a55e843047a..34b855fb7c4f4ff3efcbfbab70b050032d3f453e 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -208,7 +208,6 @@ extern void packed_to_token(long, char token[]);
 extern long token_to_packed(const char token[]);
 extern void tokenize(char*, struct command_t *);
 extern void vspeak(const char*, bool, va_list);
 extern long token_to_packed(const char token[]);
 extern void tokenize(char*, struct command_t *);
 extern void vspeak(const char*, bool, va_list);
-extern bool wordempty(token_t);
 extern void wordclear(token_t *);
 extern void speak(const char*, ...);
 extern void sspeak(long msg, ...);
 extern void wordclear(token_t *);
 extern void speak(const char*, ...);
 extern void sspeak(long msg, ...);
diff --git a/misc.c b/misc.c
index 756e5cbfb223a443d3909fe4d3025b199bc3cb55..c4dc35124b4e9885007e4110f85cad7d7163125e 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -128,11 +128,6 @@ void tokenize(char* raw, struct command_t *cmd)
 
 /* Hide the fact that wods are corrently packed longs */
 
 
 /* Hide the fact that wods are corrently packed longs */
 
-bool wordempty(token_t a)
-{
-    return a == 0;
-}
-
 void wordclear(token_t *v)
 {
     *v = 0;
 void wordclear(token_t *v)
 {
     *v = 0;