1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 00:38:44 +00:00

Fix c89 build with clang.

This commit is contained in:
orbea 2018-12-16 06:38:56 -08:00
parent c0ea6e7574
commit 6e95a62fdf
10 changed files with 43 additions and 28 deletions

View File

@ -1947,7 +1947,7 @@ void config_set_defaults(void)
for (i = 0; i < MAX_USERS; i++)
{
settings->uints.input_joypad_map[i] = i;
#ifdef SWITCH // Switch prefered default dpad mode
#ifdef SWITCH /* Switch prefered default dpad mode */
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
#else
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;

View File

@ -295,17 +295,17 @@ static void ozone_free(void *data)
static void ozone_context_reset(void *data, bool is_threaded)
{
/* Fonts init */
unsigned i;
unsigned size;
char font_path[PATH_MAX_LENGTH];
ozone_handle_t *ozone = (ozone_handle_t*) data;
if (ozone)
{
ozone->has_all_assets = true;
/* Fonts init */
unsigned i;
unsigned size;
char font_path[PATH_MAX_LENGTH];
fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
@ -423,6 +423,7 @@ static void ozone_context_destroy(void *data)
{
unsigned i;
ozone_handle_t *ozone = (ozone_handle_t*) data;
menu_animation_ctx_tag tag;
if (!ozone)
return;
@ -458,7 +459,7 @@ static void ozone_context_destroy(void *data)
ozone->fonts.entries_sublabel = NULL;
ozone->fonts.sidebar = NULL;
menu_animation_ctx_tag tag = (uintptr_t) &ozone_default_theme;
tag = (uintptr_t) &ozone_default_theme;
menu_animation_kill_by_tag(&tag);
/* Horizontal list */
@ -798,6 +799,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
/* Compute entries height and adjust scrolling if needed */
unsigned video_info_height;
unsigned video_info_width;
unsigned lines;
size_t i, entries_end;
file_list_t *selection_buf = NULL;
@ -847,7 +849,7 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
word_wrap(sublabel_str, sublabel_str, (video_info_width - 548) / ozone->sublabel_font_glyph_width, false);
unsigned lines = ozone_count_lines(sublabel_str);
lines = ozone_count_lines(sublabel_str);
if (lines > 1)
{
@ -1358,6 +1360,8 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab
{
ozone_handle_t *ozone = (ozone_handle_t*) data;
int new_depth;
if (!ozone)
return;
@ -1374,7 +1378,7 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab
ozone->need_compute = true;
int new_depth = (int)ozone_list_get_size(ozone, MENU_LIST_PLAIN);
new_depth = (int)ozone_list_get_size(ozone, MENU_LIST_PLAIN);
ozone->fade_direction = new_depth <= ozone->depth;
ozone->depth = new_depth;

View File

@ -427,4 +427,4 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
end:
string_list_free(list);
}
}

View File

@ -59,4 +59,4 @@ void ozone_draw_osk(ozone_handle_t *ozone,
void ozone_draw_messagebox(ozone_handle_t *ozone,
video_frame_info_t *video_info,
const char *message);
const char *message);

View File

@ -317,4 +317,4 @@ icons_iterate:
/* Text layer */
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_label, video_info);
font_driver_flush(video_info->width, video_info->height, ozone->fonts.entries_sublabel, video_info);
}
}

View File

@ -295,11 +295,20 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
{
unsigned video_info_height;
video_driver_get_size(NULL, &video_info_height);
struct menu_animation_ctx_entry entry;
menu_animation_ctx_tag tag = (uintptr_t)ozone;
menu_animation_ctx_tag tag;
float new_scroll;
float selected_position_y;
float current_selection_middle_onscreen;
float bottom_boundary;
float entries_middle;
float entries_height;
video_driver_get_size(NULL, &video_info_height);
tag = (uintptr_t)ozone;
if (ozone->categories_selection_ptr != new_selection)
{
@ -325,12 +334,12 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
menu_animation_push(&entry);
/* Scroll animation */
float new_scroll = 0;
float selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
float current_selection_middle_onscreen = ENTRIES_START_Y - 10 + ozone->animations.scroll_y_sidebar + selected_position_y + 65 / 2;
float bottom_boundary = video_info_height - 87 - 78;
float entries_middle = video_info_height/2;
float entries_height = ozone_get_sidebar_height(ozone);
new_scroll = 0;
selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
current_selection_middle_onscreen = ENTRIES_START_Y - 10 + ozone->animations.scroll_y_sidebar + selected_position_y + 65 / 2;
bottom_boundary = video_info_height - 87 - 78;
entries_middle = video_info_height/2;
entries_height = ozone_get_sidebar_height(ozone);
if (current_selection_middle_onscreen != entries_middle)
new_scroll = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
@ -456,6 +465,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
unsigned i;
const char *title;
char title_noext[255];
char *chr;
bool hyphen_found;
size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL);
@ -567,8 +578,8 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
/* Format : "Vendor - Console"
Remove everything before the hyphen
and the subsequent space */
char *chr = title_noext;
bool hyphen_found = false;
chr = title_noext;
hyphen_found = false;
while (true)
{
@ -651,4 +662,4 @@ bool ozone_is_playlist(ozone_handle_t *ozone)
}
return is_playlist && ozone->depth == 1;
}
}

View File

@ -52,4 +52,4 @@ extern enum msg_hash_enums ozone_system_tabs_idx[OZONE_SYSTEM_TAB_LAST];
extern unsigned ozone_system_tabs_icons[OZONE_SYSTEM_TAB_LAST];
#endif
#endif

View File

@ -168,4 +168,4 @@ extern ozone_theme_t *ozone_default_theme;
void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme);
unsigned ozone_get_system_theme();
#endif
#endif

View File

@ -2713,4 +2713,4 @@ void menu_subsystem_populate(const struct retro_subsystem_info* subsystem, menu_
}
}
}
}
}

View File

@ -122,4 +122,4 @@ static unsigned SWITCH_CPU_SPEEDS_VALUES[] = {
#endif
#endif
#endif