From 0a7c24e48c00b36dc82a206c4f2e88e4eab60379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 19 May 2020 17:59:18 +0200 Subject: [PATCH] X11: Clarify code flow for Clang static analysis (cherry picked from commit ef5220d6b10174d0f7cce965475e34527afcfbcf) --- src/x11_window.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index c3cc82b0..37c34fae 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1979,7 +1979,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { - Visual* visual; + Visual* visual = NULL; int depth; if (ctxconfig->client != GLFW_NO_API) @@ -2005,8 +2005,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, } } - if (ctxconfig->client == GLFW_NO_API || - ctxconfig->source == GLFW_OSMESA_CONTEXT_API) + if (!visual) { visual = DefaultVisual(_glfw.x11.display, _glfw.x11.screen); depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen);