From 49c78ea2ffa91b58facaf1f4323dbc02700d5ffa Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 4 Dec 2016 03:51:12 +0100 Subject: [PATCH] (Drivers context) Cleanups --- gfx/drivers_context/android_ctx.c | 15 ++++++++------- gfx/drivers_context/drm_ctx.c | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index 2801deabf8..033e83f498 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -40,13 +40,13 @@ #include "../../configuration.h" #include "../../runloop.h" -static enum gfx_ctx_api android_api; +static enum gfx_ctx_api android_api = GFX_CTX_NONE; /* forward declaration */ int system_property_get(const char *cmd, const char *args, char *value); #ifdef HAVE_OPENGLES -static bool g_es3; +static bool g_es3 = false; #ifndef EGL_OPENGL_ES3_BIT_KHR #define EGL_OPENGL_ES3_BIT_KHR 0x0040 @@ -251,8 +251,8 @@ static void android_gfx_ctx_check_window(void *data, bool *quit, #ifdef HAVE_VULKAN /* Swapchains are recreated in set_resize as a * central place, so use that to trigger swapchain reinit. */ - *resize = and->vk.need_new_swapchain; - new_width = and->width; + *resize = and->vk.need_new_swapchain; + new_width = and->width; new_height = and->height; #endif break; @@ -280,7 +280,7 @@ static bool android_gfx_ctx_set_resize(void *data, unsigned width, unsigned height) { #ifdef HAVE_VULKAN - android_ctx_data_t *and = (android_ctx_data_t*)data; + android_ctx_data_t *and = (android_ctx_data_t*)data; struct android_app *android_app = (struct android_app*)g_android; #endif (void)data; @@ -371,7 +371,7 @@ static void android_gfx_ctx_input_driver(void *data, (void)data; - *input = androidinput ? &input_android : NULL; + *input = androidinput ? &input_android : NULL; *input_data = androidinput; } @@ -407,6 +407,7 @@ static bool android_gfx_ctx_bind_api(void *data, #else break; #endif + case GFX_CTX_NONE: default: break; } @@ -416,7 +417,7 @@ static bool android_gfx_ctx_bind_api(void *data, static bool android_gfx_ctx_has_focus(void *data) { - bool focused; + bool focused = false; struct android_app *android_app = (struct android_app*)g_android; if (!android_app) return true; diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index d3ca729ca4..026bc1c250 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -61,14 +61,14 @@ #endif -static enum gfx_ctx_api drm_api; +static enum gfx_ctx_api drm_api = GFX_CTX_NONE; -static struct gbm_bo *g_bo; -static struct gbm_bo *g_next_bo; -static struct gbm_surface *g_gbm_surface; -static struct gbm_device *g_gbm_dev; +static struct gbm_bo *g_bo = NULL; +static struct gbm_bo *g_next_bo = NULL; +static struct gbm_surface *g_gbm_surface = NULL; +static struct gbm_device *g_gbm_dev = NULL; -static bool waiting_for_flip; +static bool waiting_for_flip = false; typedef struct gfx_ctx_drm_data { @@ -365,7 +365,7 @@ static void *gfx_ctx_drm_init(void *video_driver) unsigned gpu_index = 0; const char *gpu = NULL; struct string_list *gpu_descriptors = NULL; - gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*) + gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*) calloc(1, sizeof(gfx_ctx_drm_data_t)); if (!drm)