From: Ralph Corderoy Date: Sat, 22 Apr 2017 13:31:10 +0000 (+0100) Subject: h/tws.h: Remove TW_YES and TW_NO; TW_SUCC good enough. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/ca9f3b344ed691254a990c4d0ec6f3f08312ee3b?ds=inline;hp=02b04f3b19b8bd69ae292eeb2c2d7eec410506f2 h/tws.h: Remove TW_YES and TW_NO; TW_SUCC good enough. TW_SUCC is a macro for the bit-mask 0x0040. TW_YES, a vague name, was the same value. TW_NO was 0, and unused by the code. Ditch both those as TW_SUCC is sufficient for setting and testing. Alter its comment to make clear it means parsing was successful. --- diff --git a/h/tws.h b/h/tws.h index 5d99cf5a..9c8af2a4 100644 --- a/h/tws.h +++ b/h/tws.h @@ -38,9 +38,7 @@ struct tws { #define TW_DST 0x0010 /* daylight savings time */ #define TW_ZONE 0x0020 /* use numeric timezones only */ -#define TW_SUCC 0x0040 /* whether parsing was successful */ -#define TW_YES 0x0040 /* yes, found */ -#define TW_NO 0x0000 /* no, not found */ +#define TW_SUCC 0x0040 /* Parsing was successful. */ #define dtwszone(tw) dtimezone (tw->tw_zone, tw->tw_flags) diff --git a/sbr/dtimep.l b/sbr/dtimep.l index 05a6d90b..32b43b83 100644 --- a/sbr/dtimep.l +++ b/sbr/dtimep.l @@ -139,7 +139,7 @@ static int day_map[] = { #define SETYEAR() { tw.tw_year = atoi(cp); \ SKIPD(); } #define SETDAY() { tw.tw_mday = atoi(cp); \ - tw.tw_flags |= TW_YES; \ + tw.tw_flags |= TW_SUCC; \ SKIPD(); } #define SETTIME() { tw.tw_hour = atoi(cp); \ cp += 2; \