Skip to content

Commit 6ed77be

Browse files
committed
py/mpz: Change type of "base" args from mp_uint_t to unsigned int.
1 parent eb90edb commit 6ed77be

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

py/mpz.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ mpz_t *mpz_from_float(mp_float_t val) {
705705
}
706706
#endif
707707

708-
mpz_t *mpz_from_str(const char *str, size_t len, bool neg, mp_uint_t base) {
708+
mpz_t *mpz_from_str(const char *str, size_t len, bool neg, unsigned int base) {
709709
mpz_t *z = mpz_zero();
710710
mpz_set_from_str(z, str, len, neg, base);
711711
return z;
@@ -873,7 +873,7 @@ typedef uint32_t mp_float_int_t;
873873
#endif
874874

875875
// returns number of bytes from str that were processed
876-
size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, mp_uint_t base) {
876+
size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, unsigned int base) {
877877
assert(base <= 36);
878878

879879
const char *cur = str;
@@ -1676,7 +1676,7 @@ mp_float_t mpz_as_float(const mpz_t *i) {
16761676

16771677
#if 0
16781678
this function is unused
1679-
char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
1679+
char *mpz_as_str(const mpz_t *i, unsigned int base) {
16801680
char *s = m_new(char, mp_int_format_size(mpz_max_num_bits(i), base, NULL, '\0'));
16811681
mpz_as_str_inpl(i, base, NULL, 'a', '\0', s);
16821682
return s;
@@ -1685,7 +1685,7 @@ char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
16851685

16861686
// assumes enough space as calculated by mp_int_format_size
16871687
// returns length of string, not including null byte
1688-
size_t mpz_as_str_inpl(const mpz_t *i, mp_uint_t base, const char *prefix, char base_char, char comma, char *str) {
1688+
size_t mpz_as_str_inpl(const mpz_t *i, unsigned int base, const char *prefix, char base_char, char comma, char *str) {
16891689
if (str == NULL) {
16901690
return 0;
16911691
}

py/mpz.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void mpz_set_from_ll(mpz_t *z, long long i, bool is_signed);
108108
#if MICROPY_PY_BUILTINS_FLOAT
109109
void mpz_set_from_float(mpz_t *z, mp_float_t src);
110110
#endif
111-
size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, mp_uint_t base);
111+
size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg, unsigned int base);
112112
void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf);
113113

114114
bool mpz_is_zero(const mpz_t *z);
@@ -137,6 +137,6 @@ void mpz_as_bytes(const mpz_t *z, bool big_endian, size_t len, byte *buf);
137137
#if MICROPY_PY_BUILTINS_FLOAT
138138
mp_float_t mpz_as_float(const mpz_t *z);
139139
#endif
140-
size_t mpz_as_str_inpl(const mpz_t *z, mp_uint_t base, const char *prefix, char base_char, char comma, char *str);
140+
size_t mpz_as_str_inpl(const mpz_t *z, unsigned int base, const char *prefix, char base_char, char comma, char *str);
141141

142142
#endif // __MICROPY_INCLUDED_PY_MPZ_H__

0 commit comments

Comments
 (0)