Fix C89_BUILD error and several style nits

This commit is contained in:
twinaphex 2020-05-24 17:41:27 +02:00
parent 8ce192de82
commit 93e8edf2f9
2 changed files with 44 additions and 38 deletions

View File

@ -168,10 +168,11 @@ void fill_pathname_application_special(char *s,
break; break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_PKG: case APPLICATION_SPECIAL_DIRECTORY_ASSETS_PKG:
{ {
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
s1[0] = '\0';
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
char *s1 = (char*)malloc(
PATH_MAX_LENGTH * sizeof(char));
const char *dir_assets = settings->paths.directory_assets; const char *dir_assets = settings->paths.directory_assets;
s1[0] = '\0';
fill_pathname_join(s1, dir_assets, "pkg", PATH_MAX_LENGTH * sizeof(char)); fill_pathname_join(s1, dir_assets, "pkg", PATH_MAX_LENGTH * sizeof(char));
strlcpy(s, s1, len); strlcpy(s, s1, len);
free(s1); free(s1);
@ -339,7 +340,8 @@ void fill_pathname_application_special(char *s,
s1[0] = '\0'; s1[0] = '\0';
switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE)) { switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE))
{
case RETRO_LANGUAGE_ARABIC: case RETRO_LANGUAGE_ARABIC:
fill_pathname_application_special(s1, fill_pathname_application_special(s1,
PATH_MAX_LENGTH * sizeof(char), PATH_MAX_LENGTH * sizeof(char),
@ -384,7 +386,8 @@ void fill_pathname_application_special(char *s,
s1[0] = '\0'; s1[0] = '\0';
switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE)) { switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE))
{
case RETRO_LANGUAGE_ARABIC: case RETRO_LANGUAGE_ARABIC:
fill_pathname_application_special(s1, fill_pathname_application_special(s1,
PATH_MAX_LENGTH * sizeof(char), PATH_MAX_LENGTH * sizeof(char),

View File

@ -576,9 +576,10 @@ static void ozone_cache_footer_labels(ozone_handle_t *ozone)
/* Determines the size of all menu elements */ /* Determines the size of all menu elements */
static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded) static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded)
{ {
float scale_factor;
bool font_inited;
char font_path[PATH_MAX_LENGTH]; char font_path[PATH_MAX_LENGTH];
float scale_factor = 0.0f;
bool font_inited = false;
char *s1 = NULL;
font_path[0] = '\0'; font_path[0] = '\0';
@ -636,9 +637,10 @@ static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded)
ozone->pointer_active_delta = CURSOR_ACTIVE_DELTA * scale_factor; ozone->pointer_active_delta = CURSOR_ACTIVE_DELTA * scale_factor;
/* Initialise fonts */ /* Initialise fonts */
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
s1[0] = '\0'; s1[0] = '\0';
switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE)) { switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE))
{
case RETRO_LANGUAGE_ARABIC: case RETRO_LANGUAGE_ARABIC:
fill_pathname_application_special(s1, fill_pathname_application_special(s1,
PATH_MAX_LENGTH * sizeof(char), PATH_MAX_LENGTH * sizeof(char),
@ -666,7 +668,8 @@ static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded)
is_threaded, font_path, FONT_SIZE_TITLE * scale_factor); is_threaded, font_path, FONT_SIZE_TITLE * scale_factor);
ozone->has_all_assets = ozone->has_all_assets && font_inited; ozone->has_all_assets = ozone->has_all_assets && font_inited;
switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE)) { switch (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE))
{
case RETRO_LANGUAGE_ARABIC: case RETRO_LANGUAGE_ARABIC:
fill_pathname_application_special(s1, fill_pathname_application_special(s1,
PATH_MAX_LENGTH * sizeof(char), PATH_MAX_LENGTH * sizeof(char),