Miscellaneous minor cleanups
authorSanjay NM <sanjay.nm@samsung.com>
Thu, 18 Sep 2014 10:34:03 +0000 (16:04 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 23 Sep 2014 23:45:31 +0000 (00:45 +0100)
Fix redundant variables and assignments,
and unreachable breaks.

https://bugzilla.gnome.org/show_bug.cgi?id=736875
https://bugzilla.gnome.org/show_bug.cgi?id=736876
https://bugzilla.gnome.org/show_bug.cgi?id=736879
https://bugzilla.gnome.org/show_bug.cgi?id=736880
https://bugzilla.gnome.org/show_bug.cgi?id=736881
https://bugzilla.gnome.org/show_bug.cgi?id=736888
https://bugzilla.gnome.org/show_bug.cgi?id=736890
https://bugzilla.gnome.org/show_bug.cgi?id=736892
https://bugzilla.gnome.org/show_bug.cgi?id=736893
https://bugzilla.gnome.org/show_bug.cgi?id=736894

13 files changed:
ext/libpng/gstpngdec.c
gst/alpha/gstalpha.c
gst/audiofx/audiodynamic.c
gst/audiofx/audiofxbasefirfilter.c
gst/audiofx/gstscaletempo.c
gst/avi/gstavidemux.c
gst/avi/gstavimux.c
gst/deinterlace/gstdeinterlace.c
gst/isomp4/qtdemux.c
gst/matroska/matroska-mux.c
gst/rtpmanager/gstrtpmux.c
gst/rtpmanager/gstrtprtxreceive.c
gst/rtpmanager/rtpsession.c

index 99e31ac..1135d65 100644 (file)
@@ -129,7 +129,7 @@ static void
 user_info_callback (png_structp png_ptr, png_infop info)
 {
   GstPngDec *pngdec = NULL;
-  GstFlowReturn ret = GST_FLOW_OK;
+  GstFlowReturn ret;
 
   GST_LOG ("info ready");
 
index 09ba0b0..a54965a 100644 (file)
@@ -2455,7 +2455,6 @@ gst_alpha_set_process_function_full (GstAlpha * alpha, GstVideoInfo * in_info,
               break;
           }
           break;
-          break;
         default:
           break;
       }
@@ -2537,7 +2536,6 @@ gst_alpha_set_process_function_full (GstAlpha * alpha, GstVideoInfo * in_info,
               break;
           }
           break;
-          break;
         default:
           break;
       }
index bbc9e93..62deed7 100644 (file)
@@ -333,11 +333,8 @@ static gboolean
 gst_audio_dynamic_setup (GstAudioFilter * base, const GstAudioInfo * info)
 {
   GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
-  gboolean ret = TRUE;
 
-  ret = gst_audio_dynamic_set_process_function (filter, info);
-
-  return ret;
+  return gst_audio_dynamic_set_process_function (filter, info);
 }
 
 static void
index dd3d3a0..6af55f7 100644 (file)
@@ -110,10 +110,9 @@ process_##channels##_##width (GstAudioFXBaseFIRFilter * self, const g##ctype * s
   gint off; \
   gdouble *buffer = self->buffer; \
   gdouble *kernel = self->kernel; \
-  guint buffer_length = self->buffer_length; \
   \
   if (!buffer) { \
-    self->buffer_length = buffer_length = kernel_length * channels; \
+    self->buffer_length = kernel_length * channels; \
     self->buffer = buffer = g_new0 (gdouble, self->buffer_length); \
   } \
   \
