X11: Clarify code flow for Clang static analysis

From upstream: ef5220d6b1.
This commit is contained in:
Luflosi 2020-05-22 23:32:12 +02:00
parent 7bfb07e59e
commit 9da0ba52db
No known key found for this signature in database
GPG Key ID: 4E41E29EDCC345D0

5
glfw/x11_window.c vendored
View File

@ -1825,7 +1825,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig, const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig) const _GLFWfbconfig* fbconfig)
{ {
Visual* visual; Visual* visual = NULL;
int depth; int depth;
if (ctxconfig->client != GLFW_NO_API) if (ctxconfig->client != GLFW_NO_API)
@ -1851,8 +1851,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
} }
} }
if (ctxconfig->client == GLFW_NO_API || if (!visual)
ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
{ {
visual = DefaultVisual(_glfw.x11.display, _glfw.x11.screen); visual = DefaultVisual(_glfw.x11.display, _glfw.x11.screen);
depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen); depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen);