st/wgl: clarify code in stw_framebuffer_from_hwnd_locked()
authorBrian Paul <brianp@vmware.com>
Tue, 10 Nov 2015 00:25:22 +0000 (17:25 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 11 Nov 2015 16:38:22 +0000 (09:38 -0700)
Just a minor code change to make it obvious that NULL is returned when
we don't find the given HWND.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/state_trackers/wgl/stw_framebuffer.c

index 95d892add34c0ac6f47ad7873e69459aa89dcedd..09dede8d2a18bedec920b3b0ad30b927092d41a6 100644 (file)
@@ -55,10 +55,10 @@ stw_framebuffer_from_hwnd_locked(HWND hwnd)
    for (fb = stw_dev->fb_head; fb != NULL; fb = fb->next)
       if (fb->hWnd == hwnd) {
          pipe_mutex_lock(fb->mutex);
-         break;
+         return fb;
       }
 
-   return fb;
+   return NULL;
 }