@@ -42,7 +42,7 @@ void microsocket_init();
4242void time_init ();
4343void ffi_init ();
4444
45- static void execute_from_lexer (mp_lexer_t * lex , mp_parse_input_kind_t input_kind , bool is_repl ) {
45+ STATIC void execute_from_lexer (mp_lexer_t * lex , mp_parse_input_kind_t input_kind , bool is_repl ) {
4646 if (lex == NULL ) {
4747 return ;
4848 }
@@ -94,7 +94,7 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind
9494 }
9595}
9696
97- static char * strjoin (const char * s1 , int sep_char , const char * s2 ) {
97+ STATIC char * strjoin (const char * s1 , int sep_char , const char * s2 ) {
9898 int l1 = strlen (s1 );
9999 int l2 = strlen (s2 );
100100 char * s = malloc (l1 + l2 + 2 );
@@ -108,7 +108,7 @@ static char *strjoin(const char *s1, int sep_char, const char *s2) {
108108 return s ;
109109}
110110
111- static char * prompt (char * p ) {
111+ STATIC char * prompt (char * p ) {
112112#if MICROPY_USE_READLINE
113113 char * line = readline (p );
114114 if (line ) {
@@ -133,7 +133,7 @@ static char *prompt(char *p) {
133133 return line ;
134134}
135135
136- static void do_repl (void ) {
136+ STATIC void do_repl (void ) {
137137 for (;;) {
138138 char * line = prompt (">>> " );
139139 if (line == NULL ) {
@@ -159,12 +159,12 @@ static void do_repl(void) {
159159 }
160160}
161161
162- static void do_file (const char * file ) {
162+ STATIC void do_file (const char * file ) {
163163 mp_lexer_t * lex = mp_lexer_new_from_file (file );
164164 execute_from_lexer (lex , MP_PARSE_FILE_INPUT , false);
165165}
166166
167- static void do_str (const char * str ) {
167+ STATIC void do_str (const char * str ) {
168168 mp_lexer_t * lex = mp_lexer_new_from_str_len (MP_QSTR__lt_stdin_gt_ , str , strlen (str ), false);
169169 execute_from_lexer (lex , MP_PARSE_SINGLE_INPUT , false);
170170}
@@ -174,33 +174,33 @@ typedef struct _test_obj_t {
174174 int value ;
175175} test_obj_t ;
176176
177- static void test_print (void (* print )(void * env , const char * fmt , ...), void * env , mp_obj_t self_in , mp_print_kind_t kind ) {
177+ STATIC void test_print (void (* print )(void * env , const char * fmt , ...), void * env , mp_obj_t self_in , mp_print_kind_t kind ) {
178178 test_obj_t * self = self_in ;
179179 print (env , "<test %d>" , self -> value );
180180}
181181
182- static mp_obj_t test_get (mp_obj_t self_in ) {
182+ STATIC mp_obj_t test_get (mp_obj_t self_in ) {
183183 test_obj_t * self = self_in ;
184184 return mp_obj_new_int (self -> value );
185185}
186186
187- static mp_obj_t test_set (mp_obj_t self_in , mp_obj_t arg ) {
187+ STATIC mp_obj_t test_set (mp_obj_t self_in , mp_obj_t arg ) {
188188 test_obj_t * self = self_in ;
189189 self -> value = mp_obj_get_int (arg );
190190 return mp_const_none ;
191191}
192192
193- static MP_DEFINE_CONST_FUN_OBJ_1 (test_get_obj , test_get ) ;
194- static MP_DEFINE_CONST_FUN_OBJ_2 (test_set_obj , test_set ) ;
193+ STATIC MP_DEFINE_CONST_FUN_OBJ_1 (test_get_obj , test_get );
194+ STATIC MP_DEFINE_CONST_FUN_OBJ_2 (test_set_obj , test_set );
195195
196- static const mp_map_elem_t test_locals_dict_table [] = {
196+ STATIC const mp_map_elem_t test_locals_dict_table [] = {
197197 { MP_OBJ_NEW_QSTR (MP_QSTR_get ), (mp_obj_t )& test_get_obj },
198198 { MP_OBJ_NEW_QSTR (MP_QSTR_set ), (mp_obj_t )& test_set_obj },
199199};
200200
201201STATIC MP_DEFINE_CONST_DICT (test_locals_dict , test_locals_dict_table );
202202
203- static const mp_obj_type_t test_type = {
203+ STATIC const mp_obj_type_t test_type = {
204204 { & mp_type_type },
205205 .name = MP_QSTR_Test ,
206206 .print = test_print ,
@@ -249,7 +249,7 @@ mp_obj_t qstr_info(void) {
249249
250250#if MICROPY_ENABLE_GC
251251// TODO: this doesn't belong here
252- static mp_obj_t pyb_gc (void ) {
252+ STATIC mp_obj_t pyb_gc (void ) {
253253 gc_collect ();
254254 return mp_const_none ;
255255}
0 commit comments