Silence some 'variable may be used uninitialized' compiler warnings
authorTim-Philipp Müller <tim@centricular.net>
Wed, 8 Aug 2012 10:31:59 +0000 (11:31 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 8 Aug 2012 10:31:59 +0000 (11:31 +0100)
When compiling with -DG_DISABLE_ASSERT

ext/wavpack/gstwavpackdec.c
gst/rtpmanager/gstrtpssrcdemux.c
sys/oss4/oss4-audio.c
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2object.c

index 99b6263..1c34fe0 100644 (file)
@@ -209,6 +209,7 @@ gst_wavpack_dec_negotiate (GstWavpackDec * dec)
       dec->width = 32;
       break;
     default:
+      fmt = GST_AUDIO_FORMAT_UNKNOWN;
       g_assert_not_reached ();
       break;
   }
index 3928e01..f933e81 100644 (file)
@@ -241,6 +241,7 @@ find_or_create_demux_pad_for_ssrc (GstRtpSsrcDemux * demux, guint32 ssrc,
         retpad = gst_object_ref (demuxpad->rtcp_pad);
         break;
       default:
+        retpad = NULL;
         g_assert_not_reached ();
     }
     GST_PAD_UNLOCK (demux);
@@ -310,6 +311,7 @@ find_or_create_demux_pad_for_ssrc (GstRtpSsrcDemux * demux, guint32 ssrc,
       retpad = gst_object_ref (demuxpad->rtcp_pad);
       break;
     default:
+      retpad = NULL;
       g_assert_not_reached ();
   }
 
index 89ab3d4..21a963f 100644 (file)
@@ -282,7 +282,7 @@ gst_oss4_audio_set_ringbuffer_channel_layout (GstObject * obj, gint fd,
   } else if (GST_IS_OSS4_SOURCE (obj)) {
     rb = GST_AUDIO_BASE_SRC (obj)->ringbuffer;
   } else
-    g_assert_not_reached ();
+    g_return_if_reached ();
 
   /* -1 = get info for currently open device (fd). This will fail with
    * OSS build <= 1013 because of a bug in OSS */
index 235c861..d040d9d 100644 (file)
@@ -218,8 +218,8 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
     }
     case GST_V4L2_IO_USERPTR:
     default:
+      newbuf = NULL;
       g_assert_not_reached ();
-      break;
   }
 
   pool->num_allocated++;
@@ -766,6 +766,7 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
 
         case GST_V4L2_IO_USERPTR:
         default:
+          ret = GST_FLOW_ERROR;
           g_assert_not_reached ();
           break;
       }
@@ -788,12 +789,14 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
 
         case GST_V4L2_IO_USERPTR:
         default:
+          ret = GST_FLOW_ERROR;
           g_assert_not_reached ();
           break;
       }
       break;
 
     default:
+      ret = GST_FLOW_ERROR;
       g_assert_not_reached ();
       break;
   }
index 2704f53..0ff2182 100644 (file)
@@ -1301,6 +1301,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
           break;
 #endif
         default:
+          format = GST_VIDEO_FORMAT_UNKNOWN;
           g_assert_not_reached ();
           break;
       }
@@ -1589,12 +1590,12 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object,
   gint int_width = width;
   gint int_height = height;
 
-  if (!strcmp((char *)v4l2object->vcap.driver, "uvcvideo")) {
+  if (!strcmp ((char *) v4l2object->vcap.driver, "uvcvideo")) {
     /*
      * UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
      * causes expensive and slow USB IO, so don't probe them for interlaced
      */
-     interlaced = FALSE;
+    interlaced = FALSE;
   } else {
     /* Interlaced detection using VIDIOC_TRY/S_FMT */
     if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat,