]> diplodocus.org Git - nmh/commitdiff
tws.h: Remove ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Apr 2017 15:10:59 +0000 (16:10 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 23 Apr 2017 15:10:59 +0000 (16:10 +0100)
Code that's conditional on its definition has been kept;  just the tests
removed.  The comment explaining its purpose has been kept, just without
the "If defined...".

h/tws.h
sbr/dtime.c
sbr/dtimep.l

diff --git a/h/tws.h b/h/tws.h
index 66e33613954933562b1a2d45c6ac23242ad1d265..9acda6a6a23c02a2a5bd5bed928477aee0b670d0 100644 (file)
--- a/h/tws.h
+++ b/h/tws.h
@@ -1,12 +1,11 @@
 /* tws.h -- time routines.
  */
 
 /* tws.h -- time routines.
  */
 
-/* If the following is #defined, a timezone given as a numeric-only offset will
+/* A timezone given as a numeric-only offset will
    be treated specially if it's in a zone that observes Daylight Saving Time.
    For instance, during DST, a Date: like "Mon, 24 Jul 2000 12:31:44 -0700" will
    be printed as "Mon, 24 Jul 2000 12:31:44 PDT".  Without the code activated by
    the following #define, that'd be incorrectly printed as "...MST". */
    be treated specially if it's in a zone that observes Daylight Saving Time.
    For instance, during DST, a Date: like "Mon, 24 Jul 2000 12:31:44 -0700" will
    be printed as "Mon, 24 Jul 2000 12:31:44 PDT".  Without the code activated by
    the following #define, that'd be incorrectly printed as "...MST". */
-#define        ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST 1
 
 struct tws {
     int tw_sec;                /* seconds after the minute - [0, 61] */
 
 struct tws {
     int tw_sec;                /* seconds after the minute - [0, 61] */
index 58cb94eb8c5f181c328c8cc290e8cc33ec27159a..b4aaed8d89a0a698f651922c44afcfad100a3949 100644 (file)
@@ -298,10 +298,8 @@ dtimezone (int offset, int flags)
        hours = offset / 60;
     }
 
        hours = offset / 60;
     }
 
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
     if (flags & TW_DST)
        hours++;
     if (flags & TW_DST)
        hours++;
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
     snprintf (buffer, sizeof(buffer), "%s%02d%02d",
                offset < 0 ? "-" : "+", abs (hours), abs (mins));
     return buffer;
     snprintf (buffer, sizeof(buffer), "%s%02d%02d",
                offset < 0 ? "-" : "+", abs (hours), abs (mins));
     return buffer;
index d2483769a814ed921daeb342407bf95dba5d2d2e..35c455dbec21800c8d0fe7a5ae8664ff9345994c 100644 (file)
@@ -159,7 +159,6 @@ static int day_map[] = {
 #define SKIPTOSP()   { while ( !isspace((unsigned char) *cp++) ) ; \
                        --cp; }
 
 #define SKIPTOSP()   { while ( !isspace((unsigned char) *cp++) ) ; \
                        --cp; }
 
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
 # ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
 # endif
 # ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
 # endif
@@ -179,7 +178,6 @@ zonehack (struct tws *tw)
        tw->tw_zone -= 60;
     }
 }
        tw->tw_zone -= 60;
     }
 }
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
 %}
 
 sun    ([Ss]un(day)?)
 %}
 
 sun    ([Ss]un(day)?)
@@ -341,18 +339,14 @@ nl      [ \t\n()]
                                     INIT();
                                     SKIPTOD();
                                     SETZONE(atoi(cp));
                                     INIT();
                                     SKIPTOD();
                                     SETZONE(atoi(cp));
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
                                    zonehack (&tw);
                                    zonehack (&tw);
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
                                    yyterminate();
                                     }
 "-"{D}{d}{d}                                  {
                                     INIT();
                                     SKIPTOD();
                                     SETZONE(-atoi(cp));
                                    yyterminate();
                                     }
 "-"{D}{d}{d}                                  {
                                     INIT();
                                     SKIPTOD();
                                     SETZONE(-atoi(cp));
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
                                    zonehack (&tw);
                                    zonehack (&tw);
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
                                    yyterminate();
                                    
                                     }
                                    yyterminate();
                                    
                                     }