summaryrefslogtreecommitdiffstatshomepage
path: root/py/objattrtuple.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-16 16:09:51 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-16 16:51:16 +1100
commit229823942c79b1233c43dc155bae01c20a8cec57 (patch)
treec8d34335c09b21505c8d853868d68f02eb0bbcb5 /py/objattrtuple.c
parent891dc5c62ce9b266f0352fc96ed78f36ee9fc825 (diff)
downloadmicropython-229823942c79b1233c43dc155bae01c20a8cec57.tar.gz
micropython-229823942c79b1233c43dc155bae01c20a8cec57.zip
py/objtuple: Convert mp_uint_t to size_t where appropriate.
Diffstat (limited to 'py/objattrtuple.c')
-rw-r--r--py/objattrtuple.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/py/objattrtuple.c b/py/objattrtuple.c
index c6dd3aeacf..8c5e795757 100644
--- a/py/objattrtuple.c
+++ b/py/objattrtuple.c
@@ -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);