qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unused variables in dbus_call_update_gl


From: BALATON Zoltan
Subject: Re: Unused variables in dbus_call_update_gl
Date: Thu, 29 Jun 2023 15:15:24 +0200 (CEST)

On Thu, 29 Jun 2023, BALATON Zoltan wrote:
> Hello,
>
> After recent commits I'm now getting:
>
> ../ui/dbus-listener.c: In function ‘dbus_call_update_gl’:
> ../ui/dbus-listener.c:210:26: error: unused variable ‘ddl’ 
> [-Werror=unused-variable]
>  210 |     DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, 
> dcl);
>      |                          ^~~
> At top level:
> ../ui/dbus-listener.c:180:13: error: ‘dbus_update_gl_cb’ defined but not used 
> [-Werror=unused-function]
>  180 | static void dbus_update_gl_cb(GObject *source_object,
>      |             ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> when compiling on Linux with gcc.

The patch below seems to fix compilation for me but not sure what else 
would it break.

Regards,
BALATON Zoltan

diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index e10162b279..601c134e09 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -177,6 +177,7 @@ fail:
 }
 #endif /* WIN32 */

+#if defined (CONFIG_GBM) || defined (WIN32)
 static void dbus_update_gl_cb(GObject *source_object,
                               GAsyncResult *res,
                               gpointer user_data)
@@ -203,12 +204,14 @@ static void dbus_update_gl_cb(GObject *source_object,
     graphic_hw_gl_block(ddl->dcl.con, false);
     g_object_unref(ddl);
 }
+#endif

 static void dbus_call_update_gl(DisplayChangeListener *dcl,
                                 int x, int y, int w, int h)
 {
+#if defined (CONFIG_GBM) || defined (WIN32)
     DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl);
-
+#endif
     trace_dbus_update_gl(x, y, w, h);

     glFlush();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]