diff options
| author | Stefan Monnier | 2022-08-14 10:41:40 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-08-14 10:41:40 -0400 |
| commit | 397fdc22eb140dd80e878528fd65e74da4033fa8 (patch) | |
| tree | 6deb697e389789406e0a0a181ca6292ae56829bb /src | |
| parent | d28f1677c3bdd7c1b20af59e7cc5460616f8e7e9 (diff) | |
| download | emacs-397fdc22eb140dd80e878528fd65e74da4033fa8.tar.gz emacs-397fdc22eb140dd80e878528fd65e74da4033fa8.zip | |
* lisp/calendar/time-date.el (seconds-to-time): Use the original arg list
Diffstat (limited to 'src')
| -rw-r--r-- | src/timefns.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/timefns.c b/src/timefns.c index 7db50ea81cc..edfd73e9b80 100644 --- a/src/timefns.c +++ b/src/timefns.c | |||
| @@ -401,6 +401,10 @@ decode_float_time (double t, struct lisp_time *result) | |||
| 401 | else | 401 | else |
| 402 | { | 402 | { |
| 403 | int scale = double_integer_scale (t); | 403 | int scale = double_integer_scale (t); |
| 404 | /* FIXME: `double_integer_scale` often returns values that are | ||
| 405 | "pessimistic" (i.e. larger than necessary), so 3.5 gets converted | ||
| 406 | to (7881299347898368 . 2251799813685248) rather than (7 . 2). | ||
| 407 | On 64bit systems, this should not matter very much, tho. */ | ||
| 404 | eassume (scale < flt_radix_power_size); | 408 | eassume (scale < flt_radix_power_size); |
| 405 | 409 | ||
| 406 | if (scale < 0) | 410 | if (scale < 0) |
| @@ -1717,8 +1721,6 @@ DEFUN ("time-convert", Ftime_convert, Stime_convert, 1, 2, 0, | |||
| 1717 | doc: /* Convert TIME value to a Lisp timestamp of the given FORM. | 1721 | doc: /* Convert TIME value to a Lisp timestamp of the given FORM. |
| 1718 | Truncate the returned value toward minus infinity. | 1722 | Truncate the returned value toward minus infinity. |
| 1719 | 1723 | ||
| 1720 | If FORM is nil, return the same form as `current-time'. | ||
| 1721 | |||
| 1722 | If FORM is a positive integer, return a pair of integers (TICKS . FORM), | 1724 | If FORM is a positive integer, return a pair of integers (TICKS . FORM), |
| 1723 | where TICKS is the number of clock ticks and FORM is the clock frequency | 1725 | where TICKS is the number of clock ticks and FORM is the clock frequency |
| 1724 | in ticks per second. | 1726 | in ticks per second. |
| @@ -1731,9 +1733,14 @@ If FORM is `integer', return an integer count of seconds. | |||
| 1731 | If FORM is `list', return an integer list (HIGH LOW USEC PSEC), where | 1733 | If FORM is `list', return an integer list (HIGH LOW USEC PSEC), where |
| 1732 | HIGH has the most significant bits of the seconds, LOW has the least | 1734 | HIGH has the most significant bits of the seconds, LOW has the least |
| 1733 | significant 16 bits, and USEC and PSEC are the microsecond and | 1735 | significant 16 bits, and USEC and PSEC are the microsecond and |
| 1734 | picosecond counts. */) | 1736 | picosecond counts. |
| 1737 | |||
| 1738 | If FORM is nil, the behavior depends on `current-time-list', | ||
| 1739 | but new code should not rely on it. */) | ||
| 1735 | (Lisp_Object time, Lisp_Object form) | 1740 | (Lisp_Object time, Lisp_Object form) |
| 1736 | { | 1741 | { |
| 1742 | /* FIXME: Any reason why we don't offer a `float` output format option as | ||
| 1743 | well, since we accept it as input? */ | ||
| 1737 | struct lisp_time t; | 1744 | struct lisp_time t; |
| 1738 | enum timeform input_form = decode_lisp_time (time, false, &t, 0); | 1745 | enum timeform input_form = decode_lisp_time (time, false, &t, 0); |
| 1739 | if (NILP (form)) | 1746 | if (NILP (form)) |