index 87118f0..0fd6575 100644 (file)
@@ -575,10 +575,9 @@ gst_scaletempo_query (GstBaseTransform * trans, GstPadDirection direction,
     switch (GST_QUERY_TYPE (query)) {
       case GST_QUERY_LATENCY:{
         GstPad *peer;
-        gboolean res;
 
         if ((peer = gst_pad_get_peer (GST_BASE_TRANSFORM_SINK_PAD (trans)))) {
-          if ((res = gst_pad_query (peer, query))) {
+          if ((gst_pad_query (peer, query))) {
             GstClockTime min, max;
             gboolean live;
 
@@ -604,12 +603,10 @@ gst_scaletempo_query (GstBaseTransform * trans, GstPadDirection direction,
         }
 
         return TRUE;
-        break;
       }
       default:{
         return GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans, direction,
             query);
-        break;
       }
     }
   } else {
index 4345127..b9ec765 100644 (file)
@@ -3016,7 +3016,7 @@ static GstFlowReturn
 gst_avi_demux_peek_tag (GstAviDemux * avi, guint64 offset, guint32 * tag,
     guint * size)
 {
-  GstFlowReturn res = GST_FLOW_OK;
+  GstFlowReturn res;
   GstBuffer *buf = NULL;
   GstMapInfo map;
 
index 0140b81..f071947 100644 (file)
@@ -1076,16 +1076,15 @@ static inline guint
 gst_avi_mux_start_chunk (GstByteWriter * bw, const gchar * tag, guint32 fourcc)
 {
   guint chunk_offset;
-  gboolean hdl = TRUE;
 
   if (tag)
-    hdl &= gst_byte_writer_put_data (bw, (const guint8 *) tag, 4);
+    gst_byte_writer_put_data (bw, (const guint8 *) tag, 4);
   else
-    hdl &= gst_byte_writer_put_uint32_le (bw, fourcc);
+    gst_byte_writer_put_uint32_le (bw, fourcc);
 
   chunk_offset = gst_byte_writer_get_pos (bw);
   /* real chunk size comes later */
-  hdl &= gst_byte_writer_put_uint32_le (bw, 0);
+  gst_byte_writer_put_uint32_le (bw, 0);
 
   return chunk_offset;
 }
@@ -1094,17 +1093,16 @@ static inline void
 gst_avi_mux_end_chunk (GstByteWriter * bw, guint chunk_offset)
 {
   guint size;
-  gboolean hdl = TRUE;
 
   size = gst_byte_writer_get_pos (bw);
 
   gst_byte_writer_set_pos (bw, chunk_offset);
-  hdl &= gst_byte_writer_put_uint32_le (bw, size - chunk_offset - 4);
+  gst_byte_writer_put_uint32_le (bw, size - chunk_offset - 4);
   gst_byte_writer_set_pos (bw, size);
 
   /* arrange for even padding */
   if (size & 1)
-    hdl &= gst_byte_writer_put_uint8 (bw, 0);
+    gst_byte_writer_put_uint8 (bw, 0);
 }
 
 /* maybe some of these functions should be moved to riff.h? */
index d81605c..943549d 100644 (file)
@@ -1998,11 +1998,10 @@ static gboolean
 gst_deinterlace_get_latency (GstDeinterlace * self)
 {
   if (self->locking == GST_DEINTERLACE_LOCKING_AUTO) {
-    gboolean res;
     GstQuery *query;
 
     query = gst_query_new_latency ();
-    if ((res = gst_pad_peer_query (self->sinkpad, query))) {
+    if ((gst_pad_peer_query (self->sinkpad, query))) {
       gboolean is_live;
       /* if upstream is live, we use low-latency passive locking mode
        * else high-latency active locking mode */
index 05f780d..9823997 100644 (file)
@@ -2009,7 +2009,6 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
       gst_event_unref (event);
       res = TRUE;
       goto drop;
-      break;
     }
     case GST_EVENT_FLUSH_STOP:
     {
@@ -2051,7 +2050,6 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
       res = TRUE;
       gst_event_unref (event);
       goto drop;
-      break;
     }
     default:
       break;
index 664cd62..fdb363f 100644 (file)
@@ -1436,7 +1436,6 @@ theora_streamheader_to_codecdata (const GValue * streamheader,
       videocontext->display_width = 0;
       videocontext->display_height = 0;
     }
-    hdr += 3 + 3;
 
     gst_buffer_unmap (buf0, &map);
   }
index 2df52b3..4f49c1d 100644 (file)
@@ -191,7 +191,7 @@ gst_rtp_mux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
 {
   GstRTPMux *rtp_mux = GST_RTP_MUX (parent);
   GstRTPMuxClass *klass;
-  gboolean ret = FALSE;
+  gboolean ret;
 
   klass = GST_RTP_MUX_GET_CLASS (rtp_mux);
 
index 52f6b01..4ae4e65 100644 (file)
@@ -489,7 +489,7 @@ gst_rtp_rtx_receive_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
   guint16 orign_seqnum = 0;
   guint8 payload_type = 0;
   guint8 origin_payload_type = 0;
-  gboolean is_rtx = FALSE;
+  gboolean is_rtx;
   gboolean drop = FALSE;
 
   /* map current rtp packet to parse its header */
index 7e2aa0a..4d40d90 100644 (file)
@@ -1409,8 +1409,8 @@ session_update_ptp (RTPSession * sess)
    * of each non-internal (=remotes) source have to be compared
    * to each other.
    */
-  gboolean is_doing_rtp_ptp = FALSE;
-  gboolean is_doing_rtcp_ptp = FALSE;
+  gboolean is_doing_rtp_ptp;
+  gboolean is_doing_rtcp_ptp;
   CompareAddrData data;
 
   /* compare the first remote source's ip addr that receive rtp packets
@@ -2852,7 +2852,7 @@ done:
 GstFlowReturn
 rtp_session_schedule_bye (RTPSession * sess, GstClockTime current_time)
 {
-  GstFlowReturn result = GST_FLOW_OK;
+  GstFlowReturn result;
 
   g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);