Skip to contentSkip to conversation

Unused variables in dbus_call_update_gl

DISCUSSION BALATON Zoltan 3 participants 4 messages Jun 29, 2023 – Jun 30, 2023

lore
Share & tools
lore
#0 lore raw

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.

Regards,
BALATON Zoltan

#1 lore raw
Quoted 14 lines · BALATON Zoltan

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,

Quoted 4 lines
     |             ^~~~~~~~~~~~~~~~~

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

ui/dbus-listener.c +4 -1
index e10162b279..601c134e09 100644
@@ -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();
#2 lore raw
Quoted 44 lines · BALATON Zoltan
Quoted 14 lines · BALATON Zoltan

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,

Quoted 4 lines
      |             ^~~~~~~~~~~~~~~~~

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

ui/dbus-listener.c +2 -0
index e10162b279..601c134e09 100644
@@ -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
 

ui/dbus-listener.c static void dbus_update_gl_cb(GObject *source_object, · line 217

Quoted 10 lines
ui/dbus-listener.c +2 -1
  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();

I'm going to commit this later today unless Marc can immediately suggest something better, to un-break the tree. I really should have done more thorough testing earlier, and not allowed the merge to proceed... Ho hum.

r~

#3 lore raw

Hi Richard

Quoted 58 lines · Richard Henderson
Quoted 9 lines · BALATON Zoltan
Quoted 8 lines · BALATON Zoltan

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,

Quoted 4 lines
Quoted 4 lines

dcl);
| ^~~
At top level:
../ui/dbus-listener.c:180:13: error: ‘dbus_update_gl_cb’ defined but

not used

ui/dbus-listener.c static void dbus_update_gl_cb(GObject

Quoted 26 lines
Quoted 6 lines

[-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

ui/dbus-listener.c +1 -0
index e10162b279..601c134e09 100644
@@ -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,

ui/dbus-listener.c static void dbus_update_gl_cb(GObject *source_object,

Quoted 10 lines
ui/dbus-listener.c +2 -0
      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);

Quoted 4 lines
ui/dbus-listener.c +1 -1
-
+#endif
      trace_dbus_update_gl(x, y, w, h);
 
Quoted 10 lines

ui/dbus-listener.c static void dbus_update_gl_cb(GObject *source_object, · line 217

Quoted 1 line
ui/dbus-listener.c +0 -0
      glFlush();

I'm going to commit this later today unless Marc can immediately suggest something better,
to un-break the tree. I really should have done more thorough testing earlier, and not
allowed the merge to proceed... Ho hum.

Please commit, along with "[PATCH] audio: dbus requires pixman"

thanks