From c35d723b406158ce7d2498e513e6663bec417e26 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 4 Nov 2016 14:29:02 +0100 Subject: [PATCH] Fix C89_BUILD --- input/input_keyboard.c | 8 ++++---- input/input_keyboard.h | 2 +- menu/drivers/materialui.c | 14 ++++++++------ menu/drivers/xmb.c | 10 ++++++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/input/input_keyboard.c b/input/input_keyboard.c index 732c2cde09..db4d9798a3 100644 --- a/input/input_keyboard.c +++ b/input/input_keyboard.c @@ -46,7 +46,7 @@ static input_keyboard_line_t *g_keyboard_line = NULL; static void *g_keyboard_press_data = NULL; -static bool return_pressed = false;; +static bool kb_return_pressed = false; static unsigned osk_last_codepoint = 0; static unsigned osk_last_codepoint_len = 0; @@ -90,9 +90,9 @@ static void osk_update_last_char(const char c) osk_update_last_codepoint(array); } -bool input_keyboard_return_pressed() +bool input_keyboard_return_pressed(void) { - return return_pressed; + return kb_return_pressed; } static void input_keyboard_line_toggle_osk(bool enable) @@ -293,7 +293,7 @@ void input_keyboard_event(bool down, unsigned code, static bool deferred_wait_keys; if (code == RETROK_RETURN || (!down && code == RETROK_UNKNOWN)) - return_pressed = down; + kb_return_pressed = down; if (deferred_wait_keys) { diff --git a/input/input_keyboard.h b/input/input_keyboard.h index fc287e1c0c..e99bef87cc 100644 --- a/input/input_keyboard.h +++ b/input/input_keyboard.h @@ -98,7 +98,7 @@ const char **input_keyboard_start_line(void *userdata, bool input_keyboard_ctl(enum rarch_input_keyboard_ctl_state state, void *data); -bool input_keyboard_return_pressed(); +bool input_keyboard_return_pressed(void); RETRO_END_DECLS diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 8edef549b8..11f81e4954 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -263,6 +263,7 @@ static void mui_draw_tab(mui_handle_t *mui, static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned id) { + int ptr_width, ptr_height; unsigned i, width, height; float dark[16]= { 0.00, 0.00, 0.00, 0.85, @@ -284,17 +285,17 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned width, height, &dark[0]); - int ptr_width = width / 11; - int ptr_height = height / 10; + ptr_width = width / 11; + ptr_height = height / 10; if (ptr_width >= ptr_height) ptr_width = ptr_height; for (i = 0; i < 44; i++) { - int line_y = (i / 11)*height/10.0; - + int line_y = (i / 11)*height/10.0; uintptr_t texture = mui->textures.list[MUI_TEXTURE_KEY]; + if (i == id) texture = mui->textures.list[MUI_TEXTURE_KEY_HOVER]; @@ -319,6 +320,7 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned /* Returns the OSK key at a given position */ static int mui_osk_ptr_at_pos(void *data, int x, int y) { + int ptr_width, ptr_height; unsigned i, width, height; mui_handle_t *mui = (mui_handle_t*)data; @@ -327,8 +329,8 @@ static int mui_osk_ptr_at_pos(void *data, int x, int y) video_driver_get_size(&width, &height); - int ptr_width = width / 11; - int ptr_height = height / 10; + ptr_width = width / 11; + ptr_height = height / 10; if (ptr_width >= ptr_height) ptr_width = ptr_height; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 495e23c8fc..ce2c906ba7 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -679,6 +679,7 @@ static void xmb_messagebox(void *data, const char *message) static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned id) { + int ptr_width, ptr_height; unsigned i, width, height; float dark[16]= { 0.00, 0.00, 0.00, 0.85, @@ -700,8 +701,8 @@ static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned width, height, &dark[0]); - int ptr_width = width / 11; - int ptr_height = height / 10; + ptr_width = width / 11; + ptr_height = height / 10; if (ptr_width >= ptr_height) ptr_width = ptr_height; @@ -737,6 +738,7 @@ static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned /* Returns the OSK key at a given position */ static int xmb_osk_ptr_at_pos(void *data, int x, int y) { + int ptr_width, ptr_height; unsigned i, width, height; xmb_handle_t *xmb = (xmb_handle_t*)data; @@ -745,8 +747,8 @@ static int xmb_osk_ptr_at_pos(void *data, int x, int y) video_driver_get_size(&width, &height); - int ptr_width = width / 11; - int ptr_height = height / 10; + ptr_width = width / 11; + ptr_height = height / 10; if (ptr_width >= ptr_height) ptr_width = ptr_height;