From: Eli Zaretskii Date: Sat, 4 Oct 2008 13:15:01 +0000 (+0000) Subject: (EMACS_TIME_CMP): Cast EMACS_SECS values to `long'. X-Git-Tag: emacs-pretest-23.0.90~2654 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=12c01aefce9e22ab73b02335e3c964d8f5e12125;p=emacs.git (EMACS_TIME_CMP): Cast EMACS_SECS values to `long'. --- diff --git a/src/ChangeLog b/src/ChangeLog index 484dfc605d8..50057069c0c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2008-10-04 Eli Zaretskii + * systime.h (EMACS_TIME_CMP): Cast EMACS_SECS values to `long'. + * dispnew.c (change_frame_size_1): Set FrameRows and FrameCols for MSDOS frames as well. 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. */