Skip to content

Commit 2801e6f

Browse files
committed
py: Some trivial cosmetic changes, for code style consistency.
1 parent 7f59b4b commit 2801e6f

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

py/map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ STATIC void mp_map_rehash(mp_map_t *map) {
136136
// - returns slot, with key non-null and value=MP_OBJ_NULL if it was added
137137
// MP_MAP_LOOKUP_REMOVE_IF_FOUND behaviour:
138138
// - returns NULL if not found, else the slot if was found in with key null and value non-null
139-
mp_map_elem_t* mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind) {
139+
mp_map_elem_t *mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind) {
140140

141141
// Work out if we can compare just pointers
142142
bool compare_only_ptrs = map->all_keys_are_qstrs;

py/obj.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void mp_map_init_fixed_table(mp_map_t *map, mp_uint_t n, const mp_obj_t *table);
224224
mp_map_t *mp_map_new(mp_uint_t n);
225225
void mp_map_deinit(mp_map_t *map);
226226
void mp_map_free(mp_map_t *map);
227-
mp_map_elem_t* mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind);
227+
mp_map_elem_t *mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind);
228228
void mp_map_clear(mp_map_t *map);
229229
void mp_map_dump(mp_map_t *map);
230230

@@ -511,7 +511,7 @@ void mp_obj_get_array_fixed_n(mp_obj_t o, mp_uint_t len, mp_obj_t **items);
511511
mp_uint_t mp_get_index(const mp_obj_type_t *type, mp_uint_t len, mp_obj_t index, bool is_slice);
512512
mp_obj_t mp_obj_id(mp_obj_t o_in);
513513
mp_obj_t mp_obj_len(mp_obj_t o_in);
514-
mp_obj_t mp_obj_len_maybe(mp_obj_t o_in); /* may return MP_OBJ_NULL */
514+
mp_obj_t mp_obj_len_maybe(mp_obj_t o_in); // may return MP_OBJ_NULL
515515
mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val);
516516

517517
// bool

py/objboundmeth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ STATIC void bound_meth_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
7979
}
8080
#endif
8181

