chore: format code and fix build error

This commit is contained in:
Gabor Kiss-Vamosi
2023-11-18 15:48:04 +01:00
parent 328ed69b4e
commit 4bdb2cd0ea
4 changed files with 6 additions and 5 deletions
+6
View File
@@ -15,6 +15,10 @@
#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/
#include LV_SDL_INCLUDE_PATH
#if LV_USE_DRAW_SDL
#include <SDL2/SDL_image.h>
#endif
/*********************
* DEFINES
*********************/
@@ -75,10 +79,12 @@ lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res)
event_handler_timer = lv_timer_create(sdl_event_handler, 5, NULL);
lv_tick_set_cb(SDL_GetTicks);
#if LV_USE_DRAW_SDL
if(!(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)) {
fprintf(stderr, "could not initialize sdl2_image: %s\n", IMG_GetError());
return NULL;
}
#endif
inited = true;
}
@@ -475,12 +475,10 @@ static void error_exit(j_common_ptr cinfo)
longjmp(myerr->jb, 1);
}
static void cache_invalidate_cb(lv_cache_entry_t * entry)
{
if(entry->src_type == LV_CACHE_SRC_TYPE_PATH) lv_free((void *)entry->src);
lv_free((void *)entry->data);
}
#endif /*LV_USE_LIBJPEG_TURBO*/
-1
View File
@@ -301,7 +301,6 @@ static const void * decode_png_file(const char * filename)
return image_data;
}
static void cache_invalidate_cb(lv_cache_entry_t * entry)
{
lv_free((void *)entry->src);
-2
View File
@@ -126,7 +126,6 @@ static void cache_invalidate_cb(lv_cache_entry_t * entry)
lv_draw_buf_free((void *)entry->data);
}
static const uint8_t * ttf_get_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter, uint8_t * bitmap_buf)
{
LV_UNUSED(bitmap_buf);
@@ -288,5 +287,4 @@ void lv_tiny_ttf_destroy(lv_font_t * font)
}
}
#endif