From: Sebastian Dröge Date: Wed, 24 Mar 2010 11:07:28 +0000 (+0100) Subject: build: Add all kinds of compiler warning flags and fix the resulting warnings X-Git-Tag: 1.19.3~499^2~1190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a450bd027fc51590026db10e1ead9cdf23f2f38f;p=platform%2Fupstream%2Fgstreamer.git build: Add all kinds of compiler warning flags and fix the resulting warnings --- diff --git a/configure.ac b/configure.ac index 8e43334..281efac 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/ext/ffmpeg/gstffmpegaudioresample.c b/ext/ffmpeg/gstffmpegaudioresample.c index a63df2c..098caa5 100644 --- a/ext/ffmpeg/gstffmpegaudioresample.c +++ b/ext/ffmpeg/gstffmpegaudioresample.c @@ -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, diff --git a/ext/ffmpeg/gstffmpegcfg.c b/ext/ffmpeg/gstffmpegcfg.c index c868385..570096f 100644 --- a/ext/ffmpeg/gstffmpegcfg.c +++ b/ext/ffmpeg/gstffmpegcfg.c @@ -27,6 +27,7 @@ #include "gstffmpeg.h" #include "gstffmpegenc.h" +#include "gstffmpegcfg.h" #include @@ -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; diff --git a/ext/ffmpeg/gstffmpegcfg.h b/ext/ffmpeg/gstffmpegcfg.h index 8452359..1dcaade 100644 --- a/ext/ffmpeg/gstffmpegcfg.h +++ b/ext/ffmpeg/gstffmpegcfg.h @@ -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); diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index dd406b5..f398e91 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -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: diff --git a/ext/ffmpeg/gstffmpegcodecmap.h b/ext/ffmpeg/gstffmpegcodecmap.h index f7cfa89..769466d 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.h +++ b/ext/ffmpeg/gstffmpegcodecmap.h @@ -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__ */ diff --git a/ext/ffmpeg/gstffmpegdeinterlace.c b/ext/ffmpeg/gstffmpegdeinterlace.c index 241fb12..caaf6ca 100644 --- a/ext/ffmpeg/gstffmpegdeinterlace.c +++ b/ext/ffmpeg/gstffmpegdeinterlace.c @@ -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, diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index 1955a0a..ef7b87d 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -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); diff --git a/ext/ffmpeg/gstffmpegutils.c b/ext/ffmpeg/gstffmpegutils.c index 0747d5a..cc65509 100644 --- a/ext/ffmpeg/gstffmpegutils.c +++ b/ext/ffmpeg/gstffmpegutils.c @@ -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"); diff --git a/ext/ffmpeg/gstffmpegutils.h b/ext/ffmpeg/gstffmpegutils.h index 184034b..a75ed01 100644 --- a/ext/ffmpeg/gstffmpegutils.h +++ b/ext/ffmpeg/gstffmpegutils.h @@ -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 *