build: Add all kinds of compiler warning flags and fix the resulting warnings

This commit is contained in:
Sebastian Dröge 2010-03-24 11:27:40 +01:00
parent c8e931574e
commit c88c88de0d
22 changed files with 39 additions and 47 deletions

View file

@ -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

View file

@ -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[] = {

View file

@ -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[] = {

View file

@ -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__ */

View file

@ -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;
}

View file

@ -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__ */

View file

@ -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__ */

View file

@ -24,8 +24,8 @@
#include <gst/gst.h>
#include <gst/gst-i18n-plugin.h>
gboolean gst_lamemp3enc_register (GstPlugin * plugin);
gboolean gst_lame_register (GstPlugin * plugin);
#include "gstlame.h"
#include "gstlamemp3enc.h"
static gboolean
plugin_init (GstPlugin * plugin)

View file

@ -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,

View file

@ -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)
{

View file

@ -107,6 +107,8 @@ struct _GstX264EncClass
GstElementClass parent_class;
};
GType gst_x264_enc_get_type (void);
G_END_DECLS
#endif /* __GST_X264_ENC_H__ */

View file

@ -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);

View file

@ -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);
}

View file

@ -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,

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -209,7 +209,7 @@ G_STMT_START { \
G_STMT_START { \
dest = (gchar *)func (src, name); \
if (!dest) { \
dest = ""; \
dest = (char *) ""; \
dest_len = 0; \
} \
else if (!strncmp (dest, "buffer;\"", 8)) { \
@ -247,7 +247,7 @@ G_STMT_START { \
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++) {