mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
cogl: fix a compile warning
In find_onscreen_for_xid() we want to loop over the framebuffers and skip any that is not onscreen. The code today does this by negating the framebuffer type variable and skipping if that equals COGL_FRAMEBUFFER_TYPE_ONSCREEN. This actually works as the enum used will function as a boolean: typedef enum _CoglFramebufferType { COGL_FRAMEBUFFER_TYPE_ONSCREEN, COGL_FRAMEBUFFER_TYPE_OFFSCREEN } CoglFramebufferType; But it is a bit weird logic and fragile if more types are added. (not that I can think of any different type...) To simplify this, and to silence a warning in clang this patch just changes it to a != test. https://gitlab.gnome.org/GNOME/mutter/merge_requests/905
This commit is contained in:
parent
793c2ac58d
commit
7c036c5896
@ -81,7 +81,7 @@ find_onscreen_for_xid (CoglContext *context, uint32_t xid)
|
||||
CoglOnscreenEGL *egl_onscreen;
|
||||
CoglOnscreenXlib *xlib_onscreen;
|
||||
|
||||
if (!framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN)
|
||||
if (framebuffer->type != COGL_FRAMEBUFFER_TYPE_ONSCREEN)
|
||||
continue;
|
||||
|
||||
egl_onscreen = COGL_ONSCREEN (framebuffer)->winsys;
|
||||
|
Loading…
Reference in New Issue
Block a user