diff options
| author | Eli Zaretskii | 2008-10-04 13:15:01 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-04 13:15:01 +0000 |
| commit | 12c01aefce9e22ab73b02335e3c964d8f5e12125 (patch) | |
| tree | df03a9d767a62a66813d3a19756d449501ac5e8d /src | |
| parent | 8801ee606dadf514617d1d44fdcb122a28c7e379 (diff) | |
| download | emacs-12c01aefce9e22ab73b02335e3c964d8f5e12125.tar.gz emacs-12c01aefce9e22ab73b02335e3c964d8f5e12125.zip | |
(EMACS_TIME_CMP): Cast EMACS_SECS values to `long'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/systime.h | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 484dfc605d8..50057069c0c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2008-10-04 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-10-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * systime.h (EMACS_TIME_CMP): Cast EMACS_SECS values to `long'. | ||
| 4 | |||
| 3 | * dispnew.c (change_frame_size_1): Set FrameRows and FrameCols for | 5 | * dispnew.c (change_frame_size_1): Set FrameRows and FrameCols for |
| 4 | MSDOS frames as well. | 6 | MSDOS frames as well. |
| 5 | 7 | ||
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)); | |||
| 150 | #endif | 150 | #endif |
| 151 | 151 | ||
| 152 | /* Compare times T1 and T2. Value is 0 if T1 and T2 are the same. | 152 | /* Compare times T1 and T2. Value is 0 if T1 and T2 are the same. |
| 153 | Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */ | 153 | Value is < 0 if T1 is less than T2. Value is > 0 otherwise. (Cast |
| 154 | 154 | to long is for those platforms where time_t is an unsigned | |
| 155 | #define EMACS_TIME_CMP(T1, T2) \ | 155 | type, and where otherwise T1 will always be grater than T2.) */ |
| 156 | (EMACS_SECS (T1) - EMACS_SECS (T2) \ | 156 | |
| 157 | + (EMACS_SECS (T1) == EMACS_SECS (T2) \ | 157 | #define EMACS_TIME_CMP(T1, T2) \ |
| 158 | ? EMACS_USECS (T1) - EMACS_USECS (T2) \ | 158 | ((long)EMACS_SECS (T1) - (long)EMACS_SECS (T2) \ |
| 159 | + (EMACS_SECS (T1) == EMACS_SECS (T2) \ | ||
| 160 | ? EMACS_USECS (T1) - EMACS_USECS (T2) \ | ||
| 159 | : 0)) | 161 | : 0)) |
| 160 | 162 | ||
| 161 | /* Compare times T1 and T2 for equality, inequality etc. */ | 163 | /* Compare times T1 and T2 for equality, inequality etc. */ |