1818// args[0] is function from class body
1919// args[1] is class name
2020// args[2:] are base objects
21- static mp_obj_t mp_builtin___build_class__ (uint n_args , const mp_obj_t * args ) {
21+ STATIC mp_obj_t mp_builtin___build_class__ (uint n_args , const mp_obj_t * args ) {
2222 assert (2 <= n_args );
2323
2424 // we differ from CPython: we set the new __locals__ object here
@@ -61,7 +61,7 @@ static mp_obj_t mp_builtin___build_class__(uint n_args, const mp_obj_t *args) {
6161
6262MP_DEFINE_CONST_FUN_OBJ_VAR (mp_builtin___build_class___obj , 2 , mp_builtin___build_class__ );
6363
64- static mp_obj_t mp_builtin___repl_print__ (mp_obj_t o ) {
64+ STATIC mp_obj_t mp_builtin___repl_print__ (mp_obj_t o ) {
6565 if (o != mp_const_none ) {
6666 mp_obj_print (o , PRINT_REPR );
6767 printf ("\n" );
@@ -100,7 +100,7 @@ mp_obj_t mp_builtin_abs(mp_obj_t o_in) {
100100
101101MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_abs_obj , mp_builtin_abs );
102102
103- static mp_obj_t mp_builtin_all (mp_obj_t o_in ) {
103+ STATIC mp_obj_t mp_builtin_all (mp_obj_t o_in ) {
104104 mp_obj_t iterable = rt_getiter (o_in );
105105 mp_obj_t item ;
106106 while ((item = rt_iternext (iterable )) != mp_const_stop_iteration ) {
@@ -113,7 +113,7 @@ static mp_obj_t mp_builtin_all(mp_obj_t o_in) {
113113
114114MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_all_obj , mp_builtin_all );
115115
116- static mp_obj_t mp_builtin_any (mp_obj_t o_in ) {
116+ STATIC mp_obj_t mp_builtin_any (mp_obj_t o_in ) {
117117 mp_obj_t iterable = rt_getiter (o_in );
118118 mp_obj_t item ;
119119 while ((item = rt_iternext (iterable )) != mp_const_stop_iteration ) {
@@ -126,7 +126,7 @@ static mp_obj_t mp_builtin_any(mp_obj_t o_in) {
126126
127127MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_any_obj , mp_builtin_any );
128128
129- static mp_obj_t mp_builtin_callable (mp_obj_t o_in ) {
129+ STATIC mp_obj_t mp_builtin_callable (mp_obj_t o_in ) {
130130 if (mp_obj_is_callable (o_in )) {
131131 return mp_const_true ;
132132 } else {
@@ -136,7 +136,7 @@ static mp_obj_t mp_builtin_callable(mp_obj_t o_in) {
136136
137137MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_callable_obj , mp_builtin_callable );
138138
139- static mp_obj_t mp_builtin_chr (mp_obj_t o_in ) {
139+ STATIC mp_obj_t mp_builtin_chr (mp_obj_t o_in ) {
140140 int ord = mp_obj_get_int (o_in );
141141 if (0 <= ord && ord <= 0x10ffff ) {
142142 byte str [1 ] = {ord };
@@ -148,7 +148,7 @@ static mp_obj_t mp_builtin_chr(mp_obj_t o_in) {
148148
149149MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_chr_obj , mp_builtin_chr );
150150
151- static mp_obj_t mp_builtin_dir (uint n_args , const mp_obj_t * args ) {
151+ STATIC mp_obj_t mp_builtin_dir (uint n_args , const mp_obj_t * args ) {
152152 // TODO make this function more general and less of a hack
153153
154154 mp_map_t * map ;
@@ -178,7 +178,7 @@ static mp_obj_t mp_builtin_dir(uint n_args, const mp_obj_t *args) {
178178
179179MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin_dir_obj , 0 , 1 , mp_builtin_dir );
180180
181- static mp_obj_t mp_builtin_divmod (mp_obj_t o1_in , mp_obj_t o2_in ) {
181+ STATIC mp_obj_t mp_builtin_divmod (mp_obj_t o1_in , mp_obj_t o2_in ) {
182182 if (MP_OBJ_IS_SMALL_INT (o1_in ) && MP_OBJ_IS_SMALL_INT (o2_in )) {
183183 mp_small_int_t i1 = MP_OBJ_SMALL_INT_VALUE (o1_in );
184184 mp_small_int_t i2 = MP_OBJ_SMALL_INT_VALUE (o2_in );
@@ -193,20 +193,20 @@ static mp_obj_t mp_builtin_divmod(mp_obj_t o1_in, mp_obj_t o2_in) {
193193
194194MP_DEFINE_CONST_FUN_OBJ_2 (mp_builtin_divmod_obj , mp_builtin_divmod );
195195
196- static mp_obj_t mp_builtin_hash (mp_obj_t o_in ) {
196+ STATIC mp_obj_t mp_builtin_hash (mp_obj_t o_in ) {
197197 // TODO hash will generally overflow small integer; can we safely truncate it?
198198 return mp_obj_new_int (mp_obj_hash (o_in ));
199199}
200200
201201MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_hash_obj , mp_builtin_hash );
202202
203- static mp_obj_t mp_builtin_iter (mp_obj_t o_in ) {
203+ STATIC mp_obj_t mp_builtin_iter (mp_obj_t o_in ) {
204204 return rt_getiter (o_in );
205205}
206206
207207MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_iter_obj , mp_builtin_iter );
208208
209- static mp_obj_t mp_builtin_len (mp_obj_t o_in ) {
209+ STATIC mp_obj_t mp_builtin_len (mp_obj_t o_in ) {
210210 mp_obj_t len = mp_obj_len_maybe (o_in );
211211 if (len == NULL ) {
212212 nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "object of type '%s' has no len()" , mp_obj_get_type_str (o_in )));
@@ -217,7 +217,7 @@ static mp_obj_t mp_builtin_len(mp_obj_t o_in) {
217217
218218MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_len_obj , mp_builtin_len );
219219
220- static mp_obj_t mp_builtin_max (uint n_args , const mp_obj_t * args ) {
220+ STATIC mp_obj_t mp_builtin_max (uint n_args , const mp_obj_t * args ) {
221221 if (n_args == 1 ) {
222222 // given an iterable
223223 mp_obj_t iterable = rt_getiter (args [0 ]);
@@ -246,7 +246,7 @@ static mp_obj_t mp_builtin_max(uint n_args, const mp_obj_t *args) {
246246
247247MP_DEFINE_CONST_FUN_OBJ_VAR (mp_builtin_max_obj , 1 , mp_builtin_max );
248248
249- static mp_obj_t mp_builtin_min (uint n_args , const mp_obj_t * args ) {
249+ STATIC mp_obj_t mp_builtin_min (uint n_args , const mp_obj_t * args ) {
250250 if (n_args == 1 ) {
251251 // given an iterable
252252 mp_obj_t iterable = rt_getiter (args [0 ]);
@@ -275,7 +275,7 @@ static mp_obj_t mp_builtin_min(uint n_args, const mp_obj_t *args) {
275275
276276MP_DEFINE_CONST_FUN_OBJ_VAR (mp_builtin_min_obj , 1 , mp_builtin_min );
277277
278- static mp_obj_t mp_builtin_next (mp_obj_t o ) {
278+ STATIC mp_obj_t mp_builtin_next (mp_obj_t o ) {
279279 mp_obj_t ret = rt_iternext (o );
280280 if (ret == mp_const_stop_iteration ) {
281281 nlr_jump (mp_obj_new_exception (MP_QSTR_StopIteration ));
@@ -286,7 +286,7 @@ static mp_obj_t mp_builtin_next(mp_obj_t o) {
286286
287287MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_next_obj , mp_builtin_next );
288288
289- static mp_obj_t mp_builtin_ord (mp_obj_t o_in ) {
289+ STATIC mp_obj_t mp_builtin_ord (mp_obj_t o_in ) {
290290 uint len ;
291291 const char * str = mp_obj_str_get_data (o_in , & len );
292292 if (len == 1 ) {
@@ -300,7 +300,7 @@ static mp_obj_t mp_builtin_ord(mp_obj_t o_in) {
300300
301301MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_ord_obj , mp_builtin_ord );
302302
303- static mp_obj_t mp_builtin_pow (uint n_args , const mp_obj_t * args ) {
303+ STATIC mp_obj_t mp_builtin_pow (uint n_args , const mp_obj_t * args ) {
304304 assert (2 <= n_args && n_args <= 3 );
305305 switch (n_args ) {
306306 case 2 : return rt_binary_op (RT_BINARY_OP_POWER , args [0 ], args [1 ]);
@@ -310,7 +310,7 @@ static mp_obj_t mp_builtin_pow(uint n_args, const mp_obj_t *args) {
310310
311311MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin_pow_obj , 2 , 3 , mp_builtin_pow );
312312
313- static mp_obj_t mp_builtin_print (uint n_args , const mp_obj_t * args ) {
313+ STATIC mp_obj_t mp_builtin_print (uint n_args , const mp_obj_t * args ) {
314314 for (int i = 0 ; i < n_args ; i ++ ) {
315315 if (i > 0 ) {
316316 printf (" " );
@@ -323,7 +323,7 @@ static mp_obj_t mp_builtin_print(uint n_args, const mp_obj_t *args) {
323323
324324MP_DEFINE_CONST_FUN_OBJ_VAR (mp_builtin_print_obj , 0 , mp_builtin_print );
325325
326- static mp_obj_t mp_builtin_range (uint n_args , const mp_obj_t * args ) {
326+ STATIC mp_obj_t mp_builtin_range (uint n_args , const mp_obj_t * args ) {
327327 assert (1 <= n_args && n_args <= 3 );
328328 switch (n_args ) {
329329 case 1 : return mp_obj_new_range (0 , mp_obj_get_int (args [0 ]), 1 );
@@ -334,7 +334,7 @@ static mp_obj_t mp_builtin_range(uint n_args, const mp_obj_t *args) {
334334
335335MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin_range_obj , 1 , 3 , mp_builtin_range );
336336
337- static mp_obj_t mp_builtin_repr (mp_obj_t o_in ) {
337+ STATIC mp_obj_t mp_builtin_repr (mp_obj_t o_in ) {
338338 vstr_t * vstr = vstr_new ();
339339 mp_obj_print_helper ((void (* )(void * env , const char * fmt , ...))vstr_printf , vstr , o_in , PRINT_REPR );
340340 mp_obj_t s = mp_obj_new_str ((byte * )vstr -> buf , vstr -> len , false);
@@ -344,7 +344,7 @@ static mp_obj_t mp_builtin_repr(mp_obj_t o_in) {
344344
345345MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_repr_obj , mp_builtin_repr );
346346
347- static mp_obj_t mp_builtin_sum (uint n_args , const mp_obj_t * args ) {
347+ STATIC mp_obj_t mp_builtin_sum (uint n_args , const mp_obj_t * args ) {
348348 assert (1 <= n_args && n_args <= 2 );
349349 mp_obj_t value ;
350350 switch (n_args ) {
@@ -361,7 +361,7 @@ static mp_obj_t mp_builtin_sum(uint n_args, const mp_obj_t *args) {
361361
362362MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin_sum_obj , 1 , 2 , mp_builtin_sum );
363363
364- static mp_obj_t mp_builtin_sorted (uint n_args , const mp_obj_t * args , mp_map_t * kwargs ) {
364+ STATIC mp_obj_t mp_builtin_sorted (uint n_args , const mp_obj_t * args , mp_map_t * kwargs ) {
365365 assert (n_args >= 1 );
366366 if (n_args > 1 ) {
367367 nlr_jump (mp_obj_new_exception_msg (MP_QSTR_TypeError ,
@@ -375,7 +375,7 @@ static mp_obj_t mp_builtin_sorted(uint n_args, const mp_obj_t *args, mp_map_t *k
375375
376376MP_DEFINE_CONST_FUN_OBJ_KW (mp_builtin_sorted_obj , 1 , mp_builtin_sorted );
377377
378- static mp_obj_t mp_builtin_str (mp_obj_t o_in ) {
378+ STATIC mp_obj_t mp_builtin_str (mp_obj_t o_in ) {
379379 vstr_t * vstr = vstr_new ();
380380 mp_obj_print_helper ((void (* )(void * , const char * , ...))vstr_printf , vstr , o_in , PRINT_STR );
381381 mp_obj_t s = mp_obj_new_str ((byte * )vstr -> buf , vstr -> len , false);
@@ -386,7 +386,7 @@ static mp_obj_t mp_builtin_str(mp_obj_t o_in) {
386386MP_DEFINE_CONST_FUN_OBJ_1 (mp_builtin_str_obj , mp_builtin_str );
387387
388388// TODO: This should be type, this is just quick CPython compat hack
389- static mp_obj_t mp_builtin_bytes (uint n_args , const mp_obj_t * args ) {
389+ STATIC mp_obj_t mp_builtin_bytes (uint n_args , const mp_obj_t * args ) {
390390 if (!MP_OBJ_IS_QSTR (args [0 ]) && !MP_OBJ_IS_TYPE (args [0 ], & str_type )) {
391391 assert (0 );
392392 }
@@ -397,7 +397,7 @@ static mp_obj_t mp_builtin_bytes(uint n_args, const mp_obj_t *args) {
397397
398398MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin_bytes_obj , 1 , 3 , mp_builtin_bytes );
399399
400- static mp_obj_t mp_builtin_id (mp_obj_t o_in ) {
400+ STATIC mp_obj_t mp_builtin_id (mp_obj_t o_in ) {
401401 return mp_obj_new_int ((machine_int_t )o_in );
402402}
403403
0 commit comments