From 4b789435f8e4bb6ec9ea4bab3d0a109682adafa6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 25 Jan 2019 06:59:29 -0800 Subject: Extend infrastructure for double_intptr_t. We support an unsigned version of the type, and add functions for converting between Lisp values and both types. * arith.c (bignum_dbl_uipt): New function, unsigned companion to existing bignum_dbl_ipt. (c_dbl_num, c_dbl_unum): New functions. * arith.h (bignum_dbl_uipt, c_dbl_num, c_dbl_unum): Declared. * configure (superulong_t, SIZEOF_DOUBLE_INTPTR, DOUBLE_INTPTR_MAX, DOUBLE_INTPTR_MIN, DOUBLE_UINTPTR_MAX, double_uintptr_t): New definitions going into config.h. * lib.h (dbl_cnum, dbl_ucnum): New typedefs: double-sized analogs of cnum and ucnum. * mpi/mpi.c (mp_set_double_uintptr, mp_get_double_uintptr, mp_get_double_intptr): New functions. (s_mp_in_big_range): New static function. (mp_in_double_intptr_range, mp_in_double_uintptr_range): New functions. * mpi/mpi.h (mp_set_double_uintptr, mp_get_double_intptr, mp_get_double_uintptr, mp_in_double_intptr_range, mp_in_double_uintptr_range): Declared. --- lib.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib.h') diff --git a/lib.h b/lib.h index 04ba947b..64a08e3d 100644 --- a/lib.h +++ b/lib.h @@ -30,6 +30,11 @@ typedef int_ptr_t cnum; typedef uint_ptr_t ucnum; +#ifdef HAVE_DOUBLE_INTPTR_T +typedef double_intptr_t dbl_cnum; +typedef double_uintptr_t dbl_ucnum; +#endif + #ifdef __cplusplus #define strip_qual(TYPE, EXPR) (const_cast(EXPR)) #define convert(TYPE, EXPR) (static_cast(EXPR)) -- cgit v1.2.3