Skip to content

Commit da36f52

Browse files
committed
py/objint: Convert mp_uint_t to size_t where appropriate.
1 parent fa5a591 commit da36f52

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

py/obj.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ static inline mp_obj_t mp_obj_new_bool(mp_int_t x) { return x ? mp_const_true :
607607
mp_obj_t mp_obj_new_cell(mp_obj_t obj);
608608
mp_obj_t mp_obj_new_int(mp_int_t value);
609609
mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value);
610-
mp_obj_t mp_obj_new_int_from_str_len(const char **str, mp_uint_t len, bool neg, mp_uint_t base);
610+
mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool neg, unsigned int base);
611611
mp_obj_t mp_obj_new_int_from_ll(long long val); // this must return a multi-precision integer object (or raise an overflow exception)
612612
mp_obj_t mp_obj_new_int_from_ull(unsigned long long val); // this must return a multi-precision integer object (or raise an overflow exception)
613613
mp_obj_t mp_obj_new_str(const char* data, size_t len, bool make_qstr_if_not_already);

py/objint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
291291
}
292292

293293
// This is called only with strings whose value doesn't fit in SMALL_INT
294-
mp_obj_t mp_obj_new_int_from_str_len(const char **str, mp_uint_t len, bool neg, mp_uint_t base) {
294+
mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool neg, unsigned int base) {
295295
mp_raise_msg(&mp_type_OverflowError, "long int not supported in this build");
296296
return mp_const_none;
297297
}

py/objint_longlong.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ mp_obj_t mp_obj_new_int_from_float(mp_float_t val) {
273273
}
274274
#endif
275275

276-
mp_obj_t mp_obj_new_int_from_str_len(const char **str, mp_uint_t len, bool neg, mp_uint_t base) {
276+
mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool neg, unsigned int base) {
277277
// TODO this does not honor the given length of the string, but it all cases it should anyway be null terminated
278278
// TODO check overflow
279279
mp_obj_int_t *o = m_new_obj(mp_obj_int_t);

py/objint_mpz.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ mp_obj_t mp_obj_new_int_from_float(mp_float_t val) {
407407
}
408408
#endif
409409

410-
mp_obj_t mp_obj_new_int_from_str_len(const char **str, mp_uint_t len, bool neg, mp_uint_t base) {
410+
mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool neg, unsigned int base) {
411411
mp_obj_int_t *o = mp_obj_int_new_mpz();
412-
mp_uint_t n = mpz_set_from_str(&o->mpz, *str, len, neg, base);
412+
size_t n = mpz_set_from_str(&o->mpz, *str, len, neg, base);
413413
*str += n;
414414
return MP_OBJ_FROM_PTR(o);
415415
}

0 commit comments

Comments
 (0)