py/objtuple: Convert mp_uint_t to size_t where appropriate.

This commit is contained in:
Damien George
2017-02-16 16:09:51 +11:00
parent 891dc5c62c
commit 229823942c
4 changed files with 18 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ STATIC
#endif
void mp_obj_attrtuple_print_helper(const mp_print_t *print, const qstr *fields, mp_obj_tuple_t *o) {
mp_print_str(print, "(");
for (mp_uint_t i = 0; i < o->len; i++) {
for (size_t i = 0; i < o->len; i++) {
if (i > 0) {
mp_print_str(print, ", ");
}
@@ -59,9 +59,9 @@ STATIC void mp_obj_attrtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
if (dest[0] == MP_OBJ_NULL) {
// load attribute
mp_obj_tuple_t *self = MP_OBJ_TO_PTR(self_in);
mp_uint_t len = self->len;
size_t len = self->len;
const qstr *fields = (const qstr*)MP_OBJ_TO_PTR(self->items[len]);
for (mp_uint_t i = 0; i < len; i++) {
for (size_t i = 0; i < len; i++) {
if (fields[i] == attr) {
dest[0] = self->items[i];
return;
@@ -70,11 +70,11 @@ STATIC void mp_obj_attrtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
}
}
mp_obj_t mp_obj_new_attrtuple(const qstr *fields, mp_uint_t n, const mp_obj_t *items) {
mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj_t *items) {
mp_obj_tuple_t *o = m_new_obj_var(mp_obj_tuple_t, mp_obj_t, n + 1);
o->base.type = &mp_type_attrtuple;
o->len = n;
for (mp_uint_t i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
o->items[i] = items[i];
}
o->items[n] = MP_OBJ_FROM_PTR(fields);