From fa5a591757569136a444715cce2248b63ad73512 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 16 Feb 2017 16:38:14 +1100 Subject: [PATCH] py/objexcept: Convert mp_uint_t to size_t where appropriate. --- py/obj.h | 2 +- py/objexcept.c | 2 +- py/objexcept.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/obj.h b/py/obj.h index d28623e64c..1b926ce144 100644 --- a/py/obj.h +++ b/py/obj.h @@ -621,7 +621,7 @@ mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag); #endif mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type); mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg); -mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, mp_uint_t n_args, const mp_obj_t *args); +mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, size_t n_args, const mp_obj_t *args); mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg); mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); // counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!) mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args, mp_obj_t def_kw_args, const byte *code, const mp_uint_t *const_table); diff --git a/py/objexcept.c b/py/objexcept.c index 76d34f56e4..1f1009ff78 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -312,7 +312,7 @@ mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg) return mp_obj_new_exception_args(exc_type, 1, &arg); } -mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, mp_uint_t n_args, const mp_obj_t *args) { +mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, size_t n_args, const mp_obj_t *args) { assert(exc_type->make_new == mp_obj_exception_make_new); return exc_type->make_new(exc_type, n_args, 0, args); } diff --git a/py/objexcept.h b/py/objexcept.h index 88bce2b370..3128fded79 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -31,8 +31,8 @@ typedef struct _mp_obj_exception_t { mp_obj_base_t base; - mp_uint_t traceback_alloc : (BITS_PER_WORD / 2); - mp_uint_t traceback_len : (BITS_PER_WORD / 2); + size_t traceback_alloc : (8 * sizeof(size_t) / 2); + size_t traceback_len : (8 * sizeof(size_t) / 2); size_t *traceback_data; mp_obj_tuple_t *args; } mp_obj_exception_t;