diff --git a/gen/gen_mpy.py b/gen/gen_mpy.py index 1867f3a9e..eba7a810b 100644 --- a/gen/gen_mpy.py +++ b/gen/gen_mpy.py @@ -1026,7 +1026,7 @@ def register_int_ptr_type(convertor, *types): static const mp_lv_obj_type_t mp_lv_{base_obj}_type; static const mp_lv_obj_type_t *mp_lv_obj_types[]; -static inline const mp_obj_type_t *get_BaseObj_type() +static inline const mp_obj_type_t *get_BaseObj_type(void) {{ return mp_lv_{base_obj}_type.mp_obj_type; }} @@ -1214,7 +1214,7 @@ def register_int_ptr_type(convertor, *types): return mp_lv_obj->callbacks; } -static inline const mp_obj_type_t *get_BaseObj_type(); +static inline const mp_obj_type_t *get_BaseObj_type(void); static void mp_lv_delete_cb(lv_event_t * e) { @@ -1235,10 +1235,10 @@ def register_int_ptr_type(convertor, *types): { // Find the object type const mp_obj_type_t *mp_obj_type = get_BaseObj_type(); - const lv_obj_class_t *lv_obj_class = lv_obj_get_class(lv_obj); + const lv_obj_class_t *lv_obj_cls = lv_obj_get_class(lv_obj); const mp_lv_obj_type_t **iter = &mp_lv_obj_types[0]; for (; *iter; iter++) { - if ((*iter)->lv_obj_class == lv_obj_class) { + if ((*iter)->lv_obj_class == lv_obj_cls) { mp_obj_type = (*iter)->mp_obj_type; break; } @@ -1345,12 +1345,15 @@ def register_int_ptr_type(convertor, *types): int mp_lv_roots_initialized = 0; int lvgl_mod_initialized = 0; +/* Prototype definition to make -Werror=missing-prototype happy */ +void mp_lv_log_cb(lv_log_level_t level, const char * buf); + void mp_lv_log_cb(lv_log_level_t level, const char * buf){ mp_printf(&mp_plat_print, buf); } -void mp_lv_init_gc() +void mp_lv_init_gc(void) { if (!MP_STATE_VM(mp_lv_roots_initialized)) { // mp_printf(&mp_plat_print, "[ INIT GC ]"); @@ -1359,7 +1362,7 @@ def register_int_ptr_type(convertor, *types): } } -void mp_lv_deinit_gc() +void mp_lv_deinit_gc(void) { // mp_printf(&mp_plat_print, "[ DEINIT GC ]"); @@ -2427,7 +2430,7 @@ def try_generate_struct(struct_name, struct): * Struct {struct_name} */ -static inline const mp_obj_type_t *get_mp_{sanitized_struct_name}_type(); +static inline const mp_obj_type_t *get_mp_{sanitized_struct_name}_type(void); static inline void* mp_write_ptr_{sanitized_struct_name}(mp_obj_t self_in) {{ @@ -2495,7 +2498,7 @@ def try_generate_struct(struct_name, struct): parent, &mp_lv_base_struct_type ); -static inline const mp_obj_type_t *get_mp_{sanitized_struct_name}_type() +static inline const mp_obj_type_t *get_mp_{sanitized_struct_name}_type(void) {{ return &mp_{sanitized_struct_name}_type; }} diff --git a/lv_conf.h b/lv_conf.h index d5ad011a8..3da735c1a 100644 --- a/lv_conf.h +++ b/lv_conf.h @@ -429,8 +429,8 @@ /*Garbage Collector settings *Used if LVGL is bound to higher level language and the memory is managed by that language*/ -extern void mp_lv_init_gc(); -extern void mp_lv_deinit_gc(); +extern void mp_lv_init_gc(void); +extern void mp_lv_deinit_gc(void); #define LV_GC_INIT() mp_lv_init_gc() #define LV_GC_DEINIT() mp_lv_deinit_gc()