From 3fb00e685379c2580c58cf73389ffa5e5b655a3a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 10 Feb 1994 19:14:34 +0000 Subject: [PATCH] merge with 1.9.2g --- lib/getdate.y | 32 +++++++++++++++----------------- lib/getopt.c | 12 ++++++++---- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/getdate.y b/lib/getdate.y index 35d064f48a..63b9e7cfa8 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -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 diff --git a/lib/getopt.c b/lib/getopt.c index 2f1e6d8d7a..6cdedb019b 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -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 -#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. */ -- 2.30.2