Skip to content

Commit a0c9781

Browse files
committed
py: Change type of .make_new and .call args: mp_uint_t becomes size_t.
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
1 parent 66d0c10 commit a0c9781

35 files changed

+52
-52
lines changed

extmod/moductypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ STATIC NORETURN void syntax_error(void) {
121121
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "syntax error in uctypes descriptor"));
122122
}
123123

124-
STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
124+
STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
125125
mp_arg_check_num(n_args, n_kw, 2, 3, false);
126126
mp_obj_uctypes_struct_t *o = m_new_obj(mp_obj_uctypes_struct_t);
127127
o->base.type = MP_OBJ_TO_PTR(type_in);

extmod/moduhashlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ typedef struct _mp_obj_hash_t {
4141

4242
STATIC mp_obj_t hash_update(mp_obj_t self_in, mp_obj_t arg);
4343

44-
STATIC mp_obj_t hash_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
44+
STATIC mp_obj_t hash_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4545
mp_arg_check_num(n_args, n_kw, 0, 1, false);
4646
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(CRYAL_SHA256_CTX));
4747
o->base.type = MP_OBJ_TO_PTR(type_in);

py/obj.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ typedef enum {
408408
} mp_print_kind_t;
409409

410410
typedef void (*mp_print_fun_t)(const mp_print_t *print, mp_obj_t o, mp_print_kind_t kind);
411-
typedef mp_obj_t (*mp_make_new_fun_t)(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
412-
typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
411+
typedef mp_obj_t (*mp_make_new_fun_t)(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
412+
typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, size_t n_args, size_t n_kw, const mp_obj_t *args);
413413
typedef mp_obj_t (*mp_unary_op_fun_t)(mp_uint_t op, mp_obj_t);
414414
typedef mp_obj_t (*mp_binary_op_fun_t)(mp_uint_t op, mp_obj_t, mp_obj_t);
415415
typedef void (*mp_attr_fun_t)(mp_obj_t self_in, qstr attr, mp_obj_t *dest);
@@ -691,7 +691,7 @@ void mp_obj_exception_clear_traceback(mp_obj_t self_in);
691691
void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qstr block);
692692
void mp_obj_exception_get_traceback(mp_obj_t self_in, size_t *n, size_t **values);
693693
mp_obj_t mp_obj_exception_get_value(mp_obj_t self_in);
694-
mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
694+
mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
695695
mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in);
696696
void mp_init_emergency_exception_buf(void);
697697

py/objarray.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) {
168168
#endif
169169

170170
#if MICROPY_PY_ARRAY
171-
STATIC mp_obj_t array_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
171+
STATIC mp_obj_t array_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
172172
(void)type_in;
173173
mp_arg_check_num(n_args, n_kw, 1, 2, false);
174174

@@ -187,7 +187,7 @@ STATIC mp_obj_t array_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
187187
#endif
188188

189189
#if MICROPY_PY_BUILTINS_BYTEARRAY
190-
STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
190+
STATIC mp_obj_t bytearray_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
191191
(void)type_in;
192192
mp_arg_check_num(n_args, n_kw, 0, 1, false);
193193

@@ -219,7 +219,7 @@ mp_obj_t mp_obj_new_memoryview(byte typecode, mp_uint_t nitems, void *items) {
219219
return MP_OBJ_FROM_PTR(self);
220220
}
221221

222-
STATIC mp_obj_t memoryview_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
222+
STATIC mp_obj_t memoryview_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
223223
(void)type_in;
224224

225225
// TODO possibly allow memoryview constructor to take start/stop so that one

py/objbool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ STATIC void bool_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
5252
}
5353
}
5454

55-
STATIC mp_obj_t bool_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
55+
STATIC mp_obj_t bool_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
5656
(void)type_in;
5757
mp_arg_check_num(n_args, n_kw, 0, 1, false);
5858

py/objboundmeth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ STATIC void bound_meth_print(const mp_print_t *print, mp_obj_t o_in, mp_print_ki
4747
}
4848
#endif
4949

50-
STATIC mp_obj_t bound_meth_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
50+
STATIC mp_obj_t bound_meth_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
5151
mp_obj_bound_meth_t *self = MP_OBJ_TO_PTR(self_in);
5252

5353
// need to insert self->self before all other args and then call self->meth

py/objclosure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef struct _mp_obj_closure_t {
3636
mp_obj_t closed[];
3737
} mp_obj_closure_t;
3838

39-
STATIC mp_obj_t closure_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
39+
STATIC mp_obj_t closure_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4040
mp_obj_closure_t *self = MP_OBJ_TO_PTR(self_in);
4141

4242
// need to concatenate closed-over-vars and args

py/objcomplex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ STATIC void complex_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_
6969
}
7070
}
7171

72-
STATIC mp_obj_t complex_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
72+
STATIC mp_obj_t complex_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
7373
(void)type_in;
7474
mp_arg_check_num(n_args, n_kw, 0, 2, false);
7575

py/objdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ STATIC void dict_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
8282
}
8383
}
8484

85-
STATIC mp_obj_t dict_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
85+
STATIC mp_obj_t dict_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
8686
mp_obj_t dict_out = mp_obj_new_dict(0);
8787
mp_obj_dict_t *dict = MP_OBJ_TO_PTR(dict_out);
8888
dict->base.type = MP_OBJ_TO_PTR(type_in);

py/objenumerate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ STATIC const mp_arg_t enumerate_make_new_args[] = {
4545
};
4646
#define ENUMERATE_MAKE_NEW_NUM_ARGS MP_ARRAY_SIZE(enumerate_make_new_args)
4747

48-
STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
48+
STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4949
#if MICROPY_CPYTHON_COMPAT
5050
// parse args
5151
mp_arg_val_t vals[ENUMERATE_MAKE_NEW_NUM_ARGS];

py/objexcept.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ STATIC void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_pr
114114
mp_obj_tuple_print(print, MP_OBJ_FROM_PTR(o->args), kind);
115115
}
116116

117-
mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
117+
mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
118118
mp_arg_check_num(n_args, n_kw, 0, MP_OBJ_FUN_ARGS_MAX, false);
119119
mp_obj_exception_t *o = m_new_obj_var_maybe(mp_obj_exception_t, mp_obj_t, 0);
120120
if (o == NULL) {

py/objfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef struct _mp_obj_filter_t {
3434
mp_obj_t iter;
3535
} mp_obj_filter_t;
3636

37-
STATIC mp_obj_t filter_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
37+
STATIC mp_obj_t filter_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
3838
mp_arg_check_num(n_args, n_kw, 2, 2, false);
3939
mp_obj_filter_t *o = m_new_obj(mp_obj_filter_t);
4040
o->base.type = MP_OBJ_TO_PTR(type_in);

py/objfloat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ STATIC void float_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t
6969
}
7070
}
7171

72-
STATIC mp_obj_t float_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
72+
STATIC mp_obj_t float_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
7373
(void)type_in;
7474
mp_arg_check_num(n_args, n_kw, 0, 1, false);
7575

py/objfun.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
// mp_obj_fun_builtin_t defined in obj.h
5454

55-
STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
55+
STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
5656
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_fun_builtin));
5757
mp_obj_fun_builtin_t *self = MP_OBJ_TO_PTR(self_in);
5858

@@ -196,7 +196,7 @@ mp_code_state *mp_obj_fun_bc_prepare_codestate(mp_obj_t self_in, size_t n_args,
196196
}
197197
#endif
198198

199-
STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
199+
STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
200200
MP_STACK_CHECK();
201201

202202
DEBUG_printf("Input n_args: " UINT_FMT ", n_kw: " UINT_FMT "\n", n_args, n_kw);
@@ -353,7 +353,7 @@ mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args_in, mp_obj_t def_kw_args, const byt
353353

354354
#if MICROPY_EMIT_NATIVE
355355

356-
STATIC mp_obj_t fun_native_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
356+
STATIC mp_obj_t fun_native_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
357357
MP_STACK_CHECK();
358358
mp_obj_fun_bc_t *self = self_in;
359359
mp_call_fun_t fun = MICROPY_MAKE_POINTER_CALLABLE((void*)self->bytecode);
@@ -393,7 +393,7 @@ typedef mp_uint_t (*viper_fun_2_t)(mp_uint_t, mp_uint_t);
393393
typedef mp_uint_t (*viper_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t);
394394
typedef mp_uint_t (*viper_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t, mp_uint_t);
395395

396-
STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
396+
STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
397397
mp_obj_fun_viper_t *self = self_in;
398398

399399
mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false);
@@ -514,7 +514,7 @@ STATIC mp_obj_t convert_val_from_inline_asm(mp_uint_t val) {
514514
return MP_OBJ_NEW_SMALL_INT(val);
515515
}
516516

517-
STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
517+
STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
518518
mp_obj_fun_asm_t *self = self_in;
519519

520520
mp_arg_check_num(n_args, n_kw, self->n_args, self->n_args, false);

py/objgenerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct _mp_obj_gen_instance_t {
4949
mp_code_state code_state;
5050
} mp_obj_gen_instance_t;
5151

52-
STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
52+
STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
5353
mp_obj_gen_wrap_t *self = MP_OBJ_TO_PTR(self_in);
5454
mp_obj_fun_bc_t *self_fun = (mp_obj_fun_bc_t*)self->fun;
5555
assert(self_fun->base.type == &mp_type_fun_bc);

py/objint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#endif
4343

4444
// This dispatcher function is expected to be independent of the implementation of long int
45-
STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
45+
STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4646
(void)type_in;
4747
mp_arg_check_num(n_args, n_kw, 0, 2, false);
4848

py/objlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ STATIC mp_obj_t list_extend_from_iter(mp_obj_t list, mp_obj_t iterable) {
6868
return list;
6969
}
7070

71-
STATIC mp_obj_t list_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
71+
STATIC mp_obj_t list_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
7272
(void)type_in;
7373
mp_arg_check_num(n_args, n_kw, 0, 1, false);
7474

py/objmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef struct _mp_obj_map_t {
3636
mp_obj_t iters[];
3737
} mp_obj_map_t;
3838

39-
STATIC mp_obj_t map_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
39+
STATIC mp_obj_t map_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4040
mp_arg_check_num(n_args, n_kw, 2, MP_OBJ_FUN_ARGS_MAX, false);
4141
mp_obj_map_t *o = m_new_obj_var(mp_obj_map_t, mp_obj_t, n_args - 1);
4242
o->base.type = MP_OBJ_TO_PTR(type_in);

py/objnamedtuple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ STATIC void namedtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
7777
}
7878
}
7979

80-
STATIC mp_obj_t namedtuple_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
80+
STATIC mp_obj_t namedtuple_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
8181
mp_obj_namedtuple_type_t *type = MP_OBJ_TO_PTR(type_in);
8282
mp_uint_t num_fields = type->n_fields;
8383
if (n_args + n_kw != num_fields) {

py/objobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct _mp_obj_object_t {
3333
mp_obj_base_t base;
3434
} mp_obj_object_t;
3535

36-
STATIC mp_obj_t object_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
36+
STATIC mp_obj_t object_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
3737
(void)args;
3838
mp_arg_check_num(n_args, n_kw, 0, 0, false);
3939
mp_obj_object_t *o = m_new_obj(mp_obj_object_t);

py/objproperty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ typedef struct _mp_obj_property_t {
3737
mp_obj_t proxy[3]; // getter, setter, deleter
3838
} mp_obj_property_t;
3939

40-
STATIC mp_obj_t property_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
40+
STATIC mp_obj_t property_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4141
mp_arg_check_num(n_args, n_kw, 0, 4, false);
4242

4343
mp_obj_property_t *o = m_new_obj(mp_obj_property_t);

py/objrange.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ STATIC void range_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind
9090
}
9191
}
9292

93-
STATIC mp_obj_t range_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
93+
STATIC mp_obj_t range_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
9494
mp_arg_check_num(n_args, n_kw, 1, 3, false);
9595

9696
mp_obj_range_t *o = m_new_obj(mp_obj_range_t);

py/objreversed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct _mp_obj_reversed_t {
3838
mp_uint_t cur_index; // current index, plus 1; 0=no more, 1=last one (index 0)
3939
} mp_obj_reversed_t;
4040

41-
STATIC mp_obj_t reversed_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
41+
STATIC mp_obj_t reversed_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4242
mp_arg_check_num(n_args, n_kw, 1, 1, false);
4343

4444
// check if __reversed__ exists, and if so delegate to it

py/objset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ STATIC void set_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
119119
#endif
120120
}
121121

122-
STATIC mp_obj_t set_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
122+
STATIC mp_obj_t set_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
123123
mp_arg_check_num(n_args, n_kw, 0, 1, false);
124124

125125
switch (n_args) {

py/objstr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ STATIC void str_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
131131
}
132132
}
133133

