From b979e81b6104fd163c0d1cb4e2ebf410458cc27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Mon, 16 Mar 2015 13:52:55 -0300 Subject: [PATCH 1/3] (sdl2_gfx.c) Fix CXX build --- gfx/drivers/sdl2_gfx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index 39b21e19e1..52e409c85e 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -46,9 +46,9 @@ typedef struct sdl2_tex { SDL_Texture *tex; - int w; - int h; - int pitch; + unsigned w; + unsigned h; + size_t pitch; bool active; bool rgb32; } sdl2_tex_t; @@ -190,12 +190,12 @@ static void sdl2_render_msg(sdl2_video_t *vid, const char *msg) SDL_Rect srcrect = { tex_x, tex_y, - gly->width, gly->height + (int)gly->width, (int)gly->height }; SDL_Rect dstrect = { x + delta_x + off_x, y + delta_y + off_y, - gly->width, gly->height + (int)gly->width, (int)gly->height }; SDL_RenderCopyEx(vid->renderer, vid->font.tex, &srcrect, &dstrect, 0, NULL, SDL_FLIP_NONE); @@ -251,7 +251,7 @@ static void sdl2_init_renderer(sdl2_video_t *vid) static void sdl_refresh_renderer(sdl2_video_t *vid) { SDL_RenderClear(vid->renderer); - SDL_Rect r = { vid->vp.x, vid->vp.y, vid->vp.width, vid->vp.height }; + SDL_Rect r = { vid->vp.x, vid->vp.y, (int)vid->vp.width, (int)vid->vp.height }; SDL_RenderSetViewport(vid->renderer, &r); // breaks int scaling From 7d1b2467da3e08e1d4e16d18cfdd4675c141bad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Mon, 16 Mar 2015 13:59:55 -0300 Subject: [PATCH 2/3] (sdl_input.c) Fix CXX build --- input/drivers/sdl_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index ab83bc402e..37db31ec6e 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -62,13 +62,13 @@ static bool sdl_key_pressed(int key) sym = input_keymaps_translate_rk_to_keysym((enum retro_key)key); -#if HAVE_SDL2 +#ifdef HAVE_SDL2 sym = SDL_GetScancodeFromKey(sym); keymap = SDL_GetKeyboardState(&num_keys); #else keymap = SDL_GetKeyState(&num_keys); #endif - if (sym < 0 || sym >= num_keys) + if (sym < 0 || sym >= (unsigned)num_keys) return false; return keymap[sym]; From 814777d16b6d965e91c01fa7088e3207f79e5965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Mon, 16 Mar 2015 14:00:56 -0300 Subject: [PATCH 3/3] (menu_entries_cbs) Propagate extern C attribute in CXX builds --- menu/menu_entries_cbs_refresh.c | 1 + menu/menu_entries_cbs_select.c | 1 + menu/menu_entries_cbs_up_or_down.c | 1 + 3 files changed, 3 insertions(+) diff --git a/menu/menu_entries_cbs_refresh.c b/menu/menu_entries_cbs_refresh.c index 974891a840..5e58fec1a5 100644 --- a/menu/menu_entries_cbs_refresh.c +++ b/menu/menu_entries_cbs_refresh.c @@ -15,6 +15,7 @@ #include "menu.h" #include "menu_entries.h" +#include "menu_entries_cbs.h" static int action_refresh_default(file_list_t *list, file_list_t *menu_list) { diff --git a/menu/menu_entries_cbs_select.c b/menu/menu_entries_cbs_select.c index 8dd8a4d8c1..66f1ae8685 100644 --- a/menu/menu_entries_cbs_select.c +++ b/menu/menu_entries_cbs_select.c @@ -15,6 +15,7 @@ #include "menu.h" #include "menu_entries.h" +#include "menu_entries_cbs.h" static int action_select_default(unsigned type, const char *label, unsigned action) diff --git a/menu/menu_entries_cbs_up_or_down.c b/menu/menu_entries_cbs_up_or_down.c index 7eea4a41bb..eecaad627f 100644 --- a/menu/menu_entries_cbs_up_or_down.c +++ b/menu/menu_entries_cbs_up_or_down.c @@ -16,6 +16,7 @@ #include "menu.h" #include "menu_entries.h" #include "menu_navigation.h" +#include "menu_entries_cbs.h" static int action_bind_up_or_down_generic(unsigned type, const char *label, unsigned action)