summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-02-10 19:14:24 +0000
committerJim Meyering <jim@meyering.net>1994-02-10 19:14:24 +0000
commit4caa3d07cfffdb530250195f9df116d39b6fbcd0 (patch)
tree68fb192aa9380b9845c365cf7a65b79da3d29c80 /lib
parent589f6b1c17d8fe77d001d3ef8a0b40c748073f1a (diff)
downloadcoreutils-4caa3d07cfffdb530250195f9df116d39b6fbcd0.tar.xz
merge with 1.9.2g
Diffstat (limited to 'lib')
-rw-r--r--lib/getdate.y32
-rw-r--r--lib/getopt.c12
2 files changed, 23 insertions, 21 deletions
diff --git a/lib/getdate.y b/lib/getdate.y
index 35d064f48..63b9e7cfa 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 2f1e6d8d7..6cdedb019 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 <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. */