diff options
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index d244bc02d4b..78c25f97dc8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3297,6 +3297,39 @@ extern Lisp_Object bignum_to_string (Lisp_Object, int); | |||
| 3297 | extern Lisp_Object make_bignum_str (char const *, int); | 3297 | extern Lisp_Object make_bignum_str (char const *, int); |
| 3298 | extern Lisp_Object double_to_bignum (double); | 3298 | extern Lisp_Object double_to_bignum (double); |
| 3299 | 3299 | ||
| 3300 | /* Converthe integer NUM to *N. Return true if successful, false | ||
| 3301 | (possibly setting *N) otherwise. */ | ||
| 3302 | INLINE bool | ||
| 3303 | integer_to_intmax (Lisp_Object num, intmax_t *n) | ||
| 3304 | { | ||
| 3305 | if (FIXNUMP (num)) | ||
| 3306 | { | ||
| 3307 | *n = XFIXNUM (num); | ||
| 3308 | return true; | ||
| 3309 | } | ||
| 3310 | else | ||
| 3311 | { | ||
| 3312 | intmax_t i = bignum_to_intmax (num); | ||
| 3313 | *n = i; | ||
| 3314 | return i != 0; | ||
| 3315 | } | ||
| 3316 | } | ||
| 3317 | INLINE bool | ||
| 3318 | integer_to_uintmax (Lisp_Object num, uintmax_t *n) | ||
| 3319 | { | ||
| 3320 | if (FIXNUMP (num)) | ||
| 3321 | { | ||
| 3322 | *n = XFIXNUM (num); | ||
| 3323 | return 0 <= XFIXNUM (num); | ||
| 3324 | } | ||
| 3325 | else | ||
| 3326 | { | ||
| 3327 | uintmax_t i = bignum_to_uintmax (num); | ||
| 3328 | *n = i; | ||
| 3329 | return i != 0; | ||
| 3330 | } | ||
| 3331 | } | ||
| 3332 | |||
| 3300 | /* Defined in data.c. */ | 3333 | /* Defined in data.c. */ |
| 3301 | extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object); | 3334 | extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object); |
| 3302 | extern void notify_variable_watchers (Lisp_Object, Lisp_Object, | 3335 | extern void notify_variable_watchers (Lisp_Object, Lisp_Object, |