[PATCH weston] gl-renderer: remove unneeded cast

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 31 19:45:20 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

The variable num is of EGLint type.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
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



More information about the wayland-devel mailing list