diff --git a/include/cyclone/types.h b/include/cyclone/types.h index cb81a4c0..f1c3e9fc 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -1608,7 +1608,7 @@ void Cyc_int2bignum(int n, mp_int *bn); object Cyc_int2bignum2(gc_thread_data *data, int n); // TODO: debug only, remove this function from here! string_type *bignum2string(void *data, bignum2_type *bn, int base); -object str_to_bignum(void *data, object bignum, char *str, char *str_end, int radix); +void _str_to_bignum(void *data, char *str, *char *str_end, int radix); object bignum2_plus_unsigned(void *data, bignum2_type *x, bignum2_type *y, int negp); /* Remaining GC prototypes that require objects to be defined */ diff --git a/runtime.c b/runtime.c index 6cf33318..28e16625 100644 --- a/runtime.c +++ b/runtime.c @@ -2948,13 +2948,22 @@ inline static int hex_char_to_digit(int ch) else return ch - (int)'0'; /* decimal (OR INVALID; handled elsewhere) */ } +void _str_to_bignum(void *data, char *str, *char *str_end, int radix) +{ + TODO: + need to figure out sign, size (using nlz), what else?? + bignum2_type *bn = gc_alloc_bignum2(data, 2); + bn->num_digits = 2; + bn->sign = 0; + str_to_bignum(data, bn, str, str_end, radix); +} + /* Write from digit character stream to bignum. Bignum does not need * to be initialised. Returns the bignum, or a fixnum. Assumes the * string contains only digits that fit within radix (checked by * string->number). */ -//static C_regparm C_word -object str_to_bignum(void *data, object bignum, char *str, char *str_end, int radix) +static object str_to_bignum(void *data, object bignum, char *str, char *str_end, int radix) { int radix_shift, str_digit; uint32_t *digits = C_bignum_digits(bignum),