From 8817a5f16317c38b8fc27fe7657aac72546d2dab Mon Sep 17 00:00:00 2001
From: Daniel Stone <daniels@collabora.com>
Date: Thu, 18 Nov 2021 14:57:22 +0000
Subject: [PATCH] backend-x11: Fix EGL compile warning

EGLNativeWindowType can be a lot of different things, including a
pointer which an XID is not. Explicitly cast it through uintptr_t so we
don't throw build warnings either way.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 libweston/backend-x11/x11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libweston/backend-x11/x11.c b/libweston/backend-x11/x11.c
index 31591343a0..5c82584baf 100644
--- a/libweston/backend-x11/x11.c
+++ b/libweston/backend-x11/x11.c
@@ -857,7 +857,7 @@ x11_output_switch_mode(struct weston_output *base, struct weston_mode *mode)
 	} else {
 		Window xid = (Window) output->window;
 		const struct gl_renderer_output_options options = {
-			.window_for_legacy = (EGLNativeWindowType) output->window,
+			.window_for_legacy = (EGLNativeWindowType) (uintptr_t) output->window,
 			.window_for_platform = &xid,
 			.drm_formats = x11_formats,
 			.drm_formats_count = ARRAY_LENGTH(x11_formats),
@@ -1037,7 +1037,7 @@ x11_output_enable(struct weston_output *base)
 		 * but eglCreateWindowSurface takes a Window. */
 		Window xid = (Window) output->window;
 		const struct gl_renderer_output_options options = {
-			.window_for_legacy = (EGLNativeWindowType) output->window,
+			.window_for_legacy = (EGLNativeWindowType) (uintptr_t) output->window,
 			.window_for_platform = &xid,
 			.drm_formats = x11_formats,
 			.drm_formats_count = ARRAY_LENGTH(x11_formats),
-- 
GitLab