From 82a970f415a20de15e88e0d6f8497a7ed24a0a06 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 27 Aug 2019 10:02:04 -0400 Subject: [PATCH] ges: fix G_DECLARE_FINAL_TYPE -Werror with clang Also fix wrong casing the `G_DECLARE` for GESDemux. ../subprojects/gst-editing-services/plugins/ges/gessrc.c:56:1: warning: unused function 'GES_SRC' [-Wunused-function] G_DECLARE_FINAL_TYPE (GESSrc, ges_src, GES, SRC, GESBaseBin); ^ /usr/include/glib-2.0/gobject/gtype.h:1405:33: note: expanded from macro 'G_DECLARE_FINAL_TYPE' static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \ ^ :39:1: note: expanded from here GES_SRC ^ ../subprojects/gst-editing-services/plugins/ges/gessrc.c:56:1: warning: unused function 'GES_IS_SRC' [-Wunused-function] /usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE' static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \ ^ :42:1: note: expanded from here GES_IS_SRC ^ ../subprojects/gst-editing-services/plugins/ges/gesdemux.c:50:1: warning: unused function 'GES_Demux' [-Wunused-function] G_DECLARE_FINAL_TYPE (GESDemux, ges_demux, GES, Demux, GESBaseBin); ^ /usr/include/glib-2.0/gobject/gtype.h:1405:33: note: expanded from macro 'G_DECLARE_FINAL_TYPE' static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \ ^ :72:1: note: expanded from here GES_Demux ^ ../subprojects/gst-editing-services/plugins/ges/gesdemux.c:50:1: warning: unused function 'GES_IS_Demux' [-Wunused-function] /usr/include/glib-2.0/gobject/gtype.h:1407:26: note: expanded from macro 'G_DECLARE_FINAL_TYPE' static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \ ^ :75:1: note: expanded from here GES_IS_Demux ^ --- plugins/ges/gesbasebin.h | 3 ++- plugins/ges/gesdemux.c | 5 ++++- plugins/ges/gessrc.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/ges/gesbasebin.h b/plugins/ges/gesbasebin.h index a48adb4bd1..e606d3ac40 100644 --- a/plugins/ges/gesbasebin.h +++ b/plugins/ges/gesbasebin.h @@ -30,8 +30,9 @@ G_BEGIN_DECLS -G_DECLARE_DERIVABLE_TYPE(GESBaseBin, ges_base_bin, GES, BASE_BIN, GstBin) +#define SUPRESS_UNUSED_WARNING(a) (void)a +G_DECLARE_DERIVABLE_TYPE(GESBaseBin, ges_base_bin, GES, BASE_BIN, GstBin) struct _GESBaseBinClass { GstBinClass parent_class; diff --git a/plugins/ges/gesdemux.c b/plugins/ges/gesdemux.c index 3d900f2918..6856ed2988 100644 --- a/plugins/ges/gesdemux.c +++ b/plugins/ges/gesdemux.c @@ -47,7 +47,7 @@ GST_DEBUG_CATEGORY_STATIC (gesdemux); #define GST_CAT_DEFAULT gesdemux -G_DECLARE_FINAL_TYPE (GESDemux, ges_demux, GES, Demux, GESBaseBin); +G_DECLARE_FINAL_TYPE (GESDemux, ges_demux, GES, DEMUX, GESBaseBin); struct _GESDemux { @@ -626,6 +626,9 @@ ges_demux_init (GESDemux * self) { ges_init (); + SUPRESS_UNUSED_WARNING (GES_DEMUX); + SUPRESS_UNUSED_WARNING (GES_IS_DEMUX); + self->sinkpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT (self), "sink"), "sink"); diff --git a/plugins/ges/gessrc.c b/plugins/ges/gessrc.c index e320b2c9c4..2a64a50576 100644 --- a/plugins/ges/gessrc.c +++ b/plugins/ges/gessrc.c @@ -122,4 +122,6 @@ ges_src_class_init (GESSrcClass * self_class) static void ges_src_init (GESSrc * self) { + SUPRESS_UNUSED_WARNING (GES_SRC); + SUPRESS_UNUSED_WARNING (GES_IS_SRC); }