enhanded make_bigint_with_ooi() to handle MOO_TYPE_MIN(moo_ooi_t)

This commit is contained in:
hyunghwan.chung
2019-08-11 16:15:55 +00:00
parent 273e2d4d02
commit 32341c1773
3 changed files with 58 additions and 21 deletions

View File

@ -2185,6 +2185,15 @@ MOO_EXPORT moo_oop_t moo_makestringwithbchars (
# define moo_makestring(moo,ptr,len) moo_makestringwithbchars(moo,ptr,len)
#endif
#if (MOO_SIZEOF_UINTMAX_T == MOO_SIZEOF_OOW_T)
# define moo_inttouintmax moo_inttooow
# define moo_inttointmax moo_inttoooi
# define moo_uintmaxtoint moo_oowtoint
# define moo_intmaxtoint moo_ooitoint
#else
MOO_EXPORT moo_oop_t moo_oowtoint (
moo_t* moo,
moo_oow_t w
@ -2195,7 +2204,6 @@ MOO_EXPORT moo_oop_t moo_ooitoint (
moo_ooi_t i
);
MOO_EXPORT int moo_inttooow (
moo_t* moo,
moo_oop_t x,
@ -2208,10 +2216,16 @@ MOO_EXPORT int moo_inttoooi (
moo_ooi_t* i
);
#if (MOO_SIZEOF_UINTMAX_T == MOO_SIZEOF_OOW_T)
# define moo_inttouintmax moo_inttooow
# define moo_inttointmax moo_inttoooi
#else
MOO_EXPORT moo_oop_t moo_intmaxtoint (
moo_t* moo,
moo_intmax_t i
);
/*MOO_EXPORT moo_oop_t moo_uintmaxtoint (
moo_t* moo,
moo_uintmax_t i
);*/
MOO_EXPORT int moo_inttouintmax (
moo_t* moo,
moo_oop_t x,