summaryrefslogtreecommitdiffstatshomepage
path: root/py/objlist.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-03 14:21:40 +0000
committerDamien George <damien.p.george@gmail.com>2016-01-11 00:49:27 +0000
commit4b72b3a133ea87a1ef8b964508dc25c551ccf093 (patch)
treee00ae8b891475f1a5d76bd2401d20a4dfb26e1e1 /py/objlist.c
parenta0c97814dfcb0debbde8be99539e3d5ca2334e54 (diff)
downloadmicropython-4b72b3a133ea87a1ef8b964508dc25c551ccf093.tar.gz
micropython-4b72b3a133ea87a1ef8b964508dc25c551ccf093.zip
py: Change type signature of builtin funs that take variable or kw args.
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
Diffstat (limited to 'py/objlist.c')
-rw-r--r--py/objlist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objlist.c b/py/objlist.c
index 059fec1b25..3fd38e81d9 100644
--- a/py/objlist.c
+++ b/py/objlist.c
@@ -36,7 +36,7 @@
STATIC mp_obj_t mp_obj_new_list_iterator(mp_obj_t list, mp_uint_t cur);
STATIC mp_obj_list_t *list_new(mp_uint_t n);
STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in);
-STATIC mp_obj_t list_pop(mp_uint_t n_args, const mp_obj_t *args);
+STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args);
// TODO: Move to mpconfig.h
#define LIST_MIN_ALLOC 4
@@ -262,7 +262,7 @@ STATIC mp_obj_t list_extend(mp_obj_t self_in, mp_obj_t arg_in) {
return mp_const_none; // return None, as per CPython
}
-STATIC mp_obj_t list_pop(mp_uint_t n_args, const mp_obj_t *args) {
+STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) {
assert(1 <= n_args && n_args <= 2);
assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list));
mp_obj_list_t *self = MP_OBJ_TO_PTR(args[0]);
@@ -311,7 +311,7 @@ STATIC void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, mp_obj
}
// TODO Python defines sort to be stable but ours is not
-mp_obj_t mp_obj_list_sort(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
+mp_obj_t mp_obj_list_sort(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_reverse, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
@@ -355,7 +355,7 @@ STATIC mp_obj_t list_count(mp_obj_t self_in, mp_obj_t value) {
return mp_seq_count_obj(self->items, self->len, value);
}
-STATIC mp_obj_t list_index(mp_uint_t n_args, const mp_obj_t *args) {
+STATIC mp_obj_t list_index(size_t n_args, const mp_obj_t *args) {
assert(2 <= n_args && n_args <= 4);
assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list));
mp_obj_list_t *self = MP_OBJ_TO_PTR(args[0]);