From b73243b52129585821c0e58dfc315cc612b1c11a Mon Sep 17 00:00:00 2001 From: Themaister Date: Mon, 1 Oct 2012 00:11:39 +0200 Subject: [PATCH] Fix CXX_BUILD. --- gfx/context/glx_ctx.c | 28 +++++++++++++++------------- tools/retroarch-joyconfig.c | 6 +++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index 7aea19ba65..7a450c410e 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -172,18 +172,6 @@ static bool gfx_ctx_init(void) if (g_inited) return false; - g_quit = 0; - - g_dpy = XOpenDisplay(NULL); - if (!g_dpy) - goto error; - - // GLX 1.3+ required. - int major, minor; - glXQueryVersion(g_dpy, &major, &minor); - if (major < 1 || (major == 1 && minor < 3)) - goto error; - static const int visual_attribs[] = { GLX_X_RENDERABLE , True, GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT, @@ -198,8 +186,22 @@ static bool gfx_ctx_init(void) None }; + GLXFBConfig *fbcs = NULL; + + g_quit = 0; + + g_dpy = XOpenDisplay(NULL); + if (!g_dpy) + goto error; + + // GLX 1.3+ required. + int major, minor; + glXQueryVersion(g_dpy, &major, &minor); + if (major < 1 || (major == 1 && minor < 3)) + goto error; + int nelements; - GLXFBConfig *fbcs = glXChooseFBConfig(g_dpy, DefaultScreen(g_dpy), + fbcs = glXChooseFBConfig(g_dpy, DefaultScreen(g_dpy), visual_attribs, &nelements); if (!fbcs) diff --git a/tools/retroarch-joyconfig.c b/tools/retroarch-joyconfig.c index c37f9e702c..df11e6c941 100644 --- a/tools/retroarch-joyconfig.c +++ b/tools/retroarch-joyconfig.c @@ -216,7 +216,7 @@ static void get_binds(config_file_t *conf, int player, int joypad) rarch_sleep(10); poll_joypad(driver, joypad, &new_poll); - for (unsigned j = 0; j < MAX_BUTTONS; j++) + for (int j = 0; j < MAX_BUTTONS; j++) { if (new_poll.buttons[j] && !old_poll.buttons[j]) { @@ -226,7 +226,7 @@ static void get_binds(config_file_t *conf, int player, int joypad) } } - for (unsigned j = 0; j < MAX_AXES; j++) + for (int j = 0; j < MAX_AXES; j++) { if (new_poll.axes[j] != old_poll.axes[j]) { @@ -269,7 +269,7 @@ static void get_binds(config_file_t *conf, int player, int joypad) } } - for (unsigned j = 0; j < MAX_HATS; j++) + for (int j = 0; j < MAX_HATS; j++) { const char *quark = NULL; uint16_t value = new_poll.hats[j];