diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-01-18 10:43:02 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-01-18 10:43:02 -0800 |
commit | a666ae690ad548b5f357e70ed124aa3ab64afa5b (patch) | |
tree | 41ef41689b4d7852a65977d53903a57fcca0600c /mpi/mpi.h | |
parent | fe4a764a7d40c79b25c5fe0278bded857864f416 (diff) | |
download | txr-a666ae690ad548b5f357e70ed124aa3ab64afa5b.tar.gz txr-a666ae690ad548b5f357e70ed124aa3ab64afa5b.tar.bz2 txr-a666ae690ad548b5f357e70ed124aa3ab64afa5b.zip |
mpi: use wchar_t string for text-to-bignum.
* mpi/mpi.c (mp_read_radix): Take const wchar_t * string
rather than unsigned char *.
(s_mp_tovalue): Take character argument as wchar_t rather
than int.
* mpi/mpi.h (mp_read_radix): Declaration updated.
* lib.c (int_str): Avoid a malloc/free and UTF-8 conversion by
passing the original wide string to mp_read_radix.
This removes a TODO dating back to December 2011.
Diffstat (limited to 'mpi/mpi.h')
-rw-r--r-- | mpi/mpi.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |