Skip to content

Commit eac22e2

Browse files
committed
all: Consistently update signatures of .make_new and .call methods.
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
1 parent c3f70c6 commit eac22e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+51
-52
lines changed

cc3200/misc/mpirq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ STATIC mp_obj_t mp_irq_flags (mp_obj_t self_in) {
176176
}
177177
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_irq_flags_obj, mp_irq_flags);
178178

179-
STATIC mp_obj_t mp_irq_call (mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
179+
STATIC mp_obj_t mp_irq_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
180180
mp_arg_check_num(n_args, n_kw, 0, 0, false);
181181
mp_irq_handler (self_in);
182182
return mp_const_none;

cc3200/mods/modnetwork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ STATIC const mp_arg_t network_server_args[] = {
9191
{ MP_QSTR_login, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
9292
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
9393
};
94-
STATIC mp_obj_t network_server_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
94+
STATIC mp_obj_t network_server_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
9595
// parse args
9696
mp_map_t kw_args;
9797
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);

cc3200/mods/moduhashlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ STATIC mp_obj_t hash_read (mp_obj_t self_in) {
121121

122122
/// \classmethod \constructor([data[, block_size]])
123123
/// initial data must be given if block_size wants to be passed
124-
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) {
124+
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) {
125125
mp_arg_check_num(n_args, n_kw, 0, 2, false);
126126
mp_obj_hash_t *self = m_new0(mp_obj_hash_t, 1);
127127
self->base.type = type_in;

cc3200/mods/modusocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void modusocket_close_all_user_sockets (void) {
127127
// socket class
128128

129129
// constructor socket(family=AF_INET, type=SOCK_STREAM, proto=IPPROTO_TCP, fileno=None)
130-
STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
130+
STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
131131
mp_arg_check_num(n_args, n_kw, 0, 4, false);
132132

133133
// create socket object

cc3200/mods/modwlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ STATIC const mp_arg_t wlan_init_args[] = {
829829
{ MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
830830
{ MP_QSTR_antenna, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = ANTENNA_TYPE_INTERNAL} },
831831
};
832-
STATIC mp_obj_t wlan_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
832+
STATIC mp_obj_t wlan_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
833833
// parse args
834834
mp_map_t kw_args;
835835
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);

cc3200/mods/pybadc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ STATIC const mp_arg_t pyb_adc_init_args[] = {
140140
{ MP_QSTR_id, MP_ARG_INT, {.u_int = 0} },
141141
{ MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 12} },
142142
};
143-
STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
143+
STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
144144
// parse args
145145
mp_map_t kw_args;
146146
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);
@@ -289,7 +289,7 @@ STATIC mp_obj_t adc_channel_value(mp_obj_t self_in) {
289289
}
290290
STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_channel_value_obj, adc_channel_value);
291291

292-
STATIC mp_obj_t adc_channel_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
292+
STATIC mp_obj_t adc_channel_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
293293
mp_arg_check_num(n_args, n_kw, 0, 0, false);
294294
return adc_channel_value (self_in);
295295
}

cc3200/mods/pybi2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ STATIC const mp_arg_t pyb_i2c_init_args[] = {
332332
{ MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 100000} },
333333
{ MP_QSTR_pins, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
334334
};
335-
STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
335+
STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
336336
// parse args
337337
mp_map_t kw_args;
338338
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);

cc3200/mods/pybpin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ STATIC void pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
647647
mp_printf(print, ", alt=%d)", alt);
648648
}
649649

650-
STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
650+
STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
651651
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
652652

653653
// Run an argument through the mapper and return the result.
@@ -747,7 +747,7 @@ STATIC mp_obj_t pin_drive(mp_uint_t n_args, const mp_obj_t *args) {
747747
}
748748
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pin_drive_obj, 1, 2, pin_drive);
749749

750-
STATIC mp_obj_t pin_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
750+
STATIC mp_obj_t pin_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
751751
mp_arg_check_num(n_args, n_kw, 0, 1, false);
752752
mp_obj_t _args[2] = {self_in, *args};
753753
return pin_value (n_args + 1, _args);

cc3200/mods/pybrtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ STATIC const mp_arg_t pyb_rtc_init_args[] = {
285285
{ MP_QSTR_id, MP_ARG_INT, {.u_int = 0} },
286286
{ MP_QSTR_datetime, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
287287
};
288-
STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
288+
STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
289289
// parse args
290290
mp_map_t kw_args;
291291
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);

cc3200/mods/pybsd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ STATIC const mp_obj_t pyb_sd_def_pin[3] = {&pin_GP10, &pin_GP11, &pin_GP15};
6464
DECLARE PRIVATE FUNCTIONS
6565
******************************************************************************/
6666
STATIC void pyb_sd_hw_init (pybsd_obj_t *self);
67-
STATIC mp_obj_t pyb_sd_make_new (const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args);
67+
STATIC mp_obj_t pyb_sd_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args);
6868
STATIC mp_obj_t pyb_sd_deinit (mp_obj_t self_in);
6969

7070
/******************************************************************************
@@ -123,7 +123,7 @@ STATIC const mp_arg_t pyb_sd_init_args[] = {
123123
{ MP_QSTR_id, MP_ARG_INT, {.u_int = 0} },
124124
{ MP_QSTR_pins, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
125125
};
126-
STATIC mp_obj_t pyb_sd_make_new (const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *all_args) {
126+
STATIC mp_obj_t pyb_sd_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
127127
// parse args
128128
mp_map_t kw_args;
129129
mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args);

0 commit comments

Comments
 (0)