From dfc0bac086a0277cc1c3d6a72ee906214bbbf9ac Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 7 Jan 2014 23:18:54 +0000 Subject: [PATCH] py: Small big fix to type declarations. --- py/obj.h | 4 ++-- py/objlist.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/obj.h b/py/obj.h index 332867a194..71b43cb8d1 100644 --- a/py/obj.h +++ b/py/obj.h @@ -49,7 +49,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t; #define MP_DEFINE_CONST_FUN_OBJ_3(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, 3, 3, (mp_fun_3_t)fun_name) #define MP_DEFINE_CONST_FUN_OBJ_VAR(obj_name, n_args_min, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, n_args_min, (~((machine_uint_t)0)), (mp_fun_var_t)fun_name) #define MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(obj_name, n_args_min, n_args_max, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, n_args_min, n_args_max, (mp_fun_var_t)fun_name) -#define MP_DEFINE_CONST_FUN_OBJ_KW(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, true, 0, (~((machine_uint_t)0)), (mp_fun_var_t)fun_name) +#define MP_DEFINE_CONST_FUN_OBJ_KW(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, true, 0, (~((machine_uint_t)0)), (mp_fun_kw_t)fun_name) // Need to declare this here so we are not dependent on map.h struct _mp_map_t; @@ -62,7 +62,7 @@ typedef mp_obj_t (*mp_fun_2_t)(mp_obj_t, mp_obj_t); typedef mp_obj_t (*mp_fun_3_t)(mp_obj_t, mp_obj_t, mp_obj_t); typedef mp_obj_t (*mp_fun_t)(void); typedef mp_obj_t (*mp_fun_var_t)(int n, const mp_obj_t *); -typedef mp_obj_t (*mp_fun_kw_t)(mp_obj_t*, struct _mp_map_t*); +typedef mp_obj_t (*mp_fun_kw_t)(mp_obj_t, struct _mp_map_t*); typedef void (*mp_print_fun_t)(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o); typedef mp_obj_t (*mp_make_new_fun_t)(mp_obj_t type_in, int n_args, const mp_obj_t *args); // args are in reverse order in the array diff --git a/py/objlist.c b/py/objlist.c index 5162fa09ff..e3d92b9e92 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -143,9 +143,9 @@ static void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, bool r } } -static mp_obj_t list_sort(mp_obj_t *args, mp_map_t *kwargs) { +static mp_obj_t list_sort(mp_obj_t args, mp_map_t *kwargs) { mp_obj_t *args_items = NULL; - machine_uint_t args_len = 0; + uint args_len = 0; qstr key_idx = qstr_from_str_static("key"); qstr reverse_idx = qstr_from_str_static("reverse");