134-
mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
134+
mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
135135
#if MICROPY_CPYTHON_COMPAT
136136
if (n_kw != 0) {
137137
mp_arg_error_unimpl_kw();
@@ -169,7 +169,7 @@ mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw,
169169
}
170170
}
171171

172-
STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
172+
STATIC mp_obj_t bytes_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
173173
(void)type_in;
174174

175175
#if MICROPY_CPYTHON_COMPAT

py/objstr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const byte *mp_obj_str_get_data_no_check(mp_obj_t self_in, size_t *len);
6060
else { str_len = ((mp_obj_str_t*)MP_OBJ_TO_PTR(str_obj_in))->len; str_data = ((mp_obj_str_t*)MP_OBJ_TO_PTR(str_obj_in))->data; }
6161
#endif
6262

63-
mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
63+
mp_obj_t mp_obj_str_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
6464
void mp_str_print_json(const mp_print_t *print, const byte *str_data, size_t str_len);
6565
mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
6666
mp_obj_t mp_obj_str_split(mp_uint_t n_args, const mp_obj_t *args);

py/objstringio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ STATIC mp_obj_stringio_t *stringio_new(mp_obj_t type_in) {
128128
return o;
129129
}
130130

131-
STATIC mp_obj_t stringio_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
131+
STATIC mp_obj_t stringio_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
132132
(void)n_kw; // TODO check n_kw==0
133133
mp_obj_stringio_t *o = stringio_new(type_in);
134134

py/objtuple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void mp_obj_tuple_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t
6161
}
6262
}
6363

64-
STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
64+
STATIC mp_obj_t mp_obj_tuple_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
6565
(void)type_in;
6666

6767
mp_arg_check_num(n_args, n_kw, 0, 1, false);

py/objtype.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define DEBUG_printf(...) (void)0
4444
#endif
4545

46-
STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
46+
STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
4747

4848
/******************************************************************************/
4949
// instance object
@@ -235,7 +235,7 @@ STATIC void instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_k
235235
mp_printf(print, "<%s object at %p>", mp_obj_get_type_str(self_in), self_in);
236236
}
237237

238-
mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
238+
mp_obj_t mp_obj_instance_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
239239
assert(MP_OBJ_IS_TYPE(self_in, &mp_type_type));
240240
mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in);
241241
assert(mp_obj_is_instance_type(self));
@@ -707,7 +707,7 @@ bool mp_obj_instance_is_callable(mp_obj_t self_in) {
707707
return mp_obj_instance_get_call(self_in) != MP_OBJ_NULL;
708708
}
709709

710-
mp_obj_t mp_obj_instance_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
710+
mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
711711
mp_obj_t call = mp_obj_instance_get_call(self_in);
712712
if (call == MP_OBJ_NULL) {
713713
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
@@ -778,7 +778,7 @@ STATIC void type_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
778778
mp_printf(print, "<class '%q'>", self->name);
779779
}
780780

781-
STATIC mp_obj_t type_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
781+
STATIC mp_obj_t type_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
782782
(void)type_in;
783783

784784
mp_arg_check_num(n_args, n_kw, 1, 3, false);
@@ -798,7 +798,7 @@ STATIC mp_obj_t type_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw
798798
}
799799
}
800800

801-
STATIC mp_obj_t type_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
801+
STATIC mp_obj_t type_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
802802
// instantiate an instance of a class
803803

804804
mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in);
@@ -957,7 +957,7 @@ STATIC void super_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind
957957
mp_print_str(print, ">");
958958
}
959959

960-
STATIC mp_obj_t super_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
960+
STATIC mp_obj_t super_make_new(mp_obj_t type_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
961961
(void)type_in;
962962
// 0 arguments are turned into 2 in the compiler
963963
// 1 argument is not yet implemented
@@ -1108,7 +1108,7 @@ mp_obj_t mp_instance_cast_to_native_base(mp_const_obj_t self_in, mp_const_obj_t
11081108
/******************************************************************************/
11091109
// staticmethod and classmethod types (probably should go in a different file)
11101110

1111-
STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
1111+
STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
11121112
mp_obj_type_t *self = MP_OBJ_TO_PTR(self_in);
11131113
assert(self == &mp_type_staticmethod || self == &mp_type_classmethod);
11141114

0 commit comments

Comments
 (0)