@@ -29,14 +29,14 @@ typedef struct _mp_obj_array_t {
2929 void * items ;
3030} mp_obj_array_t ;
3131
32- static mp_obj_t array_iterator_new (mp_obj_t array_in );
33- static mp_obj_array_t * array_new (char typecode , uint n );
34- static mp_obj_t array_append (mp_obj_t self_in , mp_obj_t arg );
32+ STATIC mp_obj_t array_iterator_new (mp_obj_t array_in );
33+ STATIC mp_obj_array_t * array_new (char typecode , uint n );
34+ STATIC mp_obj_t array_append (mp_obj_t self_in , mp_obj_t arg );
3535
3636/******************************************************************************/
3737/* array */
3838
39- static machine_int_t array_get_el_size (char typecode ) {
39+ STATIC machine_int_t array_get_el_size (char typecode ) {
4040 // This assumes that unsigned and signed types are of the same type,
4141 // which is invariant for [u]intN_t.
4242 switch (typecode ) {
@@ -57,7 +57,7 @@ static machine_int_t array_get_el_size(char typecode) {
5757 return -1 ;
5858}
5959
60- static machine_int_t array_get_el (mp_obj_array_t * o , int index ) {
60+ STATIC machine_int_t array_get_el (mp_obj_array_t * o , int index ) {
6161 machine_int_t val = 0 ;
6262 switch (o -> typecode ) {
6363 case 'b' :
@@ -89,7 +89,7 @@ static machine_int_t array_get_el(mp_obj_array_t *o, int index) {
8989 return val ;
9090}
9191
92- static void array_set_el (mp_obj_array_t * o , int index , mp_obj_t val_in ) {
92+ STATIC void array_set_el (mp_obj_array_t * o , int index , mp_obj_t val_in ) {
9393 machine_int_t val = mp_obj_int_get (val_in );
9494 switch (o -> typecode ) {
9595 case 'b' :
@@ -121,7 +121,7 @@ static void array_set_el(mp_obj_array_t *o, int index, mp_obj_t val_in) {
121121}
122122
123123
124- static void array_print (void (* print )(void * env , const char * fmt , ...), void * env , mp_obj_t o_in , mp_print_kind_t kind ) {
124+ STATIC void array_print (void (* print )(void * env , const char * fmt , ...), void * env , mp_obj_t o_in , mp_print_kind_t kind ) {
125125 mp_obj_array_t * o = o_in ;
126126 if (o -> typecode == BYTEARRAY_TYPECODE ) {
127127 print (env , "bytearray(b" , o -> typecode );
@@ -142,7 +142,7 @@ static void array_print(void (*print)(void *env, const char *fmt, ...), void *en
142142 print (env , ")" );
143143}
144144
145- static mp_obj_t array_construct (char typecode , mp_obj_t initializer ) {
145+ STATIC mp_obj_t array_construct (char typecode , mp_obj_t initializer ) {
146146 uint len ;
147147 // Try to create array of exact len if initializer len is known
148148 mp_obj_t len_in = mp_obj_len_maybe (initializer );
@@ -168,7 +168,7 @@ static mp_obj_t array_construct(char typecode, mp_obj_t initializer) {
168168 return array ;
169169}
170170
171- static mp_obj_t array_make_new (mp_obj_t type_in , uint n_args , uint n_kw , const mp_obj_t * args ) {
171+ STATIC mp_obj_t array_make_new (mp_obj_t type_in , uint n_args , uint n_kw , const mp_obj_t * args ) {
172172 if (n_args < 1 || n_args > 2 ) {
173173 nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "unexpected # of arguments, %d given" , n_args ));
174174 }
@@ -184,12 +184,12 @@ static mp_obj_t array_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const m
184184
185185// This is top-level factory function, not virtual method
186186// TODO: "bytearray" really should be type, not function
187- static mp_obj_t mp_builtin_bytearray (mp_obj_t arg ) {
187+ STATIC mp_obj_t mp_builtin_bytearray (mp_obj_t arg ) {
188188 return array_construct (BYTEARRAY_TYPECODE , arg );
189189}
190190MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_bytearray_obj , mp_builtin_bytearray );
191191
192- static mp_obj_t array_unary_op (int op , mp_obj_t o_in ) {
192+ STATIC mp_obj_t array_unary_op (int op , mp_obj_t o_in ) {
193193 mp_obj_array_t * o = o_in ;
194194 switch (op ) {
195195 case RT_UNARY_OP_BOOL : return MP_BOOL (o -> len != 0 );
@@ -198,7 +198,7 @@ static mp_obj_t array_unary_op(int op, mp_obj_t o_in) {
198198 }
199199}
200200
201- static mp_obj_t array_binary_op (int op , mp_obj_t lhs , mp_obj_t rhs ) {
201+ STATIC mp_obj_t array_binary_op (int op , mp_obj_t lhs , mp_obj_t rhs ) {
202202 mp_obj_array_t * o = lhs ;
203203 switch (op ) {
204204 case RT_BINARY_OP_SUBSCR :
@@ -214,7 +214,7 @@ static mp_obj_t array_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
214214 }
215215}
216216
217- static mp_obj_t array_append (mp_obj_t self_in , mp_obj_t arg ) {
217+ STATIC mp_obj_t array_append (mp_obj_t self_in , mp_obj_t arg ) {
218218 assert (MP_OBJ_IS_TYPE (self_in , & array_type ));
219219 mp_obj_array_t * self = self_in ;
220220 if (self -> free == 0 ) {
@@ -227,23 +227,23 @@ static mp_obj_t array_append(mp_obj_t self_in, mp_obj_t arg) {
227227 self -> free -- ;
228228 return mp_const_none ; // return None, as per CPython
229229}
230- static MP_DEFINE_CONST_FUN_OBJ_2 (array_append_obj , array_append ) ;
230+ STATIC MP_DEFINE_CONST_FUN_OBJ_2 (array_append_obj , array_append );
231231
232- static bool array_store_item (mp_obj_t self_in , mp_obj_t index_in , mp_obj_t value ) {
232+ STATIC bool array_store_item (mp_obj_t self_in , mp_obj_t index_in , mp_obj_t value ) {
233233 mp_obj_array_t * o = self_in ;
234234 uint index = mp_get_index (o -> base .type , o -> len , index_in );
235235 array_set_el (o , index , value );
236236 return true;
237237}
238238
239- static machine_int_t array_get_buffer (mp_obj_t o_in , buffer_info_t * bufinfo , int flags ) {
239+ STATIC machine_int_t array_get_buffer (mp_obj_t o_in , buffer_info_t * bufinfo , int flags ) {
240240 mp_obj_array_t * o = o_in ;
241241 bufinfo -> buf = o -> items ;
242242 bufinfo -> len = o -> len * array_get_el_size (o -> typecode );
243243 return 0 ;
244244}
245245
246- static const mp_method_t array_type_methods [] = {
246+ STATIC const mp_method_t array_type_methods [] = {
247247 { "append" , & array_append_obj },
248248 { NULL , NULL },
249249};
@@ -261,7 +261,7 @@ const mp_obj_type_t array_type = {
261261 .buffer_p = { .get_buffer = array_get_buffer },
262262};
263263
264- static mp_obj_array_t * array_new (char typecode , uint n ) {
264+ STATIC mp_obj_array_t * array_new (char typecode , uint n ) {
265265 mp_obj_array_t * o = m_new_obj (mp_obj_array_t );
266266 o -> base .type = & array_type ;
267267 o -> typecode = typecode ;
@@ -311,7 +311,7 @@ mp_obj_t array_it_iternext(mp_obj_t self_in) {
311311 }
312312}
313313
314- static const mp_obj_type_t array_it_type = {
314+ STATIC const mp_obj_type_t array_it_type = {
315315 { & mp_const_type },
316316 "array_iterator" ,
317317 .iternext = array_it_iternext ,
0 commit comments