]> diplodocus.org Git - nmh/commitdiff
h/tws.h: Remove TW_YES and TW_NO; TW_SUCC good enough.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Apr 2017 13:31:10 +0000 (14:31 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Apr 2017 13:31:10 +0000 (14:31 +0100)
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.

h/tws.h
sbr/dtimep.l

diff --git a/h/tws.h b/h/tws.h
index 5d99cf5a0fc6aed84b97b4e3b774d0cbd1eb34db..9c8af2a479380d61b23d015bb94bdf3ec38631f3 100644 (file)
--- 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)
 
index 05a6d90bc5cc855d97dbee69c49cd9d5a2a4a189..32b43b832a07da1a7220adc15d3d2f1f6d1d0691 100644 (file)
@@ -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; \