Skip to content

Commit 71c9cfb

Browse files
committed
all: Convert remaining "mp_uint_t n_args" to "size_t n_args".
This is to have consistency across the whole repository.
1 parent 784909c commit 71c9cfb

48 files changed

Lines changed: 144 additions & 144 deletions

Some content is hidden

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

cc3200/misc/mpirq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void mp_irq_handler (mp_obj_t self_in) {
145145
/******************************************************************************/
146146
// MicroPython bindings
147147

148-
STATIC mp_obj_t mp_irq_init (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
148+
STATIC mp_obj_t mp_irq_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
149149
mp_irq_obj_t *self = pos_args[0];
150150
// this is a bit of a hack, but it let us reuse the callback_create method from our parent
151151
((mp_obj_t *)pos_args)[0] = self->parent;

cc3200/misc/mpirq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/******************************************************************************
3535
DEFINE TYPES
3636
******************************************************************************/
37-
typedef mp_obj_t (*mp_irq_init_t) (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
37+
typedef mp_obj_t (*mp_irq_init_t) (size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args);
3838
typedef void (*mp_irq_void_method_t) (mp_obj_t self);
3939
typedef int (*mp_irq_int_method_t) (mp_obj_t self);
4040

cc3200/mods/modnetwork.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ STATIC mp_obj_t network_server_make_new(const mp_obj_type_t *type, size_t n_args
112112
return (mp_obj_t)self;
113113
}
114114

115-
STATIC mp_obj_t network_server_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
115+
STATIC mp_obj_t network_server_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
116116
// parse args
117117
mp_arg_val_t args[MP_ARRAY_SIZE(network_server_args) - 1];
118118
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), &network_server_args[1], args);
@@ -121,7 +121,7 @@ STATIC mp_obj_t network_server_init(mp_uint_t n_args, const mp_obj_t *pos_args,
121121
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(network_server_init_obj, 1, network_server_init);
122122

123123
// timeout value given in seconds
124-
STATIC mp_obj_t network_server_timeout(mp_uint_t n_args, const mp_obj_t *args) {
124+
STATIC mp_obj_t network_server_timeout(size_t n_args, const mp_obj_t *args) {
125125
if (n_args > 1) {
126126
uint32_t timeout = mp_obj_get_int(args[1]);
127127
servers_set_timeout(timeout * 1000);

cc3200/mods/modusocket.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
492492
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind);
493493

494494
// method socket.listen([backlog])
495-
STATIC mp_obj_t socket_listen(mp_uint_t n_args, const mp_obj_t *args) {
495+
STATIC mp_obj_t socket_listen(size_t n_args, const mp_obj_t *args) {
496496
mod_network_socket_obj_t *self = args[0];
497497

498498
int32_t backlog = 0;
@@ -639,7 +639,7 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) {
639639
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom);
640640

641641
// method socket.setsockopt(level, optname, value)
642-
STATIC mp_obj_t socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) {
642+
STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) {
643643
mod_network_socket_obj_t *self = args[0];
644644

645645
mp_int_t level = mp_obj_get_int(args[1]);
@@ -697,7 +697,7 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
697697
}
698698
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking);
699699

700-
STATIC mp_obj_t socket_makefile(mp_uint_t n_args, const mp_obj_t *args) {
700+
STATIC mp_obj_t socket_makefile(size_t n_args, const mp_obj_t *args) {
701701
(void)n_args;
702702
return args[0];
703703
}

cc3200/mods/modussl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ STATIC const mp_obj_type_t ssl_socket_type = {
7070
.locals_dict = (mp_obj_t)&socket_locals_dict,
7171
};
7272

73-
STATIC mp_obj_t mod_ssl_wrap_socket(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
73+
STATIC mp_obj_t mod_ssl_wrap_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
7474
STATIC const mp_arg_t allowed_args[] = {
7575
{ MP_QSTR_sock, MP_ARG_REQUIRED | MP_ARG_OBJ, },
7676
{ MP_QSTR_keyfile, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },

cc3200/mods/modutime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
/// second is 0-59
6666
/// weekday is 0-6 for Mon-Sun.
6767
/// yearday is 1-366
68-
STATIC mp_obj_t time_localtime(mp_uint_t n_args, const mp_obj_t *args) {
68+
STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) {
6969
if (n_args == 0 || args[0] == mp_const_none) {
7070
timeutils_struct_time_t tm;
7171

cc3200/mods/modwipy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/******************************************************************************/
88
// MicroPython bindings
99

10-
STATIC mp_obj_t mod_wipy_heartbeat (mp_uint_t n_args, const mp_obj_t *args) {
10+
STATIC mp_obj_t mod_wipy_heartbeat(size_t n_args, const mp_obj_t *args) {
1111
if (n_args) {
1212
mperror_enable_heartbeat (mp_obj_is_true(args[0]));
1313
return mp_const_none;

cc3200/mods/modwlan.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ STATIC mp_obj_t wlan_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
845845
return (mp_obj_t)self;
846846
}
847847

848-
STATIC mp_obj_t wlan_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
848+
STATIC mp_obj_t wlan_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
849849
// parse args
850850
mp_arg_val_t args[MP_ARRAY_SIZE(wlan_init_args) - 1];
851851
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), &wlan_init_args[1], args);
@@ -904,7 +904,7 @@ STATIC mp_obj_t wlan_scan(mp_obj_t self_in) {
904904
}
905905
STATIC MP_DEFINE_CONST_FUN_OBJ_1(wlan_scan_obj, wlan_scan);
906906

907-
STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
907+
STATIC mp_obj_t wlan_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
908908
STATIC const mp_arg_t allowed_args[] = {
909909
{ MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ, },
910910
{ MP_QSTR_auth, MP_ARG_OBJ, {.u_obj = mp_const_none} },
@@ -981,7 +981,7 @@ STATIC mp_obj_t wlan_isconnected(mp_obj_t self_in) {
981981
}
982982
STATIC MP_DEFINE_CONST_FUN_OBJ_1(wlan_isconnected_obj, wlan_isconnected);
983983

984-
STATIC mp_obj_t wlan_ifconfig (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
984+
STATIC mp_obj_t wlan_ifconfig(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
985985
STATIC const mp_arg_t wlan_ifconfig_args[] = {
986986
{ MP_QSTR_id, MP_ARG_INT, {.u_int = 0} },
987987
{ MP_QSTR_config, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
@@ -1058,7 +1058,7 @@ STATIC mp_obj_t wlan_ifconfig (mp_uint_t n_args, const mp_obj_t *pos_args, mp_ma
10581058
}
10591059
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wlan_ifconfig_obj, 1, wlan_ifconfig);
10601060

1061-
STATIC mp_obj_t wlan_mode (mp_uint_t n_args, const mp_obj_t *args) {
1061+
STATIC mp_obj_t wlan_mode(size_t n_args, const mp_obj_t *args) {
10621062
wlan_obj_t *self = args[0];
10631063
if (n_args == 1) {
10641064
return mp_obj_new_int(self->mode);
@@ -1072,7 +1072,7 @@ STATIC mp_obj_t wlan_mode (mp_uint_t n_args, const mp_obj_t *args) {
10721072
}
10731073
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_mode_obj, 1, 2, wlan_mode);
10741074

1075-
STATIC mp_obj_t wlan_ssid (mp_uint_t n_args, const mp_obj_t *args) {
1075+
STATIC mp_obj_t wlan_ssid(size_t n_args, const mp_obj_t *args) {
10761076
wlan_obj_t *self = args[0];
10771077
if (n_args == 1) {
10781078
return mp_obj_new_str((const char *)self->ssid, strlen((const char *)self->ssid), false);
@@ -1087,7 +1087,7 @@ STATIC mp_obj_t wlan_ssid (mp_uint_t n_args, const mp_obj_t *args) {
10871087
}
10881088
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_ssid_obj, 1, 2, wlan_ssid);
10891089

1090-
STATIC mp_obj_t wlan_auth (mp_uint_t n_args, const mp_obj_t *args) {
1090+
STATIC mp_obj_t wlan_auth(size_t n_args, const mp_obj_t *args) {
10911091
wlan_obj_t *self = args[0];
10921092
if (n_args == 1) {
10931093
if (self->auth == SL_SEC_TYPE_OPEN) {
@@ -1117,7 +1117,7 @@ STATIC mp_obj_t wlan_auth (mp_uint_t n_args, const mp_obj_t *args) {
11171117
}
11181118
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_auth_obj, 1, 2, wlan_auth);
11191119

1120-
STATIC mp_obj_t wlan_channel (mp_uint_t n_args, const mp_obj_t *args) {
1120+
STATIC mp_obj_t wlan_channel(size_t n_args, const mp_obj_t *args) {
11211121
wlan_obj_t *self = args[0];
11221122
if (n_args == 1) {
11231123
return mp_obj_new_int(self->channel);
@@ -1131,7 +1131,7 @@ STATIC mp_obj_t wlan_channel (mp_uint_t n_args, const mp_obj_t *args) {
11311131
}
11321132
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_channel_obj, 1, 2, wlan_channel);
11331133

1134-
STATIC mp_obj_t wlan_antenna (mp_uint_t n_args, const mp_obj_t *args) {
1134+
STATIC mp_obj_t wlan_antenna(size_t n_args, const mp_obj_t *args) {
11351135
wlan_obj_t *self = args[0];
11361136
if (n_args == 1) {
11371137
return mp_obj_new_int(self->antenna);
@@ -1146,7 +1146,7 @@ STATIC mp_obj_t wlan_antenna (mp_uint_t n_args, const mp_obj_t *args) {
11461146
}
11471147
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_antenna_obj, 1, 2, wlan_antenna);
11481148

1149-
STATIC mp_obj_t wlan_mac (mp_uint_t n_args, const mp_obj_t *args) {
1149+
STATIC mp_obj_t wlan_mac(size_t n_args, const mp_obj_t *args) {
11501150
wlan_obj_t *self = args[0];
11511151
if (n_args == 1) {
11521152
return mp_obj_new_bytes((const byte *)self->mac, SL_BSSID_LENGTH);
@@ -1164,7 +1164,7 @@ STATIC mp_obj_t wlan_mac (mp_uint_t n_args, const mp_obj_t *args) {
11641164
}
11651165
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(wlan_mac_obj, 1, 2, wlan_mac);
11661166

1167-
STATIC mp_obj_t wlan_irq (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
1167+
STATIC mp_obj_t wlan_irq(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
11681168
mp_arg_val_t args[mp_irq_INIT_NUM_ARGS];
11691169
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, mp_irq_INIT_NUM_ARGS, mp_irq_init_args, args);
11701170

cc3200/mods/pybadc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
168168
return self;
169169
}
170170

171-
STATIC mp_obj_t adc_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
171+
STATIC mp_obj_t adc_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
172172
// parse args
173173
mp_arg_val_t args[MP_ARRAY_SIZE(pyb_adc_init_args) - 1];
174174
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), &pyb_adc_init_args[1], args);
@@ -193,7 +193,7 @@ STATIC mp_obj_t adc_deinit(mp_obj_t self_in) {
193193
}
194194
STATIC MP_DEFINE_CONST_FUN_OBJ_1(adc_deinit_obj, adc_deinit);
195195

196-
STATIC mp_obj_t adc_channel(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
196+
STATIC mp_obj_t adc_channel(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
197197
STATIC const mp_arg_t pyb_adc_channel_args[] = {
198198
{ MP_QSTR_id, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
199199
{ MP_QSTR_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },

cc3200/mods/pybi2c.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ STATIC mp_obj_t pyb_i2c_scan(mp_obj_t self_in) {
380380
}
381381
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_i2c_scan_obj, pyb_i2c_scan);
382382

383-
STATIC mp_obj_t pyb_i2c_readfrom(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
383+
STATIC mp_obj_t pyb_i2c_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
384384
STATIC const mp_arg_t pyb_i2c_readfrom_args[] = {
385385
{ MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, },
386386
{ MP_QSTR_nbytes, MP_ARG_REQUIRED | MP_ARG_OBJ, },
@@ -398,7 +398,7 @@ STATIC mp_obj_t pyb_i2c_readfrom(mp_uint_t n_args, const mp_obj_t *pos_args, mp_
398398
}
399399
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_readfrom_obj, 3, pyb_i2c_readfrom);
400400

401-
STATIC mp_obj_t pyb_i2c_readfrom_into(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
401+
STATIC mp_obj_t pyb_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
402402
STATIC const mp_arg_t pyb_i2c_readfrom_into_args[] = {
403403
{ MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, },
404404
{ MP_QSTR_buf, MP_ARG_REQUIRED | MP_ARG_OBJ, },
@@ -416,7 +416,7 @@ STATIC mp_obj_t pyb_i2c_readfrom_into(mp_uint_t n_args, const mp_obj_t *pos_args
416416
}
417417
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_readfrom_into_obj, 1, pyb_i2c_readfrom_into);
418418

419-
STATIC mp_obj_t pyb_i2c_writeto(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
419+
STATIC mp_obj_t pyb_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
420420
STATIC const mp_arg_t pyb_i2c_writeto_args[] = {
421421
{ MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, },
422422
{ MP_QSTR_buf, MP_ARG_REQUIRED | MP_ARG_OBJ, },
@@ -444,7 +444,7 @@ STATIC mp_obj_t pyb_i2c_writeto(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
444444
}
445445
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_writeto_obj, 1, pyb_i2c_writeto);
446446

447-
STATIC mp_obj_t pyb_i2c_readfrom_mem(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
447+
STATIC mp_obj_t pyb_i2c_readfrom_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
448448
STATIC const mp_arg_t pyb_i2c_readfrom_mem_args[] = {
449449
{ MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, },
450450
{ MP_QSTR_memaddr, MP_ARG_REQUIRED | MP_ARG_INT, },
@@ -469,7 +469,7 @@ STATIC const mp_arg_t pyb_i2c_readfrom_mem_into_args[] = {
469469
{ MP_QSTR_addrsize, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} },
470470
};
471471

472-
STATIC mp_obj_t pyb_i2c_readfrom_mem_into(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
472+
STATIC mp_obj_t pyb_i2c_readfrom_mem_into(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
473473
// parse args
474474
mp_arg_val_t args[MP_ARRAY_SIZE(pyb_i2c_readfrom_mem_into_args)];
475475
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(args), pyb_i2c_readfrom_mem_into_args, args);
@@ -481,7 +481,7 @@ STATIC mp_obj_t pyb_i2c_readfrom_mem_into(mp_uint_t n_args, const mp_obj_t *pos_
481481
}
482482
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_readfrom_mem_into_obj, 1, pyb_i2c_readfrom_mem_into);
483483

484-
STATIC mp_obj_t pyb_i2c_writeto_mem(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
484+
STATIC mp_obj_t pyb_i2c_writeto_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
485485
// parse args
486486
mp_arg_val_t args[MP_ARRAY_SIZE(pyb_i2c_readfrom_mem_into_args)];
487487
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(pyb_i2c_readfrom_mem_into_args), pyb_i2c_readfrom_mem_into_args, args);

0 commit comments

Comments
 (0)