Skip to content

Commit eb90edb

Browse files
committed
py/mpz: Remove obsolete declaration of mpz_as_str_size.
1 parent dcdcc43 commit eb90edb

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

py/mpz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ mp_float_t mpz_as_float(const mpz_t *i) {
16771677
#if 0
16781678
this function is unused
16791679
char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
1680-
char *s = m_new(char, mpz_as_str_size(i, base, NULL, '\0'));
1680+
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;
16831683
}

py/mpz.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +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_size(const mpz_t *i, mp_uint_t base, const char *prefix, char comma);
141140
size_t mpz_as_str_inpl(const mpz_t *z, mp_uint_t base, const char *prefix, char base_char, char comma, char *str);
142141

143142
#endif // __MICROPY_INCLUDED_PY_MPZ_H__

0 commit comments

Comments
 (0)