From c88c88de0da76ed8e00b628b5946b0211e1672b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 24 Mar 2010 11:27:40 +0100 Subject: [PATCH] build: Add all kinds of compiler warning flags and fix the resulting warnings --- configure.ac | 16 ++++++++++++---- ext/amrnb/amrnbdec.c | 2 +- ext/amrnb/amrnbenc.c | 2 +- ext/cdio/gstcdiocddasrc.h | 2 +- ext/dvdread/dvdreadsrc.c | 2 +- ext/lame/gstlame.h | 2 +- ext/lame/gstlamemp3enc.h | 2 +- ext/lame/plugin.c | 4 ++-- ext/mad/gstmad.c | 3 --- ext/x264/gstx264enc.c | 2 +- ext/x264/gstx264enc.h | 2 ++ gst/mpegaudioparse/gstmpegaudioparse.c | 7 +------ gst/mpegaudioparse/gstxingmux.c | 2 +- gst/mpegstream/gstdvddemux.c | 5 ----- gst/mpegstream/gstmpegdemux.c | 2 -- gst/mpegstream/gstmpegparse.c | 1 - gst/realmedia/asmrules.c | 10 ++-------- gst/realmedia/pnmsrc.c | 2 +- gst/realmedia/pnmsrc.h | 1 + gst/realmedia/rdtdepay.h | 2 ++ gst/realmedia/rdtmanager.c | 4 ++-- gst/realmedia/rtspreal.c | 11 ++++++----- 22 files changed, 39 insertions(+), 47 deletions(-) diff --git a/configure.ac b/configure.ac index 325d9d9918..4fdef512ca 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ dnl define PACKAGE_VERSION_* variables AS_VERSION dnl check if this is a release version -AS_NANO(GST_CVS="no", GST_CVS="yes") +AS_NANO(GST_GIT="no", GST_GIT="yes") dnl can autoconf find the source ? AC_CONFIG_SRCDIR([ext/mad/gstmad.c]) @@ -186,13 +186,21 @@ dnl set location of plugin directory AG_GST_SET_PLUGINDIR dnl define an ERROR_CFLAGS Makefile variable -AG_GST_SET_ERROR_CFLAGS($GST_CVS) +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 an ERROR_CXXFLAGS Makefile variable -AG_GST_SET_ERROR_CXXFLAGS($GST_CVS) +AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [ + -Wmissing-declarations -Wredundant-decls -Wundef + -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wcast-align + -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return + -Wno-multichar]) dnl define correct level for debugging messages -AG_GST_SET_LEVEL_DEFAULT($GST_CVS) +AG_GST_SET_LEVEL_DEFAULT($GST_GIT) dnl used in examples AG_GST_DEFAULT_ELEMENTS diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c index 1da528d966..2be1cec07e 100644 --- a/ext/amrnb/amrnbdec.c +++ b/ext/amrnb/amrnbdec.c @@ -67,7 +67,7 @@ static const gint block_size_if2[16] = { 12, 13, 15, 17, 18, 20, 25, 30, 5, }; static GType -gst_amrnb_variant_get_type () +gst_amrnb_variant_get_type (void) { static GType gst_amrnb_variant_type = 0; static const GEnumValue gst_amrnb_variant[] = { diff --git a/ext/amrnb/amrnbenc.c b/ext/amrnb/amrnbenc.c index 05105a010c..7b683e80f0 100644 --- a/ext/amrnb/amrnbenc.c +++ b/ext/amrnb/amrnbenc.c @@ -41,7 +41,7 @@ #include "amrnbenc.h" static GType -gst_amrnbenc_bandmode_get_type () +gst_amrnbenc_bandmode_get_type (void) { static GType gst_amrnbenc_bandmode_type = 0; static const GEnumValue gst_amrnbenc_bandmode[] = { diff --git a/ext/cdio/gstcdiocddasrc.h b/ext/cdio/gstcdiocddasrc.h index 4aa9f97b74..29ec8d6f55 100644 --- a/ext/cdio/gstcdiocddasrc.h +++ b/ext/cdio/gstcdiocddasrc.h @@ -46,7 +46,7 @@ struct _GstCdioCddaSrcClass GstCddaBaseSrcClass cddabasesrc_class; }; -GType gst_cdio_cdda_src_get_type (); +GType gst_cdio_cdda_src_get_type (void); #endif /* __GST_CDIO_CDDA_SRC_H__ */ diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index 095dd15b52..bcb2606197 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -1580,7 +1580,7 @@ gst_dvd_read_src_uri_get_type (void) static gchar ** gst_dvd_read_src_uri_get_protocols (void) { - static gchar *protocols[] = { "dvd", NULL }; + static gchar *protocols[] = { (gchar *) "dvd", NULL }; return protocols; } diff --git a/ext/lame/gstlame.h b/ext/lame/gstlame.h index a64648177b..f9a1370c14 100644 --- a/ext/lame/gstlame.h +++ b/ext/lame/gstlame.h @@ -104,8 +104,8 @@ struct _GstLameClass { }; GType gst_lame_get_type(void); +gboolean gst_lame_register (GstPlugin * plugin); G_END_DECLS - #endif /* __GST_LAME_H__ */ diff --git a/ext/lame/gstlamemp3enc.h b/ext/lame/gstlamemp3enc.h index 6adfb37a30..2ee8348952 100644 --- a/ext/lame/gstlamemp3enc.h +++ b/ext/lame/gstlamemp3enc.h @@ -83,8 +83,8 @@ struct _GstLameMP3EncClass { }; GType gst_lamemp3enc_get_type(void); +gboolean gst_lamemp3enc_register (GstPlugin * plugin); G_END_DECLS - #endif /* __GST_LAMEMP3ENC_H__ */ diff --git a/ext/lame/plugin.c b/ext/lame/plugin.c index a9312285d1..a54aedce4c 100644 --- a/ext/lame/plugin.c +++ b/ext/lame/plugin.c @@ -24,8 +24,8 @@ #include #include -gboolean gst_lamemp3enc_register (GstPlugin * plugin); -gboolean gst_lame_register (GstPlugin * plugin); +#include "gstlame.h" +#include "gstlamemp3enc.h" static gboolean plugin_init (GstPlugin * plugin) diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 02b698569c..ec413699e5 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -75,9 +75,6 @@ GST_STATIC_PAD_TEMPLATE ("sink", "channels = (int) [ 1, 2 ]") ); -static void gst_mad_base_init (gpointer g_class); -static void gst_mad_class_init (GstMadClass * klass); -static void gst_mad_init (GstMad * mad, GstMadClass * klass); static void gst_mad_dispose (GObject * object); static void gst_mad_set_property (GObject * object, guint prop_id, diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 70b2dc8c90..d7fe4ecffc 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -407,7 +407,7 @@ gst_x264_enc_class_init (GstX264EncClass * klass) "Interlaced material", ARG_INTERLACED_DEFAULT, G_PARAM_READWRITE)); } -void +static void gst_x264_enc_log_callback (gpointer private, gint level, const char *format, va_list args) { diff --git a/ext/x264/gstx264enc.h b/ext/x264/gstx264enc.h index 52f5e6cb40..ad04287673 100644 --- a/ext/x264/gstx264enc.h +++ b/ext/x264/gstx264enc.h @@ -107,6 +107,8 @@ struct _GstX264EncClass GstElementClass parent_class; }; +GType gst_x264_enc_get_type (void); + G_END_DECLS #endif /* __GST_X264_ENC_H__ */ diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index d159f0e509..42e7ac5527 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -53,7 +53,7 @@ GST_DEBUG_CATEGORY_STATIC (mp3parse_debug); #define MIN_RESYNC_FRAMES 3 static inline MPEGAudioSeekEntry * -mpeg_audio_seek_entry_new () +mpeg_audio_seek_entry_new (void) { return g_slice_new (MPEGAudioSeekEntry); } @@ -96,11 +96,6 @@ enum }; -static void gst_mp3parse_class_init (GstMPEGAudioParseClass * klass); -static void gst_mp3parse_base_init (gpointer klass); -static void gst_mp3parse_init (GstMPEGAudioParse * mp3parse, - GstMPEGAudioParseClass * klass); - static gboolean gst_mp3parse_sink_event (GstPad * pad, GstEvent * event); static GstFlowReturn gst_mp3parse_chain (GstPad * pad, GstBuffer * buffer); static gboolean mp3parse_src_query (GstPad * pad, GstQuery * query); diff --git a/gst/mpegaudioparse/gstxingmux.c b/gst/mpegaudioparse/gstxingmux.c index d68d42c4b2..f4a6664b54 100644 --- a/gst/mpegaudioparse/gstxingmux.c +++ b/gst/mpegaudioparse/gstxingmux.c @@ -65,7 +65,7 @@ typedef struct _GstXingSeekEntry } GstXingSeekEntry; static inline GstXingSeekEntry * -gst_xing_seek_entry_new () +gst_xing_seek_entry_new (void) { return g_slice_new (GstXingSeekEntry); } diff --git a/gst/mpegstream/gstdvddemux.c b/gst/mpegstream/gstdvddemux.c index 24123d656a..c6e915d95a 100644 --- a/gst/mpegstream/gstdvddemux.c +++ b/gst/mpegstream/gstdvddemux.c @@ -125,11 +125,6 @@ GST_STATIC_PAD_TEMPLATE ("current_subpicture", GST_BOILERPLATE_FULL (GstDVDDemux, gst_dvd_demux, GstMPEGDemux, GST_TYPE_MPEG_DEMUX, _do_init); -static void gst_dvd_demux_class_init (GstDVDDemuxClass * klass); -static void gst_dvd_demux_base_init (gpointer klass); -static void gst_dvd_demux_init (GstDVDDemux * dvd_demux, - GstDVDDemuxClass * klass); - static gboolean gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event); static gboolean gst_dvd_demux_parse_packhead (GstMPEGParse * mpeg_parse, diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index a19497cd2d..ae05efc031 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -82,8 +82,6 @@ GST_STATIC_PAD_TEMPLATE ("private_%d", GST_BOILERPLATE_FULL (GstMPEGDemux, gst_mpeg_demux, GstMPEGParse, GST_TYPE_MPEG_PARSE, _do_init); -static void gst_mpeg_demux_class_init (GstMPEGDemuxClass * klass); - static gboolean gst_mpeg_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event); diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index 37696fa1c0..2a9d13ccbf 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -82,7 +82,6 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_BOILERPLATE_FULL (GstMPEGParse, gst_mpeg_parse, GstElement, GST_TYPE_ELEMENT, _do_init); -static void gst_mpeg_parse_class_init (GstMPEGParseClass * klass); static GstStateChangeReturn gst_mpeg_parse_change_state (GstElement * element, GstStateChange transition); diff --git a/gst/realmedia/asmrules.c b/gst/realmedia/asmrules.c index 1edcc4becc..e0ca5b6f33 100644 --- a/gst/realmedia/asmrules.c +++ b/gst/realmedia/asmrules.c @@ -577,7 +577,7 @@ gst_asm_scan_parse_rule (GstASMScan * scan) return rule; } -gboolean +static gboolean gst_asm_rule_evaluate (GstASMRule * rule, GHashTable * vars) { gboolean res; @@ -618,12 +618,6 @@ gst_asm_rule_book_new (const gchar * rulebook) return book; } -gint -gst_asm_rule_book_n_rules (GstASMRuleBook * book) -{ - return book->n_rules; -} - void gst_asm_rule_book_free (GstASMRuleBook * book) { @@ -680,7 +674,7 @@ main (gint argc, gchar * argv[]) "#(($Bandwidth >= 27500) && ($OldPNMPlayer)),AverageBandwidth=27500,priority=9,PNMKeyframeRule=T;#(($Bandwidth >= 27500) && ($OldPNMPlayer)),AverageBandwidth=0,priority=5,PNMNonKeyframeRule=T;#(($Bandwidth < 27500) && ($OldPNMPlayer)),TimestampDelivery=T,DropByN=T,priority=9,PNMThinningRule=T;#($Bandwidth < 13899),TimestampDelivery=T,DropByN=T,priority=9;#($Bandwidth >= 13899) && ($Bandwidth < 19000),AverageBandwidth=13899,Priority=9;#($Bandwidth >= 13899) && ($Bandwidth < 19000),AverageBandwidth=0,Priority=5,OnDepend=\\\"4\\\";#($Bandwidth >= 19000) && ($Bandwidth < 27500),AverageBandwidth=19000,Priority=9;#($Bandwidth >= 19000) && ($Bandwidth < 27500),AverageBandwidth=0,Priority=5,OnDepend=\\\"6\\\";#($Bandwidth >= 27500) && ($Bandwidth < 132958),AverageBandwidth=27500,Priority=9;#($Bandwidth >= 27500) && ($Bandwidth < 132958),AverageBandwidth=0,Priority=5,OnDepend=\\\"8\\\";#($Bandwidth >= 132958) && ($Bandwidth < 187958),AverageBandwidth=132958,Priority=9;#($Bandwidth >= 132958) && ($Bandwidth < 187958),AverageBandwidth=0,Priority=5,OnDepend=\\\"10\\\";#($Bandwidth >= 187958),AverageBandwidth=187958,Priority=9;#($Bandwidth >= 187958),AverageBandwidth=0,Priority=5,OnDepend=\\\"12\\\";"; vars = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (vars, "Bandwidth", "300000"); + g_hash_table_insert (vars, (gchar *) "Bandwidth", (gchar *) "300000"); book = gst_asm_rule_book_new (rules1); n = gst_asm_rule_book_match (book, vars, rulematch); diff --git a/gst/realmedia/pnmsrc.c b/gst/realmedia/pnmsrc.c index d61781b19e..128cf74e20 100644 --- a/gst/realmedia/pnmsrc.c +++ b/gst/realmedia/pnmsrc.c @@ -218,7 +218,7 @@ gst_pnm_src_uri_get_type (void) static gchar ** gst_pnm_src_uri_get_protocols (void) { - static gchar *protocols[] = { "pnm", NULL }; + static gchar *protocols[] = { (gchar *) "pnm", NULL }; return protocols; } diff --git a/gst/realmedia/pnmsrc.h b/gst/realmedia/pnmsrc.h index 6d6277062e..4ebd9d7dd0 100644 --- a/gst/realmedia/pnmsrc.h +++ b/gst/realmedia/pnmsrc.h @@ -51,6 +51,7 @@ struct _GstPNMSrcClass GstPushSrcClass parent_class; }; +GType gst_pnm_src_get_type (void); gboolean gst_pnm_src_plugin_init (GstPlugin * plugin); G_END_DECLS diff --git a/gst/realmedia/rdtdepay.h b/gst/realmedia/rdtdepay.h index 7bacae6018..f75b02779e 100644 --- a/gst/realmedia/rdtdepay.h +++ b/gst/realmedia/rdtdepay.h @@ -65,6 +65,8 @@ struct _GstRDTDepayClass GstElementClass parent_class; }; +GType gst_rdt_depay_get_type (void); + gboolean gst_rdt_depay_plugin_init (GstPlugin * plugin); G_END_DECLS diff --git a/gst/realmedia/rdtmanager.c b/gst/realmedia/rdtmanager.c index 88109157cb..c5b64de5ce 100644 --- a/gst/realmedia/rdtmanager.c +++ b/gst/realmedia/rdtmanager.c @@ -344,7 +344,7 @@ gst_rdt_manager_base_init (gpointer klass) /* BOXED:UINT,UINT */ #define g_marshal_value_peek_uint(v) g_value_get_uint (v) -void +static void gst_rdt_manager_marshal_BOXED__UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, @@ -379,7 +379,7 @@ gst_rdt_manager_marshal_BOXED__UINT_UINT (GClosure * closure, g_value_take_boxed (return_value, v_return); } -void +static void gst_rdt_manager_marshal_VOID__UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, diff --git a/gst/realmedia/rtspreal.c b/gst/realmedia/rtspreal.c index fb88c00990..4dfcc388ec 100644 --- a/gst/realmedia/rtspreal.c +++ b/gst/realmedia/rtspreal.c @@ -207,9 +207,9 @@ G_STMT_START { \ #define READ_BUFFER_GEN(src, func, name, dest, dest_len) \ G_STMT_START { \ - dest = (gchar *)func (src, name); \ + dest = (gchar *)func (src, name); \ if (!dest) { \ - dest = ""; \ + dest = (char *) ""; \ dest_len = 0; \ } \ else if (!strncmp (dest, "buffer;\"", 8)) { \ @@ -243,11 +243,11 @@ G_STMT_START { \ G_STMT_START { \ const gchar *val = gst_sdp_media_get_attribute_val (media, name); \ if (val && !strncmp (val, "string;\"", 8)) { \ - dest = (gchar *) val + 8; \ + dest = (gchar *) val + 8; \ dest_len = strlen (dest) - 1; \ dest[dest_len] = '\0'; \ } else { \ - dest = ""; \ + dest = (char *) ""; \ dest_len = 0; \ } \ } G_STMT_END @@ -363,7 +363,8 @@ rtsp_ext_real_parse_sdp (GstRTSPExtension * ext, GstSDPMessage * sdp, /* fix the hashtale for the rule parser */ rules = g_string_new (""); vars = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (vars, "Bandwidth", DEFAULT_BANDWIDTH); + g_hash_table_insert (vars, (gchar *) "Bandwidth", + (gchar *) DEFAULT_BANDWIDTH); /* MDPR */ for (i = 0; i < ctx->n_streams; i++) {