X11: Clarify code flow for Clang static analysis

From upstream: https://github.com/glfw/glfw/commit/ef5220d6b10174d0f7cce965475e34527afcfbcf.
This commit is contained in:
Luflosi
2020-05-22 23:32:12 +02:00
parent 7bfb07e59e
commit 9da0ba52db
+2 -3
View File
@@ -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);