Cleanups/warnings

This commit is contained in:
twinaphex 2022-03-07 19:32:01 +01:00
parent df553bb7f5
commit 9bcee062ff
6 changed files with 35 additions and 37 deletions

View File

@ -628,8 +628,9 @@ static void gx_get_video_output_size(void *data,
static void setup_video_mode(gx_video_t *gx)
{
unsigned width, height;
char desc[64] = {0};
unsigned width = 0;
unsigned height = 0;
char desc[64] = {0};
if (!gx->framebuf[0])
{

View File

@ -60,7 +60,7 @@ struct filter_data
* (Optimisations by jdgleaver)
*******************************************************************/
#define UPSCALE_240__WEIGHT(A, B, out, tmp) \
#define UPSCALE_240__WEIGHT(A, B, out) \
*(out) = ((A + B + ((A ^ B) & 0x821)) >> 1)
/* Upscales a 240x160 image to 320x240 using an approximate bilinear
@ -92,8 +92,6 @@ void upscale_240x160_to_320x240(uint16_t *dst, const uint16_t *src,
uint16_t _4_5;
uint16_t _5_6;
uint16_t tmp;
/* Horizontally:
* Before(3):
* (a)(b)(c)
@ -113,9 +111,9 @@ void upscale_240x160_to_320x240(uint16_t *dst, const uint16_t *src,
_3 = *(block_src_ptr + 2);
*(block_dst_ptr ) = _1;
UPSCALE_240__WEIGHT(_1, _2, &_1_2, tmp);
UPSCALE_240__WEIGHT(_1, _2, &_1_2);
*(block_dst_ptr + 1) = _1_2;
UPSCALE_240__WEIGHT(_2, _3, &_2_3, tmp);
UPSCALE_240__WEIGHT(_2, _3, &_2_3);
*(block_dst_ptr + 2) = _2_3;
*(block_dst_ptr + 3) = _3;
@ -127,20 +125,20 @@ void upscale_240x160_to_320x240(uint16_t *dst, const uint16_t *src,
_5 = *(block_src_ptr + 1);
_6 = *(block_src_ptr + 2);
UPSCALE_240__WEIGHT(_1, _4, block_dst_ptr, tmp);
UPSCALE_240__WEIGHT(_4, _5, &_4_5, tmp);
UPSCALE_240__WEIGHT(_1_2, _4_5, block_dst_ptr + 1, tmp);
UPSCALE_240__WEIGHT(_5, _6, &_5_6, tmp);
UPSCALE_240__WEIGHT(_2_3, _5_6, block_dst_ptr + 2, tmp);
UPSCALE_240__WEIGHT(_3, _6, block_dst_ptr + 3, tmp);
UPSCALE_240__WEIGHT(_1, _4, block_dst_ptr);
UPSCALE_240__WEIGHT(_4, _5, &_4_5);
UPSCALE_240__WEIGHT(_1_2, _4_5, block_dst_ptr + 1);
UPSCALE_240__WEIGHT(_5, _6, &_5_6);
UPSCALE_240__WEIGHT(_2_3, _5_6, block_dst_ptr + 2);
UPSCALE_240__WEIGHT(_3, _6, block_dst_ptr + 3);
block_src_ptr += src_stride;
block_dst_ptr += dst_stride;
/* -- Row 3 -- */
*(block_dst_ptr ) = _4;
UPSCALE_240__WEIGHT(_4, _5, block_dst_ptr + 1, tmp);
UPSCALE_240__WEIGHT(_5, _6, block_dst_ptr + 2, tmp);
UPSCALE_240__WEIGHT(_4, _5, block_dst_ptr + 1);
UPSCALE_240__WEIGHT(_5, _6, block_dst_ptr + 2);
*(block_dst_ptr + 3) = _6;
block_src += 3;
@ -188,8 +186,6 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
uint16_t _7_8;
uint16_t _8_9;
uint16_t tmp;
/* Horizontally:
* Before(3):
* (a)(b)(c)
@ -210,9 +206,9 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
_3 = *(block_src_ptr + 2);
*(block_dst_ptr ) = _1;
UPSCALE_240__WEIGHT(_1, _2, &_1_2, tmp);
UPSCALE_240__WEIGHT(_1, _2, &_1_2);
*(block_dst_ptr + 1) = _1_2;
UPSCALE_240__WEIGHT(_2, _3, &_2_3, tmp);
UPSCALE_240__WEIGHT(_2, _3, &_2_3);
*(block_dst_ptr + 2) = _2_3;
*(block_dst_ptr + 3) = _3;
@ -224,12 +220,12 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
_5 = *(block_src_ptr + 1);
_6 = *(block_src_ptr + 2);
UPSCALE_240__WEIGHT(_1, _4, block_dst_ptr, tmp);
UPSCALE_240__WEIGHT(_4, _5, &_4_5, tmp);
UPSCALE_240__WEIGHT(_1_2, _4_5, block_dst_ptr + 1, tmp);
UPSCALE_240__WEIGHT(_5, _6, &_5_6, tmp);
UPSCALE_240__WEIGHT(_2_3, _5_6, block_dst_ptr + 2, tmp);
UPSCALE_240__WEIGHT(_3, _6, block_dst_ptr + 3, tmp);
UPSCALE_240__WEIGHT(_1, _4, block_dst_ptr);
UPSCALE_240__WEIGHT(_4, _5, &_4_5);
UPSCALE_240__WEIGHT(_1_2, _4_5, block_dst_ptr + 1);
UPSCALE_240__WEIGHT(_5, _6, &_5_6);
UPSCALE_240__WEIGHT(_2_3, _5_6, block_dst_ptr + 2);
UPSCALE_240__WEIGHT(_3, _6, block_dst_ptr + 3);
block_src_ptr += src_stride;
block_dst_ptr += dst_stride;
@ -239,12 +235,12 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
_8 = *(block_src_ptr + 1);
_9 = *(block_src_ptr + 2);
UPSCALE_240__WEIGHT(_4, _7, block_dst_ptr, tmp);
UPSCALE_240__WEIGHT(_7, _8, &_7_8, tmp);
UPSCALE_240__WEIGHT(_4_5, _7_8, block_dst_ptr + 1, tmp);
UPSCALE_240__WEIGHT(_8, _9, &_8_9, tmp);
UPSCALE_240__WEIGHT(_5_6, _8_9, block_dst_ptr + 2, tmp);
UPSCALE_240__WEIGHT(_6, _9, block_dst_ptr + 3, tmp);
UPSCALE_240__WEIGHT(_4, _7, block_dst_ptr);
UPSCALE_240__WEIGHT(_7, _8, &_7_8);
UPSCALE_240__WEIGHT(_4_5, _7_8, block_dst_ptr + 1);
UPSCALE_240__WEIGHT(_8, _9, &_8_9);
UPSCALE_240__WEIGHT(_5_6, _8_9, block_dst_ptr + 2);
UPSCALE_240__WEIGHT(_6, _9, block_dst_ptr + 3);
block_src_ptr += src_stride;
block_dst_ptr += dst_stride;
@ -271,7 +267,6 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
uint16_t *block_dst_ptr = block_dst;
uint16_t _1, _2, _3;
uint16_t tmp;
/* Horizontally:
* Before(3):
@ -286,8 +281,8 @@ void upscale_240x160_to_320x240_aspect(uint16_t *dst, const uint16_t *src,
_3 = *(block_src_ptr + 2);
*(block_dst_ptr ) = _1;
UPSCALE_240__WEIGHT(_1, _2, block_dst_ptr + 1, tmp);
UPSCALE_240__WEIGHT(_2, _3, block_dst_ptr + 2, tmp);
UPSCALE_240__WEIGHT(_1, _2, block_dst_ptr + 1);
UPSCALE_240__WEIGHT(_2, _3, block_dst_ptr + 2);
*(block_dst_ptr + 3) = _3;
block_src += 3;

View File

@ -3414,8 +3414,7 @@ void input_overlay_init(void)
bool overlay_hide_when_gamepad_connected = settings->bools.input_overlay_hide_when_gamepad_connected;
#if defined(GEKKO)
/* Avoid a crash at startup or even when toggling overlay in rgui */
uint64_t memory_free = frontend_driver_get_free_memory();
if (memory_free < (3 * 1024 * 1024))
if (frontend_driver_get_free_memory() < (3 * 1024 * 1024))
return;
#endif

View File

@ -2173,7 +2173,9 @@ bool task_push_load_contentless_core_from_menu(
content_state_t *p_content = content_state_get_ptr();
bool ret = true;
char *error_string = NULL;
#if defined(HAVE_DYNAMIC)
runloop_state_t *runloop_st = runloop_state_get_ptr();
#endif
settings_t *settings = config_get_ptr();
const char *path_dir_system = settings->paths.directory_system;
bool check_firmware_before_loading = settings->bools.check_firmware_before_loading;

View File

@ -557,7 +557,6 @@ int detect_scd_game(intfstream_t *fd, char *game_id, const char *filename)
int detect_sat_game(intfstream_t *fd, char *game_id, const char *filename)
{
char hyphen = '-';
char raw_game_id[15];
char raw_region_id[15];
char region_id;

View File

@ -576,7 +576,9 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
bool do_refresh = false;
playlist_t *current_playlist = playlist_get_cached();
menu_handle_t *menu = menu_state_get_ptr()->driver_data;
#ifdef HAVE_MATERIALUI
const char *menu_driver = menu_driver_ident();
#endif
if (!task)
return;