From: Emil Velikov <[email protected]>

The variable num is of EGLint type.

Signed-off-by: Emil Velikov <[email protected]>
---
Unrelated:

The functions gl_renderer_query_dmabuf_* return bool as per the
interface. At the same time:
 - the caller does not check for it
 - the function happily writes over the output storage on error

Worth just dropping the return type, and documenting that on error
num_formats shall return 0?
---
 libweston/gl-renderer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index da29b072..cdeb82fd 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -1921,8 +1921,7 @@ gl_renderer_query_dmabuf_formats(struct weston_compositor 
*wc,
                *num_formats = 0;
                return false;
        }
-       if (!gr->query_dmabuf_formats(gr->egl_display, num, *formats,
-                       (EGLint*) &num)) {
+       if (!gr->query_dmabuf_formats(gr->egl_display, num, *formats, &num)) {
                *num_formats = 0;
                free(*formats);
                return false;
-- 
2.13.3

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to