From 93a44c05d1fa32770192194f0769f774e32084ba Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 7 May 2024 12:24:57 -0400 Subject: [PATCH] let the compiler -Wswitch catch unhandled shop_string types --- src/dungeon.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/dungeon.c b/src/dungeon.c index 034d1991f..9c533e52d 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -3408,9 +3408,10 @@ staticfn const char * shop_string(int rtype) { const char *str = "shop"; /* catchall */ + enum roomtype_types ertype = rtype; /* Yuck, redundancy...but shclass.name doesn't cut it as a noun */ - switch (rtype) { + switch (ertype) { case SHOPBASE - 1: str = "untended shop"; break; /* see recalc_mapseen */ @@ -3447,7 +3448,20 @@ shop_string(int rtype) case CANDLESHOP: str = "lighting shop"; break; - default: + /* non-shops room types */ + case OROOM: + case THEMEROOM: + case COURT: + case SWAMP: + case VAULT: + case BEEHIVE: + case MORGUE: + case BARRACKS: + case ZOO: + case DELPHI: + case TEMPLE: + case LEPREHALL: + case COCKNEST: break; } return str;