build: Add all kinds of compiler warning flags and fix the resulting warnings
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Mar 2010 11:07:28 +0000 (12:07 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Mar 2010 11:07:28 +0000 (12:07 +0100)
configure.ac
ext/ffmpeg/gstffmpegaudioresample.c
ext/ffmpeg/gstffmpegcfg.c
ext/ffmpeg/gstffmpegcfg.h
ext/ffmpeg/gstffmpegcodecmap.c
ext/ffmpeg/gstffmpegcodecmap.h
ext/ffmpeg/gstffmpegdeinterlace.c
ext/ffmpeg/gstffmpegdemux.c
ext/ffmpeg/gstffmpegutils.c
ext/ffmpeg/gstffmpegutils.h

index 8e43334..281efac 100644 (file)
@@ -144,7 +144,11 @@ dnl set location of plugin directory
 AG_GST_SET_PLUGINDIR
 
 dnl define an ERROR_CFLAGS Makefile variable
-AG_GST_SET_ERROR_CFLAGS($GST_GIT)
+AG_GST_SET_ERROR_CFLAGS($GST_GIT, [
+    -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef
+    -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
+    -Wcast-align -Winit-self -Wmissing-include-dirs -Waddress
+    -Waggregate-return -Wno-multichar -Wnested-externs ])
 
 dnl define correct level for debugging messages
 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
index a63df2c..098caa5 100644 (file)
@@ -65,6 +65,8 @@ typedef struct _GstFFMpegAudioResampleClass
 #define GST_IS_FFMPEGAUDIORESAMPLE_CLASS(klass) \
        (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FFMPEGAUDIORESAMPLE))
 
+GType gst_ffmpegaudioresample_get_type (void);
+
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
index c868385..570096f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "gstffmpeg.h"
 #include "gstffmpegenc.h"
+#include "gstffmpegcfg.h"
 
 #include <string.h>
 
@@ -381,7 +382,7 @@ static gint huffyuv[] = {
  * or some may have slightly varying enum-types with more or less options.
  * The enum-types themselves should be declared above. */
 void
-gst_ffmpeg_cfg_init ()
+gst_ffmpeg_cfg_init (void)
 {
   GParamSpec *pspec;
 
index 8452359..1dcaade 100644 (file)
@@ -23,7 +23,7 @@
 
 G_BEGIN_DECLS
 
-void gst_ffmpeg_cfg_init ();
+void gst_ffmpeg_cfg_init (void);
 
 void gst_ffmpeg_cfg_install_property (GstFFMpegEncClass * klass, guint base);
 
index dd406b5..f398e91 100644 (file)
@@ -1268,7 +1268,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
     case CODEC_ID_ADPCM_EA_XAS:
     case CODEC_ID_ADPCM_THP:
     {
-      gchar *layout = NULL;
+      const gchar *layout = NULL;
 
       switch (codec_id) {
         case CODEC_ID_ADPCM_IMA_QT:
@@ -1417,7 +1417,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
     case CODEC_ID_XAN_DPCM:
     case CODEC_ID_SOL_DPCM:
     {
-      gchar *layout = NULL;
+      const gchar *layout = NULL;
 
       switch (codec_id) {
         case CODEC_ID_ROQ_DPCM:
index f7cfa89..769466d 100644 (file)
@@ -125,7 +125,4 @@ gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
 
 
 
-GstBuffer *
-new_aligned_buffer (gint size, GstCaps * caps);
-
 #endif /* __GST_FFMPEG_CODECMAP_H__ */
index 241fb12..caaf6ca 100644 (file)
@@ -66,6 +66,8 @@ typedef struct _GstFFMpegDeinterlaceClass
 #define GST_IS_FFMPEGDEINTERLACE_CLASS(klass) \
   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FFMPEGDEINTERLACE))
 
+GType gst_ffmpegdeinterlace_get_type (void);
+
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
index 1955a0a..ef7b87d 100644 (file)
@@ -934,6 +934,18 @@ gst_ffmpegdemux_aggregated_flow (GstFFMpegDemux * demux)
   return res;
 }
 
+static gchar *
+gst_ffmpegdemux_create_padname (const gchar * templ, gint n)
+{
+  GString *string;
+
+  string = g_string_new (templ);
+  g_string_truncate (string, string->len - 4);
+  g_string_append_printf (string, "%02d", n);
+
+  return g_string_free (string, FALSE);
+}
+
 static GstFFStream *
 gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
 {
@@ -988,7 +1000,9 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
   stream->unknown = FALSE;
 
   /* create new pad for this stream */
-  padname = g_strdup_printf (GST_PAD_TEMPLATE_NAME_TEMPLATE (templ), num);
+  padname =
+      gst_ffmpegdemux_create_padname (GST_PAD_TEMPLATE_NAME_TEMPLATE (templ),
+      num);
   pad = gst_pad_new_from_template (templ, padname);
   g_free (padname);
 
index 0747d5a..cc65509 100644 (file)
@@ -92,7 +92,7 @@ typedef struct PixFmtInfo
 /* this table gives more information about formats */
 static PixFmtInfo pix_fmt_info[PIX_FMT_NB];
 void
-gst_ffmpeg_init_pix_fmt_info ()
+gst_ffmpeg_init_pix_fmt_info (void)
 {
   /* YUV formats */
   pix_fmt_info[PIX_FMT_YUV420P].name = g_strdup ("yuv420p");
index 184034b..a75ed01 100644 (file)
@@ -78,7 +78,7 @@ gst_ffmpeg_time_gst_to_ff (guint64 time, AVRational base)
 }
 
 void 
-gst_ffmpeg_init_pix_fmt_info();
+gst_ffmpeg_init_pix_fmt_info(void);
 
 
 G_CONST_RETURN gchar *