diff options
| author | Paul Eggert | 2018-09-04 19:14:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-09-04 19:15:57 -0700 |
| commit | ecb985c10d5241a65ab9552ebfcecaa150b35427 (patch) | |
| tree | c4f12a76561d84518c597cb8e25cfd3813023456 /src/dispnew.c | |
| parent | e3661f8c35b3057c58e8c0b474f597697ce413ba (diff) | |
| download | emacs-ecb985c10d5241a65ab9552ebfcecaa150b35427.tar.gz emacs-ecb985c10d5241a65ab9552ebfcecaa150b35427.zip | |
Simplify bignum->intmax conversion
* src/lisp.h (integer_to_intmax, integer_to_uintmax): New functions.
* src/data.c (cons_to_unsigned, cons_to_signed)
(arith_driver):
* src/dbusbind.c (xd_extract_signed, xd_extract_unsigned):
* src/dispnew.c (sit_for):
* src/editfns.c (styled_format):
* src/emacs-module.c (module_extract_integer):
* src/fileio.c (file_offset):
* src/font.c (font_unparse_xlfd, Fopen_font):
* src/xdisp.c (calc_line_height_property):
* src/process.c (handle_child_signal):
Diffstat (limited to 'src/dispnew.c')
| -rw-r--r-- | src/dispnew.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index bd246799b23..798413d091c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5765,20 +5765,20 @@ sit_for (Lisp_Object timeout, bool reading, int display_option) | |||
| 5765 | if (display_option > 1) | 5765 | if (display_option > 1) |
| 5766 | redisplay_preserve_echo_area (2); | 5766 | redisplay_preserve_echo_area (2); |
| 5767 | 5767 | ||
| 5768 | if (FIXNUMP (timeout)) | 5768 | if (INTEGERP (timeout)) |
| 5769 | { | 5769 | { |
| 5770 | sec = XFIXNUM (timeout); | 5770 | if (integer_to_intmax (timeout, &sec)) |
| 5771 | if (sec <= 0) | 5771 | { |
| 5772 | return Qt; | 5772 | if (sec <= 0) |
| 5773 | nsec = 0; | 5773 | return Qt; |
| 5774 | } | 5774 | sec = min (sec, WAIT_READING_MAX); |
| 5775 | else if (BIGNUMP (timeout)) | 5775 | } |
| 5776 | { | 5776 | else |
| 5777 | if (NILP (Fnatnump (timeout))) | 5777 | { |
| 5778 | return Qt; | 5778 | if (NILP (Fnatnump (timeout))) |
| 5779 | sec = bignum_to_intmax (timeout); | 5779 | return Qt; |
| 5780 | if (sec == 0) | 5780 | sec = WAIT_READING_MAX; |
| 5781 | sec = WAIT_READING_MAX; | 5781 | } |
| 5782 | nsec = 0; | 5782 | nsec = 0; |
| 5783 | } | 5783 | } |
| 5784 | else if (FLOATP (timeout)) | 5784 | else if (FLOATP (timeout)) |