aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorPaul Eggert2018-09-04 19:14:01 -0700
committerPaul Eggert2018-09-04 19:15:57 -0700
commitecb985c10d5241a65ab9552ebfcecaa150b35427 (patch)
treec4f12a76561d84518c597cb8e25cfd3813023456 /src/emacs-module.c
parente3661f8c35b3057c58e8c0b474f597697ce413ba (diff)
downloademacs-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/emacs-module.c')
-rw-r--r--src/emacs-module.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 2ba5540d9a1..6155535f869 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -519,14 +519,10 @@ module_extract_integer (emacs_env *env, emacs_value n)
519 MODULE_FUNCTION_BEGIN (0); 519 MODULE_FUNCTION_BEGIN (0);
520 Lisp_Object l = value_to_lisp (n); 520 Lisp_Object l = value_to_lisp (n);
521 CHECK_INTEGER (l); 521 CHECK_INTEGER (l);
522 if (BIGNUMP (l)) 522 intmax_t i;
523 { 523 if (! integer_to_intmax (l, &i))
524 intmax_t i = bignum_to_intmax (l); 524 xsignal1 (Qoverflow_error, l);
525 if (i == 0) 525 return i;
526 xsignal1 (Qoverflow_error, l);
527 return i;
528 }
529 return XFIXNUM (l);
530} 526}
531 527
532static emacs_value 528static emacs_value