diff options
| author | Paul Eggert | 2011-03-11 22:49:53 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-03-11 22:49:53 -0800 |
| commit | b8d9bd41b7daaa35de8335b20af145a808ae9b07 (patch) | |
| tree | bb00176e7801612ad1de68713f9128446bc9751d /src/ChangeLog | |
| parent | fe31d94c97a6a3702e301a14b84c1f293afe5efd (diff) | |
| download | emacs-b8d9bd41b7daaa35de8335b20af145a808ae9b07.tar.gz emacs-b8d9bd41b7daaa35de8335b20af145a808ae9b07.zip | |
Improve quality of tests for time stamp overflow. For example,
without this patch (encode-time 0 0 0 1 1 1152921504606846976)
returns the obviously-bogus value (-948597 62170) on my RHEL 5.5
x86-64 host. With it, it reports time overflow.
* deps.mk (editfns.o): Depend on ../lib/intprops.h.
* editfns.c: Include limits.h and intprops.h.
(TIME_T_MIN, TIME_T_MAX): New macros.
(time_overflow): Move earlier, to before first use.
(hi_time, lo_time): New functions, for an accurate test for
out-of-range times.
(Fcurrent_time, Fget_internal_run_time, make_time): Use them.
(Fget_internal_run_time): Don't assume time_t fits in int.
(make_time): Use list2 instead of Fcons twice.
(Fdecode_time): More accurate test for out-of-range times.
(check_tm_member): New function.
(Fencode_time): Use it, to test for out-of-range times.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a0c4941ec1c..b3362b9fbca 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2011-03-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Improve quality of tests for time stamp overflow. For example, | ||
| 4 | without this patch (encode-time 0 0 0 1 1 1152921504606846976) | ||
| 5 | returns the obviously-bogus value (-948597 62170) on my RHEL 5.5 | ||
| 6 | x86-64 host. With it, it reports time overflow. | ||
| 7 | * deps.mk (editfns.o): Depend on ../lib/intprops.h. | ||
| 8 | * editfns.c: Include limits.h and intprops.h. | ||
| 9 | (TIME_T_MIN, TIME_T_MAX): New macros. | ||
| 10 | (time_overflow): Move earlier, to before first use. | ||
| 11 | (hi_time, lo_time): New functions, for an accurate test for | ||
| 12 | out-of-range times. | ||
| 13 | (Fcurrent_time, Fget_internal_run_time, make_time): Use them. | ||
| 14 | (Fget_internal_run_time): Don't assume time_t fits in int. | ||
| 15 | (make_time): Use list2 instead of Fcons twice. | ||
| 16 | (Fdecode_time): More accurate test for out-of-range times. | ||
| 17 | (check_tm_member): New function. | ||
| 18 | (Fencode_time): Use it, to test for out-of-range times. | ||
| 19 | |||
| 1 | 2011-03-11 Paul Eggert <eggert@cs.ucla.edu> | 20 | 2011-03-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 21 | ||
| 3 | * editfns.c (time_overflow): New function, refactoring common code. | 22 | * editfns.c (time_overflow): New function, refactoring common code. |