From: Ralph Corderoy Date: Thu, 17 Aug 2017 11:36:50 +0000 (+0100) Subject: Both f_typestr(): Rebuild switch from FT_* to string from scratch. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/ce8a66e8b8e9a818d165d09f8df56178e0b40dc9 Both f_typestr(): Rebuild switch from FT_* to string from scratch. Adds missing cases, e.g. FT_LS_CFIND. Removes inconsistent "FT_" prefix from some strings, e.g. FT_LS_DECODE. Re-orders cases to match definitions. --- diff --git a/test/format/test-fmtdump b/test/format/test-fmtdump index 167945f4..82791f48 100755 --- a/test/format/test-fmtdump +++ b/test/format/test-fmtdump @@ -110,16 +110,16 @@ L7: MYMBOX, c_name "from", c_type LIT "To:" PARSEADDR, c_name "to", c_type LS_FRIENDLY, c_name "to", c_type - FT_LS_DECODE + LS_DECODE STRF, width 14, fill ' ' L8: IF_V_EQ 0 continue else goto L9 PARSEADDR, c_name "from", c_type LS_FRIENDLY, c_name "from", c_type - FT_LS_DECODE + LS_DECODE STRF, width 17, fill ' ' L9: LIT " " LS_COMP, comp "subject" - FT_LS_DECODE + LS_DECODE STR LS_COMP, comp "body" IF_S continue else goto L10 @@ -171,18 +171,18 @@ L7: MYMBOX, c_name "from", c_type LIT "To:" PARSEADDR, c_name "to", c_type LS_FRIENDLY, c_name "to", c_type - FT_LS_DECODE + LS_DECODE LS_UNQUOTE STRF, width 14, fill ' ' L8: IF_V_EQ 0 continue else goto L9 PARSEADDR, c_name "from", c_type LS_FRIENDLY, c_name "from", c_type - FT_LS_DECODE + LS_DECODE LS_UNQUOTE STRF, width 17, fill ' ' L9: LIT " " LS_COMP, comp "subject" - FT_LS_DECODE + LS_DECODE STR LS_COMP, comp "body" IF_S continue else goto L10 diff --git a/uip/fmtdump.c b/uip/fmtdump.c index eeeb1461..9de89878 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -349,14 +349,15 @@ f_typestr(int t) case FT_STR: return("STR"); case FT_STRF: return("STRF"); case FT_STRFW: return("STRFW"); - case FT_PUTADDR: return("PUTADDR"); case FT_STRLIT: return("STRLIT"); case FT_STRLITZ: return("STRLITZ"); + case FT_PUTADDR: return("PUTADDR"); case FT_LS_COMP: return("LS_COMP"); case FT_LS_LIT: return("LS_LIT"); case FT_LS_GETENV: return("LS_GETENV"); - case FT_LS_DECODECOMP: return("FT_LS_DECODECOMP"); - case FT_LS_DECODE: return("FT_LS_DECODE"); + case FT_LS_CFIND: return("LS_CFIND"); + case FT_LS_DECODECOMP: return("LS_DECODECOMP"); + case FT_LS_DECODE: return("LS_DECODE"); case FT_LS_TRIM: return("LS_TRIM"); case FT_LV_COMP: return("LV_COMP"); case FT_LV_COMPFLAG: return("LV_COMPFLAG"); @@ -369,8 +370,6 @@ f_typestr(int t) case FT_LV_DIVIDE_L: return("LV_DIVIDE_L"); case FT_LV_MODULO_L: return("LV_MODULO_L"); case FT_LV_CHAR_LEFT: return("LV_CHAR_LEFT"); - case FT_LS_KILO: return("LS_KILO"); - case FT_LS_KIBI: return("LS_KIBI"); case FT_LS_MONTH: return("LS_MONTH"); case FT_LS_LMONTH: return("LS_LMONTH"); case FT_LS_ZONE: return("LS_ZONE"); @@ -378,6 +377,8 @@ f_typestr(int t) case FT_LS_WEEKDAY: return("LS_WEEKDAY"); case FT_LS_822DATE: return("LS_822DATE"); case FT_LS_PRETTY: return("LS_PRETTY"); + case FT_LS_KILO: return("LS_KILO"); + case FT_LS_KIBI: return("LS_KIBI"); case FT_LV_SEC: return("LV_SEC"); case FT_LV_MIN: return("LV_MIN"); case FT_LV_HOUR: return("LV_HOUR"); @@ -392,13 +393,13 @@ f_typestr(int t) case FT_LV_DAYF: return("LV_DAYF"); case FT_LV_DST: return("LV_DST"); case FT_LV_ZONEF: return("LV_ZONEF"); - case FT_LS_ADDR: return("LS_ADDR"); case FT_LS_PERS: return("LS_PERS"); case FT_LS_MBOX: return("LS_MBOX"); case FT_LS_HOST: return("LS_HOST"); case FT_LS_PATH: return("LS_PATH"); case FT_LS_GNAME: return("LS_GNAME"); case FT_LS_NOTE: return("LS_NOTE"); + case FT_LS_ADDR: return("LS_ADDR"); case FT_LS_822ADDR: return("LS_822ADDR"); case FT_LS_FRIENDLY: return("LS_FRIENDLY"); case FT_LV_HOSTTYPE: return("LV_HOSTTYPE"); @@ -415,8 +416,8 @@ f_typestr(int t) case FT_GETMYMBOX: return("GETMYMBOX"); case FT_GETMYADDR: return("GETMYADDR"); case FT_SAVESTR: return("SAVESTR"); - case FT_PAUSE: return ("PAUSE"); case FT_DONE: return("DONE"); + case FT_PAUSE: return("PAUSE"); case FT_NOP: return("NOP"); case FT_GOTO: return("GOTO"); case FT_IF_S_NULL: return("IF_S_NULL"); diff --git a/uip/fmttest.c b/uip/fmttest.c index becf25d1..0f3e48b0 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -1014,12 +1014,13 @@ f_typestr(int t) case FT_STR: return("STR"); case FT_STRF: return("STRF"); case FT_STRFW: return("STRFW"); - case FT_PUTADDR: return("PUTADDR"); case FT_STRLIT: return("STRLIT"); case FT_STRLITZ: return("STRLITZ"); + case FT_PUTADDR: return("PUTADDR"); case FT_LS_COMP: return("LS_COMP"); case FT_LS_LIT: return("LS_LIT"); case FT_LS_GETENV: return("LS_GETENV"); + case FT_LS_CFIND: return("LS_CFIND"); case FT_LS_DECODECOMP: return("LS_DECODECOMP"); case FT_LS_DECODE: return("LS_DECODE"); case FT_LS_TRIM: return("LS_TRIM"); @@ -1034,8 +1035,6 @@ f_typestr(int t) case FT_LV_DIVIDE_L: return("LV_DIVIDE_L"); case FT_LV_MODULO_L: return("LV_MODULO_L"); case FT_LV_CHAR_LEFT: return("LV_CHAR_LEFT"); - case FT_LS_KILO: return("LS_KILO"); - case FT_LS_KIBI: return("LS_KIBI"); case FT_LS_MONTH: return("LS_MONTH"); case FT_LS_LMONTH: return("LS_LMONTH"); case FT_LS_ZONE: return("LS_ZONE"); @@ -1043,6 +1042,8 @@ f_typestr(int t) case FT_LS_WEEKDAY: return("LS_WEEKDAY"); case FT_LS_822DATE: return("LS_822DATE"); case FT_LS_PRETTY: return("LS_PRETTY"); + case FT_LS_KILO: return("LS_KILO"); + case FT_LS_KIBI: return("LS_KIBI"); case FT_LV_SEC: return("LV_SEC"); case FT_LV_MIN: return("LV_MIN"); case FT_LV_HOUR: return("LV_HOUR"); @@ -1057,13 +1058,13 @@ f_typestr(int t) case FT_LV_DAYF: return("LV_DAYF"); case FT_LV_DST: return("LV_DST"); case FT_LV_ZONEF: return("LV_ZONEF"); - case FT_LS_ADDR: return("LS_ADDR"); case FT_LS_PERS: return("LS_PERS"); case FT_LS_MBOX: return("LS_MBOX"); case FT_LS_HOST: return("LS_HOST"); case FT_LS_PATH: return("LS_PATH"); case FT_LS_GNAME: return("LS_GNAME"); case FT_LS_NOTE: return("LS_NOTE"); + case FT_LS_ADDR: return("LS_ADDR"); case FT_LS_822ADDR: return("LS_822ADDR"); case FT_LS_FRIENDLY: return("LS_FRIENDLY"); case FT_LV_HOSTTYPE: return("LV_HOSTTYPE"); @@ -1080,8 +1081,8 @@ f_typestr(int t) case FT_GETMYMBOX: return("GETMYMBOX"); case FT_GETMYADDR: return("GETMYADDR"); case FT_SAVESTR: return("SAVESTR"); - case FT_PAUSE: return ("PAUSE"); case FT_DONE: return("DONE"); + case FT_PAUSE: return("PAUSE"); case FT_NOP: return("NOP"); case FT_GOTO: return("GOTO"); case FT_IF_S_NULL: return("IF_S_NULL");