merge with 1.9.2g
authorJim Meyering <jim@meyering.net>
Thu, 10 Feb 1994 19:14:34 +0000 (19:14 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 10 Feb 1994 19:14:34 +0000 (19:14 +0000)
lib/getdate.y
lib/getopt.c

index 35d064f..63b9e7c 100644 (file)
@@ -887,27 +887,25 @@ yylex()
 #define TM_YEAR_ORIGIN 1900
 
 /* Yield A - B, measured in seconds.  */
-static time_t
-difftm(a, b)
+static long
+difftm (a, b)
      struct tm *a, *b;
 {
   int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
   int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
-  return
-    (
-     (
-      (
-       /* difference in day of year */
-       a->tm_yday - b->tm_yday
-       /* + intervening leap days */
-       +  ((ay >> 2) - (by >> 2))
-       -  (ay/100 - by/100)
-       +  ((ay/100 >> 2) - (by/100 >> 2))
-       /* + difference in years * 365 */
-       +  (time_t)(ay-by) * 365
-       )*24 + (a->tm_hour - b->tm_hour)
-      )*60 + (a->tm_min - b->tm_min)
-     )*60 + (a->tm_sec - b->tm_sec);
+  int days = (
+             /* difference in day of year */
+             a->tm_yday - b->tm_yday
+             /* + intervening leap days */
+             +  ((ay >> 2) - (by >> 2))
+             -  (ay/100 - by/100)
+             +  ((ay/100 >> 2) - (by/100 >> 2))
+             /* + difference in years * 365 */
+             +  (long)(ay-by) * 365
+             );
+  return (60*(60*(24*days + (a->tm_hour - b->tm_hour))
+             + (a->tm_min - b->tm_min))
+         + (a->tm_sec - b->tm_sec));
 }
 
 time_t
index 2f1e6d8..6cdedb0 100644 (file)
@@ -199,15 +199,19 @@ my_index (str, chr)
    (Supposedly there are some machines where it might get a warning,
    but changing this conditional to __STDC__ is too risky.)  */
 #ifdef __GNUC__
+#if ! (defined (emacs) && !defined (__STDC__))
 #ifdef IN_GCC
 #include "gstddef.h"
-#else
+#else /* not IN_GCC */
+/* Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+   Enable Emacs to compile on it.  */
 #include <stddef.h>
-#endif
+#endif /* not IN_GCC */
 extern size_t strlen (const char *);
-#endif
+#endif /* ! (defined (emacs) && !defined (__STDC__)) */
+#endif /* __GNUC__ */
 
-#endif                         /* GNU C library.  */
+#endif /* not __GNU_LIBRARY__ */
 \f
 /* Handle permutation of arguments.  */