diff options
-rw-r--r-- | lib.c | 5 | ||||
-rw-r--r-- | mpi/mpi.c | 6 | ||||
-rw-r--r-- | mpi/mpi.h | 2 |
3 files changed, 5 insertions, 8 deletions
@@ -4600,11 +4600,8 @@ val int_str(val str, val base) if ((value == LONG_MAX || value == LONG_MIN) && errno == ERANGE) { val bignum = make_bignum(); - size_t size; - unsigned char *ucs = utf8_dup_to_buf(wcs, &size, 1); - mp_err err = mp_read_radix(mp(bignum), ucs, b); + mp_err err = mp_read_radix(mp(bignum), wcs, b); - free(ucs); /* TODO: make wchar_t version of mp_read_radix. */ gc_hint(str); if (err != MP_OKAY) @@ -156,7 +156,7 @@ int s_mp_cmp_d(mp_int *a, mp_digit d); /* magnitude digit compare */ mp_size s_mp_ispow2(mp_int *v); /* is v a power of 2? */ int s_mp_ispow2d(mp_digit d); /* is d a power of 2? */ -int s_mp_tovalue(int ch, int r); /* convert ch to value */ +int s_mp_tovalue(wchar_t ch, int r); /* convert ch to value */ char s_mp_todigit(int val, int r, int low); /* convert val to digit */ size_t s_mp_outlen(mp_size bits, int r); /* output length in bytes */ @@ -2568,7 +2568,7 @@ mp_size mp_is_pow_two(mp_int *mp) * characters are ignored, and the function reads until a non-digit * character or the end of the string. */ -mp_err mp_read_radix(mp_int *mp, unsigned char *str, int radix) +mp_err mp_read_radix(mp_int *mp, const wchar_t *str, int radix) { size_t ix = 0; int val = 0; @@ -3959,7 +3959,7 @@ int s_mp_ispow2d(mp_digit d) * The results will be odd if you use a radix < 2 or > 62, you are * expected to know what you're up to. */ -int s_mp_tovalue(int ch, int r) +int s_mp_tovalue(wchar_t ch, int r) { int val, xch; @@ -189,7 +189,7 @@ mp_size mp_is_pow_two(mp_int *mp); #define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str)) #endif -mp_nign mp_err mp_read_radix(mp_int *mp, unsigned char *str, int radix); +mp_nign mp_err mp_read_radix(mp_int *mp, const wchar_t *str, int radix); mp_size mp_radix_size(mp_int *mp, int radix); mp_size mp_value_radix_size(mp_size num, mp_size qty, int radix); mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix); |