plugins: Fix various trivial clang compiler warnings
authorSebastian Dröge <sebastian@centricular.com>
Fri, 17 Mar 2023 14:32:45 +0000 (16:32 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 18 Mar 2023 19:52:40 +0000 (19:52 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4221>

subprojects/gst-plugins-bad/ext/bs2b/gstbs2b.c
subprojects/gst-plugins-bad/ext/bs2b/gstbs2b.h
subprojects/gst-plugins-bad/ext/openal/gstopenal.c
subprojects/gst-plugins-bad/gst/mxf/mxfmetadata.c
subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c
subprojects/gst-plugins-base/ext/gl/gstglfilterglass.c
subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c
subprojects/gst-plugins-good/sys/oss/gstossaudio.c
subprojects/gst-plugins-good/sys/oss/gstosshelper.c
subprojects/gst-plugins-ugly/tests/check/elements/x264enc.c

index 88c2ae0..9f87397 100644 (file)
@@ -259,58 +259,58 @@ gst_bs2b_setup (GstAudioFilter * filter, const GstAudioInfo * audio_info)
 
   switch (GST_AUDIO_INFO_FORMAT (audio_info)) {
     case GST_AUDIO_FORMAT_S8:
-      element->func = &bs2b_cross_feed_s8;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s8;
       break;
     case GST_AUDIO_FORMAT_U8:
-      element->func = &bs2b_cross_feed_u8;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u8;
       break;
     case GST_AUDIO_FORMAT_S16BE:
-      element->func = &bs2b_cross_feed_s16be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s16be;
       break;
     case GST_AUDIO_FORMAT_S16LE:
-      element->func = &bs2b_cross_feed_s16le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s16le;
       break;
     case GST_AUDIO_FORMAT_U16BE:
-      element->func = &bs2b_cross_feed_u16be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u16be;
       break;
     case GST_AUDIO_FORMAT_U16LE:
-      element->func = &bs2b_cross_feed_u16le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u16le;
       break;
     case GST_AUDIO_FORMAT_S24BE:
-      element->func = &bs2b_cross_feed_s24be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s24be;
       break;
     case GST_AUDIO_FORMAT_S24LE:
-      element->func = &bs2b_cross_feed_s24le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s24le;
       break;
     case GST_AUDIO_FORMAT_U24BE:
-      element->func = &bs2b_cross_feed_u24be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u24be;
       break;
     case GST_AUDIO_FORMAT_U24LE:
-      element->func = &bs2b_cross_feed_u24le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u24le;
       break;
     case GST_AUDIO_FORMAT_S32BE:
-      element->func = &bs2b_cross_feed_s32be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s32be;
       break;
     case GST_AUDIO_FORMAT_S32LE:
-      element->func = &bs2b_cross_feed_s32le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_s32le;
       break;
     case GST_AUDIO_FORMAT_U32BE:
-      element->func = &bs2b_cross_feed_u32be;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u32be;
       break;
     case GST_AUDIO_FORMAT_U32LE:
-      element->func = &bs2b_cross_feed_u32le;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_u32le;
       break;
     case GST_AUDIO_FORMAT_F32BE:
-      element->func = &bs2b_cross_feed_fbe;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_fbe;
       break;
     case GST_AUDIO_FORMAT_F32LE:
-      element->func = &bs2b_cross_feed_fle;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_fle;
       break;
     case GST_AUDIO_FORMAT_F64BE:
-      element->func = &bs2b_cross_feed_dbe;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_dbe;
       break;
     case GST_AUDIO_FORMAT_F64LE:
-      element->func = &bs2b_cross_feed_dle;
+      element->func = (GstBs2bProcessFunc) & bs2b_cross_feed_dle;
       break;
     default:
       return FALSE;
index c57fec8..6892d50 100644 (file)
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
 typedef struct _GstBs2b GstBs2b;
 typedef struct _GstBs2bClass GstBs2bClass;
 
+typedef void (*GstBs2bProcessFunc)(t_bs2bdp bs2bdp, void *sample, int n);
 
 struct _GstBs2b
 {
@@ -48,7 +49,7 @@ struct _GstBs2b
   /*< private > */
   GMutex bs2b_lock;
   t_bs2bdp bs2bdp;
-  void (*func) ();
+  GstBs2bProcessFunc func;
   guint bytes_per_sample;
 };
 
index 5ad55a7..fa7f0fb 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = FALSE;
-
-  ret |= GST_ELEMENT_REGISTER (openalsink, plugin);
-  ret |= GST_ELEMENT_REGISTER (openalsrc, plugin);
+  GST_ELEMENT_REGISTER (openalsink, plugin);
+  GST_ELEMENT_REGISTER (openalsrc, plugin);
 
   return TRUE;
 }
index a56d436..c96a093 100644 (file)
@@ -6155,7 +6155,7 @@ mxf_metadata_multiple_descriptor_resolve (MXFMetadataBase * m,
 {
   MXFMetadataMultipleDescriptor *self = MXF_METADATA_MULTIPLE_DESCRIPTOR (m);
   MXFMetadataBase *current = NULL;
-  guint i, have_subdescriptors = 0;
+  guint i;
 #ifndef GST_DISABLE_GST_DEBUG
   gchar str[48];
 #endif
@@ -6171,7 +6171,6 @@ mxf_metadata_multiple_descriptor_resolve (MXFMetadataBase * m,
     if (current && MXF_IS_METADATA_GENERIC_DESCRIPTOR (current)) {
       if (mxf_metadata_base_resolve (current, metadata)) {
         self->sub_descriptors[i] = MXF_METADATA_GENERIC_DESCRIPTOR (current);
-        have_subdescriptors++;
       } else {
         GST_ERROR ("Couldn't resolve descriptor %s",
             mxf_uuid_to_string (&self->sub_descriptors_uids[i], str));
index 4ae62e9..5cbac66 100644 (file)
@@ -735,16 +735,12 @@ gst_v4l2_codec_h264_dec_fill_slice_params (GstV4l2CodecH264Dec * self,
     GstH264Slice * slice)
 {
   gint n = self->num_slices++;
-  gsize slice_size = slice->nalu.size;
   struct v4l2_ctrl_h264_slice_params *params;
 
   /* Ensure array is large enough */
   if (self->slice_params->len < self->num_slices)
     g_array_set_size (self->slice_params, self->slice_params->len * 2);
 
-  if (needs_start_codes (self))
-    slice_size += 3;
-
   /* *INDENT-OFF* */
   params = &g_array_index (self->slice_params, struct v4l2_ctrl_h264_slice_params, n);
   *params = (struct v4l2_ctrl_h264_slice_params) {
index 7cb1b96..c0971e7 100644 (file)
@@ -75,7 +75,8 @@ static gboolean gst_gl_filter_glass_init_shader (GstGLFilter * filter);
 static gboolean gst_gl_filter_glass_filter_texture (GstGLFilter * filter,
     GstGLMemory * in_tex, GstGLMemory * out_tex);
 
-static void gst_gl_filter_glass_draw_background_gradient ();
+static void gst_gl_filter_glass_draw_background_gradient (GstGLFilterGlass *
+    glass);
 static void gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
     gint width, gint height, guint texture, gfloat center_x, gfloat center_y,
     gfloat start_alpha, gfloat stop_alpha, gboolean reversed, gfloat rotation);
index 2290b75..8981ac1 100644 (file)
@@ -2564,7 +2564,7 @@ gst_adaptive_demux2_stream_update_current_bitrate (GstAdaptiveDemux2Stream *
    * fraction of the measured download rate */
   target_download_rate =
       CLAMP (stream->current_download_rate, 0,
-      G_MAXUINT) * demux->bandwidth_target_ratio;
+      G_MAXUINT) * (gdouble) demux->bandwidth_target_ratio;
 
   GST_DEBUG_OBJECT (stream, "Bitrate after target ratio limit (%0.2f): %u",
       demux->bandwidth_target_ratio, target_download_rate);
index 2edf0c4..9a9383f 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = FALSE;
-
-  ret |= GST_ELEMENT_REGISTER (osssrc, plugin);
-  ret |= GST_ELEMENT_REGISTER (osssink, plugin);
+  GST_ELEMENT_REGISTER (osssrc, plugin);
+  GST_ELEMENT_REGISTER (osssink, plugin);
 
   return TRUE;
 }
index 8290441..ff2da75 100644 (file)
@@ -202,7 +202,6 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
   GQueue *ranges;
   int exact_rates = 0;
   gboolean checking_exact_rates = TRUE;
-  int n_checks = 0;
   gboolean result = TRUE;
 
   ranges = g_queue_new ();
@@ -210,7 +209,6 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
   probe->rates = g_array_new (FALSE, FALSE, sizeof (int));
 
   probe->min = gst_oss_helper_rate_check_rate (probe, 1000);
-  n_checks++;
   probe->max = gst_oss_helper_rate_check_rate (probe, 100000);
   /* a little bug workaround */
   {
@@ -223,7 +221,6 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
       probe->max = max;
     }
   }
-  n_checks++;
   if (probe->min == -1 || probe->max == -1) {
     /* This is a workaround for drivers that return -EINVAL (or another
      * error) for rates outside of [8000,48000].  If this fails, the
@@ -252,7 +249,6 @@ gst_oss_helper_rate_probe_check (GstOssProbe * probe)
       /* FIXME ioctl returned an error.  do something */
       GST_DEBUG ("unexpected check_rate error");
     }
-    n_checks++;
 
     if (mid == mid_ret && checking_exact_rates) {
       int max_exact_matches = 20;
index 27f8fdf..a26c1ff 100644 (file)
@@ -276,7 +276,7 @@ test_video_profile (const gchar * profile, gint profile_id,
     switch (i) {
       case 0:
       {
-        gint nsize, npos, j, type, next_type;
+        gint nsize, npos, type, next_type;
         GstMapInfo map;
         const guint8 *data;
         gsize size;
@@ -286,7 +286,6 @@ test_video_profile (const gchar * profile, gint profile_id,
         size = map.size;
 
         npos = 0;
-        j = 0;
         /* need SPS first */
         next_type = 7;
         /* loop through NALs */
@@ -311,7 +310,6 @@ test_video_profile (const gchar * profile, gint profile_id,
               default:
                 break;
             }
-            j++;
           }
           npos += nsize + 4;
         }