From 647a072b6224562d9b1a8c225223472ba0249dd6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 14 Apr 2015 20:33:30 +0300 Subject: [PATCH] Move triplicate defines into single place --- include/hack.h | 9 +++++++++ src/attrib.c | 9 --------- src/eat.c | 10 +--------- src/pray.c | 10 ---------- 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/include/hack.h b/include/hack.h index c85f95d8d..2dcc91699 100644 --- a/include/hack.h +++ b/include/hack.h @@ -44,6 +44,15 @@ #define EXT_ENCUMBER 4 /* Overtaxed */ #define OVERLOADED 5 /* Overloaded */ +/* hunger states - see hu_stat in eat.c */ +#define SATIATED 0 +#define NOT_HUNGRY 1 +#define HUNGRY 2 +#define WEAK 3 +#define FAINTING 4 +#define FAINTED 5 +#define STARVED 6 + /* Macros for how a rumor was delivered in outrumor() */ #define BY_ORACLE 0 #define BY_COOKIE 1 diff --git a/src/attrib.c b/src/attrib.c index f7af4fee8..32b0be275 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -372,15 +372,6 @@ boolean inc_or_dec; if (moves > 0 && (i == A_STR || i == A_CON)) (void)encumber_msg(); } -/* hunger values - from eat.c */ -#define SATIATED 0 -#define NOT_HUNGRY 1 -#define HUNGRY 2 -#define WEAK 3 -#define FAINTING 4 -#define FAINTED 5 -#define STARVED 6 - STATIC_OVL void exerper() { diff --git a/src/eat.c b/src/eat.c index ea3f77691..2226a7b37 100644 --- a/src/eat.c +++ b/src/eat.c @@ -40,15 +40,6 @@ STATIC_DCL boolean FDECL(maybe_cannibal, (int,BOOLEAN_P)); char msgbuf[BUFSZ]; -/* hunger texts used on bottom line (each 8 chars long) */ -#define SATIATED 0 -#define NOT_HUNGRY 1 -#define HUNGRY 2 -#define WEAK 3 -#define FAINTING 4 -#define FAINTED 5 -#define STARVED 6 - /* also used to see if you're allowed to eat cats and dogs */ #define CANNIBAL_ALLOWED() (Role_if(PM_CAVEMAN) || Race_if(PM_ORC)) @@ -76,6 +67,7 @@ STATIC_OVL NEARDATA const char allobj[] = { STATIC_OVL boolean force_save_hs = FALSE; +/* see hunger states in hack.h - texts used on bottom line */ const char *hu_stat[] = { "Satiated", " ", diff --git a/src/pray.c b/src/pray.c index 0d5aab920..36cdf37e0 100644 --- a/src/pray.c +++ b/src/pray.c @@ -149,16 +149,6 @@ in_trouble() struct obj *otmp; int i, j, count=0; -/* Borrowed from eat.c */ - -#define SATIATED 0 -#define NOT_HUNGRY 1 -#define HUNGRY 2 -#define WEAK 3 -#define FAINTING 4 -#define FAINTED 5 -#define STARVED 6 - /* * major troubles */