changeset 186:09762e848a40

merge with 1.9.2g
author Jim Meyering <jim@meyering.net>
date Thu, 10 Feb 1994 19:14:34 +0000
parents 105b13b6565b
children a6805e98cb7f
files lib/getdate.y lib/getopt.c
diffstat 2 files changed, 23 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -887,27 +887,25 @@
 #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
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -199,15 +199,19 @@
    (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__ */
 
 /* Handle permutation of arguments.  */