From 9da0ba52db485649eae5cc40bfc3d1a25bcafc38 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 22 May 2020 23:32:12 +0200 Subject: [PATCH] X11: Clarify code flow for Clang static analysis From upstream: https://github.com/glfw/glfw/commit/ef5220d6b10174d0f7cce965475e34527afcfbcf. --- glfw/x11_window.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 56f6ee624..fd1c50d0f 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -1825,7 +1825,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { - Visual* visual; + Visual* visual = NULL; int depth; if (ctxconfig->client != GLFW_NO_API) @@ -1851,8 +1851,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);