82-
const mp_obj_type_t bound_meth_type = {
82+
STATIC const mp_obj_type_t mp_type_bound_meth = {
8383
{ &mp_type_type },
8484
.name = MP_QSTR_bound_method,
8585
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
@@ -93,7 +93,7 @@ const mp_obj_type_t bound_meth_type = {
9393

9494
mp_obj_t mp_obj_new_bound_meth(mp_obj_t meth, mp_obj_t self) {
9595
mp_obj_bound_meth_t *o = m_new_obj(mp_obj_bound_meth_t);
96-
o->base.type = &bound_meth_type;
96+
o->base.type = &mp_type_bound_meth;
9797
o->meth = meth;
9898
o->self = self;
9999
return o;

py/objcell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ STATIC void cell_print(void (*print)(void *env, const char *fmt, ...), void *env
5555
}
5656
#endif
5757

58-
const mp_obj_type_t cell_type = {
58+
STATIC const mp_obj_type_t mp_type_cell = {
5959
{ &mp_type_type },
6060
.name = MP_QSTR_, // cell representation is just value in < >
6161
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
@@ -65,7 +65,7 @@ const mp_obj_type_t cell_type = {
6565

6666
mp_obj_t mp_obj_new_cell(mp_obj_t obj) {
6767
mp_obj_cell_t *o = m_new_obj(mp_obj_cell_t);
68-
o->base.type = &cell_type;
68+
o->base.type = &mp_type_cell;
6969
o->obj = obj;
7070
return o;
7171
}

py/objgetitemiter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ STATIC const mp_obj_type_t it_type = {
6161
{ &mp_type_type },
6262
.name = MP_QSTR_iterator,
6363
.getiter = mp_identity,
64-
.iternext = it_iternext
64+
.iternext = it_iternext,
6565
};
6666

6767
// args are those returned from mp_load_method_maybe (ie either an attribute or a method)

py/objstr.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ STATIC mp_obj_t str_rstrip(mp_uint_t n_args, const mp_obj_t *args) {
789789

790790
// Takes an int arg, but only parses unsigned numbers, and only changes
791791
// *num if at least one digit was parsed.
792-
static int str_to_int(const char *str, int *num) {
792+
STATIC int str_to_int(const char *str, int *num) {
793793
const char *s = str;
794794
if ('0' <= *s && *s <= '9') {
795795
*num = 0;
@@ -802,27 +802,27 @@ static int str_to_int(const char *str, int *num) {
802802
return s - str;
803803
}
804804

805-
static bool isalignment(char ch) {
805+
STATIC bool isalignment(char ch) {
806806
return ch && strchr("<>=^", ch) != NULL;
807807
}
808808

809-
static bool istype(char ch) {
809+
STATIC bool istype(char ch) {
810810
return ch && strchr("bcdeEfFgGnosxX%", ch) != NULL;
811811
}
812812

813-
static bool arg_looks_integer(mp_obj_t arg) {
813+
STATIC bool arg_looks_integer(mp_obj_t arg) {
814814
return MP_OBJ_IS_TYPE(arg, &mp_type_bool) || MP_OBJ_IS_INT(arg);
815815
}
816816

817-
static bool arg_looks_numeric(mp_obj_t arg) {
817+
STATIC bool arg_looks_numeric(mp_obj_t arg) {
818818
return arg_looks_integer(arg)
819819
#if MICROPY_PY_BUILTINS_FLOAT
820820
|| MP_OBJ_IS_TYPE(arg, &mp_type_float)
821821
#endif
822822
;
823823
}
824824

825-
static mp_obj_t arg_as_int(mp_obj_t arg) {
825+
STATIC mp_obj_t arg_as_int(mp_obj_t arg) {
826826
#if MICROPY_PY_BUILTINS_FLOAT
827827
if (MP_OBJ_IS_TYPE(arg, &mp_type_float)) {
828828
return mp_obj_new_int_from_float(mp_obj_get_float(arg));

py/objtype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,11 @@ STATIC mp_obj_t static_class_method_make_new(mp_obj_t self_in, mp_uint_t n_args,
10511051
const mp_obj_type_t mp_type_staticmethod = {
10521052
{ &mp_type_type },
10531053
.name = MP_QSTR_staticmethod,
1054-
.make_new = static_class_method_make_new
1054+
.make_new = static_class_method_make_new,
10551055
};
10561056

10571057
const mp_obj_type_t mp_type_classmethod = {
10581058
{ &mp_type_type },
10591059
.name = MP_QSTR_classmethod,
1060-
.make_new = static_class_method_make_new
1060+
.make_new = static_class_method_make_new,
10611061
};

py/pfenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
static const char pad_spaces[] = " ";
4242
static const char pad_zeroes[] = "0000000000000000";
4343

44-
void pfenv_vstr_add_strn(void *data, const char *str, mp_uint_t len){
44+
void pfenv_vstr_add_strn(void *data, const char *str, mp_uint_t len) {
4545
vstr_add_strn(data, str, len);
4646
}
4747

py/qstr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ byte* qstr_build_start(mp_uint_t len, byte **q_ptr);
6767
qstr qstr_build_end(byte *q_ptr);
6868

6969
mp_uint_t qstr_hash(qstr q);
70-
const char* qstr_str(qstr q);
70+
const char *qstr_str(qstr q);
7171
mp_uint_t qstr_len(qstr q);
72-
const byte* qstr_data(qstr q, mp_uint_t *len);
72+
const byte *qstr_data(qstr q, mp_uint_t *len);
7373

7474
void qstr_pool_info(mp_uint_t *n_pool, mp_uint_t *n_qstr, mp_uint_t *n_str_data_bytes, mp_uint_t *n_total_bytes);
7575
void qstr_dump_data(void);

0 commit comments

Comments
 (0)