X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a1da5322b88c7ed8c524f6b4130a9a9120ec4cd9..167e542b:/uip/fmtdump.c?ds=sidebyside diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 2ec0a806..65358168 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -12,17 +12,19 @@ #include #include -static struct swit switches[] = { -#define FORMSW 0 - { "form formatfile", 0 }, -#define FMTSW 1 - { "format string", 5 }, -#define VERSIONSW 2 - { "version", 0 }, -#define HELPSW 3 - { "help", 0 }, - { NULL, 0 } -}; +#define FMTDUMP_SWITCHES \ + X("form formatfile", 0, FORMSW) \ + X("format string", 5, FMTSW) \ + X("version", 0, VERSIONSW) \ + X("help", 0, HELPSW) \ + +#define X(sw, minchars, id) id, +DEFINE_SWITCH_ENUM(FMTDUMP); +#undef X + +#define X(sw, minchars, id) { sw, minchars, id }, +DEFINE_SWITCH_ARRAY(FMTDUMP, switches); +#undef X /* for assignlabel */ static struct format *lvec[128]; @@ -415,9 +417,6 @@ f_typestr(int t) case FT_FORMATADDR: return("FORMATADDR"); case FT_CONCATADDR: return("CONCATADDR"); case FT_MYMBOX: return("MYMBOX"); -#ifdef FT_ADDTOSEQ - case FT_ADDTOSEQ: return("ADDTOSEQ"); -#endif case FT_SAVESTR: return("SAVESTR"); #ifdef FT_PAUSE case FT_PAUSE: return ("PAUSE");