summaryrefslogtreecommitdiff
path: root/src/systime.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2008-10-04 13:15:01 +0000
committerEli Zaretskii <eliz@gnu.org>2008-10-04 13:15:01 +0000
commit12c01aefce9e22ab73b02335e3c964d8f5e12125 (patch)
treedf03a9d767a62a66813d3a19756d449501ac5e8d /src/systime.h
parent8801ee606dadf514617d1d44fdcb122a28c7e379 (diff)
downloademacs-12c01aefce9e22ab73b02335e3c964d8f5e12125.tar.gz
(EMACS_TIME_CMP): Cast EMACS_SECS values to `long'.
Diffstat (limited to 'src/systime.h')
-rw-r--r--src/systime.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/systime.h b/src/systime.h
index 2a04beff757..aa1f5d329f0 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -150,12 +150,14 @@ extern Lisp_Object make_time __P ((time_t));
#endif
/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same.
- Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */
-
-#define EMACS_TIME_CMP(T1, T2) \
- (EMACS_SECS (T1) - EMACS_SECS (T2) \
- + (EMACS_SECS (T1) == EMACS_SECS (T2) \
- ? EMACS_USECS (T1) - EMACS_USECS (T2) \
+ Value is < 0 if T1 is less than T2. Value is > 0 otherwise. (Cast
+ to long is for those platforms where time_t is an unsigned
+ type, and where otherwise T1 will always be grater than T2.) */
+
+#define EMACS_TIME_CMP(T1, T2) \
+ ((long)EMACS_SECS (T1) - (long)EMACS_SECS (T2) \
+ + (EMACS_SECS (T1) == EMACS_SECS (T2) \
+ ? EMACS_USECS (T1) - EMACS_USECS (T2) \
: 0))
/* Compare times T1 and T2 for equality, inequality etc. */