From 4e5217db0c352a90c4e580ac57dd3ddc1f83c18e Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 8 Aug 2019 22:25:45 +0100 Subject: [PATCH] Reduce indentation in choosePixelFormat --- gl-natives/src/main/c/jaggl.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/gl-natives/src/main/c/jaggl.c b/gl-natives/src/main/c/jaggl.c index 6f5d6e22db..bd66976504 100644 --- a/gl-natives/src/main/c/jaggl.c +++ b/gl-natives/src/main/c/jaggl.c @@ -574,13 +574,15 @@ JNIEXPORT jboolean JNICALL Java_jaggl_context_choosePixelFormat1(JNIEnv *env, jc } jaggl_visual_info = glXChooseVisual(jaggl_display, DefaultScreen(jaggl_display), attribs); - if (jaggl_visual_info) { - jaggl_double_buffered = double_buffered; - jaggl_alpha_bits = alpha_bits; - - result = JNI_TRUE; - goto dsi_free; + if (!jaggl_visual_info) { + continue; } + + jaggl_double_buffered = double_buffered; + jaggl_alpha_bits = alpha_bits; + + result = JNI_TRUE; + goto dsi_free; } #elif defined(_WIN32) JAWT_Win32DrawingSurfaceInfo *platformInfo = (JAWT_Win32DrawingSurfaceInfo *) dsi->platformInfo; @@ -664,12 +666,14 @@ JNIEXPORT jboolean JNICALL Java_jaggl_context_choosePixelFormat1(JNIEnv *env, jc continue; } - if (SetPixelFormat(jaggl_device, format, &pfd)) { - jaggl_alpha_bits = alpha_bits; - - result = JNI_TRUE; - goto dsi_free; + if (!SetPixelFormat(jaggl_device, format, &pfd)) { + continue; } + + jaggl_alpha_bits = alpha_bits; + + result = JNI_TRUE; + goto dsi_free; } }