followup for miscellaneous objects[] macros

The DUMP_ENUMS definition of 'MARKER()' had the expansion of its
arguments backwards but isn't even needed, so get rid of it rather
than reverse them.  nethack --dumpenums handles them separately
from object definitions.
This commit is contained in:
PatR
2022-12-28 11:33:39 -08:00
parent ddd358aa03
commit 077fdcfaac
2 changed files with 13 additions and 11 deletions

View File

@@ -60,7 +60,7 @@
#define OBJECT(obj,bits,prp,sym,prob,dly,wt, \
cost,sdam,ldam,oc1,oc2,nut,color,sn) \
{ sn, #sn }
#define MARKER(tag,sn) { tag, #sn },
#define MARKER(tag,sn) /*empty*/
#else
#error Unproductive inclusion of objects.h

View File

@@ -1054,18 +1054,20 @@ dump_enums(void)
static const char *const titles[NUM_ENUM_DUMPS] = {
"monnums", "objects_nums" , "misc_object_nums"
};
#define dump_om(om) { om, #om }
static const struct enum_dump omdump[] = {
{ FIRST_AMULET, "FIRST_AMULET" },
{ LAST_AMULET, "LAST_AMULET" },
{ FIRST_SPELL, "FIRST_SPELL" },
{ LAST_SPELL, "LAST_SPELL" },
{ MAXSPELL, "MAXSPELL" },
{ FIRST_REAL_GEM, "FIRST_REAL_GEM" },
{ LAST_REAL_GEM, "LAST_REAL_GEM" },
{ FIRST_GLASS_GEM, "FIRST_GLASS_GEM" },
{ LAST_GLASS_GEM, "LAST_GLASS_GEM" },
{ NUM_GLASS_GEMS, "NUM_GLASS_GEMS" },
dump_om(FIRST_AMULET),
dump_om(LAST_AMULET),
dump_om(FIRST_SPELL),
dump_om(LAST_SPELL),
dump_om(MAXSPELL),
dump_om(FIRST_REAL_GEM),
dump_om(LAST_REAL_GEM),
dump_om(FIRST_GLASS_GEM),
dump_om(LAST_GLASS_GEM),
dump_om(NUM_GLASS_GEMS),
};
#undef dump_om
static const struct enum_dump *const ed[NUM_ENUM_DUMPS] = {
monsdump, objdump, omdump
};