# HG changeset patch # User Eli Zaretskii # Date 1223126027 0 # Node ID eaf4c07b3539aa9e36defff7ff1241778d050384 # Parent 46fbf568b2bd1499a1319c6614f451cdc4c9db91 (EMACS_TIME_CMP): Cast EMACS_SECS values to `long'. diff -r 46fbf568b2bd -r eaf4c07b3539 src/systime.h --- a/src/systime.h Sat Oct 04 10:22:19 2008 +0000 +++ b/src/systime.h Sat Oct 04 13:13:47 2008 +0000 @@ -150,12 +150,14 @@ #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. */ + 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) \ - (EMACS_SECS (T1) - EMACS_SECS (T2) \ - + (EMACS_SECS (T1) == EMACS_SECS (T2) \ - ? EMACS_USECS (T1) - EMACS_USECS (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. */