Commit 3f511ec3 authored by Benjamin Otte's avatar Benjamin Otte

Add -Wwrite-strings to the configure flags

... and fix all warnings
parent 0f7631f8
...@@ -272,10 +272,10 @@ dnl set location of plugin directory ...@@ -272,10 +272,10 @@ dnl set location of plugin directory
AG_GST_SET_PLUGINDIR AG_GST_SET_PLUGINDIR
dnl define an ERROR_CFLAGS Makefile variable dnl define an ERROR_CFLAGS Makefile variable
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef]) AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings])
dnl define an ERROR_CXXFLAGS Makefile variable dnl define an ERROR_CXXFLAGS Makefile variable
AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [-Wmissing-declarations -Wredundant-decls -Wundef]) AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [-Wmissing-declarations -Wredundant-decls -Wundef -Wwrite-strings])
dnl define correct level for debugging messages dnl define correct level for debugging messages
AG_GST_SET_LEVEL_DEFAULT($GST_GIT) AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
......
...@@ -55,7 +55,8 @@ static gchar * ...@@ -55,7 +55,8 @@ static gchar *
gst_hal_get_alsa_element (LibHalContext * ctx, const gchar * udi, gst_hal_get_alsa_element (LibHalContext * ctx, const gchar * udi,
GstHalDeviceType device_type) GstHalDeviceType device_type)
{ {
char *type, *element = NULL, *string = NULL; char *type, *string = NULL;
const char *element = NULL;
DBusError error; DBusError error;
dbus_error_init (&error); dbus_error_init (&error);
...@@ -145,7 +146,8 @@ static gchar * ...@@ -145,7 +146,8 @@ static gchar *
gst_hal_get_oss_element (LibHalContext * ctx, const gchar * udi, gst_hal_get_oss_element (LibHalContext * ctx, const gchar * udi,
GstHalDeviceType device_type) GstHalDeviceType device_type)
{ {
char *type, *element = NULL, *string = NULL; char *type, *string = NULL;
const char *element = NULL;
DBusError error; DBusError error;
dbus_error_init (&error); dbus_error_init (&error);
......
...@@ -1046,7 +1046,7 @@ gst_dv1394src_uri_get_type (void) ...@@ -1046,7 +1046,7 @@ gst_dv1394src_uri_get_type (void)
static gchar ** static gchar **
gst_dv1394src_uri_get_protocols (void) gst_dv1394src_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "dv", NULL }; static gchar *protocols[] = { (char *) "dv", NULL };
return protocols; return protocols;
} }
......
...@@ -793,7 +793,7 @@ gst_hdv1394src_uri_get_type (void) ...@@ -793,7 +793,7 @@ gst_hdv1394src_uri_get_type (void)
static gchar ** static gchar **
gst_hdv1394src_uri_get_protocols (void) gst_hdv1394src_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "hdv", NULL }; static gchar *protocols[] = { (char *) "hdv", NULL };
return protocols; return protocols;
} }
......
...@@ -1395,8 +1395,8 @@ gst_soup_http_src_uri_get_type (void) ...@@ -1395,8 +1395,8 @@ gst_soup_http_src_uri_get_type (void)
static gchar ** static gchar **
gst_soup_http_src_uri_get_protocols (void) gst_soup_http_src_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "http", "https", NULL }; static const gchar *protocols[] = { "http", "https", NULL };
return protocols; return (gchar **) protocols;
} }
static const gchar * static const gchar *
......
...@@ -40,7 +40,7 @@ gst_wavpack_read_header (WavpackHeader * header, guint8 * buf) ...@@ -40,7 +40,7 @@ gst_wavpack_read_header (WavpackHeader * header, guint8 * buf)
g_memmove (header, buf, sizeof (WavpackHeader)); g_memmove (header, buf, sizeof (WavpackHeader));
#ifndef WAVPACK_OLD_API #ifndef WAVPACK_OLD_API
WavpackLittleEndianToNative (header, WavpackHeaderFormat); WavpackLittleEndianToNative (header, (char *) WavpackHeaderFormat);
#else #else
little_endian_to_native (header, WavpackHeaderFormat); little_endian_to_native (header, WavpackHeaderFormat);
#endif #endif
......
...@@ -1093,7 +1093,7 @@ gst_avi_mux_write_tag (const GstTagList * list, const gchar * tag, ...@@ -1093,7 +1093,7 @@ gst_avi_mux_write_tag (const GstTagList * list, const gchar * tag,
const struct const struct
{ {
guint32 fcc; guint32 fcc;
gchar *tag; const gchar *tag;
} rifftags[] = { } rifftags[] = {
{ {
GST_RIFF_INFO_IARL, GST_TAG_LOCATION}, { GST_RIFF_INFO_IARL, GST_TAG_LOCATION}, {
......
...@@ -152,7 +152,7 @@ gst_push_file_src_uri_get_type (void) ...@@ -152,7 +152,7 @@ gst_push_file_src_uri_get_type (void)
static gchar ** static gchar **
gst_push_file_src_uri_get_protocols (void) gst_push_file_src_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "pushfile", NULL }; static gchar *protocols[] = { (char *) "pushfile", NULL };
return protocols; return protocols;
} }
......
...@@ -507,7 +507,7 @@ gst_flv_parse_audio_negotiate (GstFLVDemux * demux, guint32 codec_tag, ...@@ -507,7 +507,7 @@ gst_flv_parse_audio_negotiate (GstFLVDemux * demux, guint32 codec_tag,
guint32 rate, guint32 channels, guint32 width) guint32 rate, guint32 channels, guint32 width)
{ {
GstCaps *caps = NULL; GstCaps *caps = NULL;
gchar *codec_name = NULL; const gchar *codec_name = NULL;
gboolean ret = FALSE; gboolean ret = FALSE;
switch (codec_tag) { switch (codec_tag) {
...@@ -890,7 +890,7 @@ gst_flv_parse_video_negotiate (GstFLVDemux * demux, guint32 codec_tag) ...@@ -890,7 +890,7 @@ gst_flv_parse_video_negotiate (GstFLVDemux * demux, guint32 codec_tag)
{ {
gboolean ret = FALSE; gboolean ret = FALSE;
GstCaps *caps = NULL; GstCaps *caps = NULL;
gchar *codec_name = NULL; const gchar *codec_name = NULL;
/* Generate caps for that pad */ /* Generate caps for that pad */
switch (codec_tag) { switch (codec_tag) {
......
...@@ -28,7 +28,7 @@ empty_fct (PluginParam * dummy) ...@@ -28,7 +28,7 @@ empty_fct (PluginParam * dummy)
} }
PluginParam PluginParam
goom_secure_param () goom_secure_param (void)
{ {
PluginParam p; PluginParam p;
...@@ -41,7 +41,7 @@ goom_secure_param () ...@@ -41,7 +41,7 @@ goom_secure_param ()
} }
PluginParam PluginParam
goom_secure_f_param (char *name) goom_secure_f_param (const char *name)
{ {
PluginParam p = secure_param (); PluginParam p = secure_param ();
...@@ -55,7 +55,7 @@ goom_secure_f_param (char *name) ...@@ -55,7 +55,7 @@ goom_secure_f_param (char *name)
} }
PluginParam PluginParam
goom_secure_f_feedback (char *name) goom_secure_f_feedback (const char *name)
{ {
PluginParam p = secure_f_param (name); PluginParam p = secure_f_param (name);
...@@ -64,7 +64,7 @@ goom_secure_f_feedback (char *name) ...@@ -64,7 +64,7 @@ goom_secure_f_feedback (char *name)
} }
PluginParam PluginParam
goom_secure_s_param (char *name) goom_secure_s_param (const char *name)
{ {
PluginParam p = secure_param (); PluginParam p = secure_param ();
...@@ -75,7 +75,7 @@ goom_secure_s_param (char *name) ...@@ -75,7 +75,7 @@ goom_secure_s_param (char *name)
} }
PluginParam PluginParam
goom_secure_b_param (char *name, int value) goom_secure_b_param (const char *name, int value)
{ {
PluginParam p = secure_param (); PluginParam p = secure_param ();
...@@ -86,7 +86,7 @@ goom_secure_b_param (char *name, int value) ...@@ -86,7 +86,7 @@ goom_secure_b_param (char *name, int value)
} }
PluginParam PluginParam
goom_secure_i_param (char *name) goom_secure_i_param (const char *name)
{ {
PluginParam p = secure_param (); PluginParam p = secure_param ();
...@@ -100,7 +100,7 @@ goom_secure_i_param (char *name) ...@@ -100,7 +100,7 @@ goom_secure_i_param (char *name)
} }
PluginParam PluginParam
goom_secure_i_feedback (char *name) goom_secure_i_feedback (const char *name)
{ {
PluginParam p = secure_i_param (name); PluginParam p = secure_i_param (name);
......
...@@ -62,8 +62,8 @@ struct BoolVal { ...@@ -62,8 +62,8 @@ struct BoolVal {
typedef struct _PARAM { typedef struct _PARAM {
char *name; const char *name;
char *desc; const char *desc;
char rw; char rw;
ParamType type; ParamType type;
union { union {
...@@ -99,20 +99,20 @@ typedef struct _PARAM { ...@@ -99,20 +99,20 @@ typedef struct _PARAM {
PluginParam goom_secure_param(void); PluginParam goom_secure_param(void);
PluginParam goom_secure_f_param(char *name); PluginParam goom_secure_f_param(const char *name);
PluginParam goom_secure_i_param(char *name); PluginParam goom_secure_i_param(const char *name);
PluginParam goom_secure_b_param(char *name, int value); PluginParam goom_secure_b_param(const char *name, int value);
PluginParam goom_secure_s_param(char *name); PluginParam goom_secure_s_param(const char *name);
PluginParam goom_secure_f_feedback(char *name); PluginParam goom_secure_f_feedback(const char *name);
PluginParam goom_secure_i_feedback(char *name); PluginParam goom_secure_i_feedback(const char *name);
void goom_set_str_param_value(PluginParam *p, const char *str); void goom_set_str_param_value(PluginParam *p, const char *str);
void goom_set_list_param_value(PluginParam *p, const char *str); void goom_set_list_param_value(PluginParam *p, const char *str);
typedef struct _PARAMETERS { typedef struct _PARAMETERS {
char *name; const char *name;
char *desc; const char *desc;
int nbParams; int nbParams;
PluginParam **params; PluginParam **params;
} PluginParameters; } PluginParameters;
......
...@@ -239,8 +239,8 @@ static const gchar *obsolete_frame_ids[] = { ...@@ -239,8 +239,8 @@ static const gchar *obsolete_frame_ids[] = {
const struct ID3v2FrameIDConvert const struct ID3v2FrameIDConvert
{ {
gchar *orig; const gchar *orig;
gchar *new; const gchar *new;
} frame_id_conversions[] = { } frame_id_conversions[] = {
/* 2.3.x frames */ /* 2.3.x frames */
{ {
......
...@@ -152,7 +152,7 @@ gst_alaw_dec_getcaps (GstPad * pad) ...@@ -152,7 +152,7 @@ gst_alaw_dec_getcaps (GstPad * pad)
GstPad *otherpad; GstPad *otherpad;
GstCaps *othercaps, *result; GstCaps *othercaps, *result;
const GstCaps *templ; const GstCaps *templ;
gchar *name; const gchar *name;
gint i; gint i;
alawdec = GST_ALAW_DEC (GST_PAD_PARENT (pad)); alawdec = GST_ALAW_DEC (GST_PAD_PARENT (pad));
......
...@@ -303,7 +303,7 @@ gst_alaw_enc_getcaps (GstPad * pad) ...@@ -303,7 +303,7 @@ gst_alaw_enc_getcaps (GstPad * pad)
GstPad *otherpad; GstPad *otherpad;
GstCaps *othercaps, *result; GstCaps *othercaps, *result;
const GstCaps *templ; const GstCaps *templ;
gchar *name; const gchar *name;
gint i; gint i;
alawenc = GST_ALAW_ENC (GST_PAD_PARENT (pad)); alawenc = GST_ALAW_ENC (GST_PAD_PARENT (pad));
......
...@@ -95,7 +95,7 @@ mulawdec_getcaps (GstPad * pad) ...@@ -95,7 +95,7 @@ mulawdec_getcaps (GstPad * pad)
GstPad *otherpad; GstPad *otherpad;
GstCaps *othercaps, *result; GstCaps *othercaps, *result;
const GstCaps *templ; const GstCaps *templ;
gchar *name; const gchar *name;
gint i; gint i;
mulawdec = GST_MULAWDEC (GST_PAD_PARENT (pad)); mulawdec = GST_MULAWDEC (GST_PAD_PARENT (pad));
......
...@@ -61,7 +61,7 @@ mulawenc_getcaps (GstPad * pad) ...@@ -61,7 +61,7 @@ mulawenc_getcaps (GstPad * pad)
GstPad *otherpad; GstPad *otherpad;
GstCaps *othercaps, *result; GstCaps *othercaps, *result;
const GstCaps *templ; const GstCaps *templ;
gchar *name; const gchar *name;
gint i; gint i;
mulawenc = GST_MULAWENC (GST_PAD_PARENT (pad)); mulawenc = GST_MULAWENC (GST_PAD_PARENT (pad));
......
...@@ -749,7 +749,8 @@ gst_ebml_replace_uint (GstEbmlWrite * ebml, guint64 pos, guint64 num) ...@@ -749,7 +749,8 @@ gst_ebml_replace_uint (GstEbmlWrite * ebml, guint64 pos, guint64 num)
* Write EBML header. * Write EBML header.
*/ */
void void
gst_ebml_write_header (GstEbmlWrite * ebml, gchar * doctype, guint version) gst_ebml_write_header (GstEbmlWrite * ebml, const gchar * doctype,
guint version)
{ {
guint64 pos; guint64 pos;
......
...@@ -112,7 +112,7 @@ void gst_ebml_write_binary (GstEbmlWrite *ebml, ...@@ -112,7 +112,7 @@ void gst_ebml_write_binary (GstEbmlWrite *ebml,
guchar *binary, guchar *binary,
guint64 length); guint64 length);
void gst_ebml_write_header (GstEbmlWrite *ebml, void gst_ebml_write_header (GstEbmlWrite *ebml,
gchar *doctype, const gchar *doctype,
guint version); guint version);
/* /*
......
...@@ -2934,8 +2934,8 @@ gst_matroska_demux_parse_metadata_id_simple_tag (GstMatroskaDemux * demux, ...@@ -2934,8 +2934,8 @@ gst_matroska_demux_parse_metadata_id_simple_tag (GstMatroskaDemux * demux,
/* FIXME: check if there are more useful mappings */ /* FIXME: check if there are more useful mappings */
struct struct
{ {
gchar *matroska_tagname; const gchar *matroska_tagname;
gchar *gstreamer_tagname; const gchar *gstreamer_tagname;
} }
tag_conv[] = { tag_conv[] = {
{ {
...@@ -4025,7 +4025,7 @@ gst_matroska_demux_check_subtitle_buffer (GstElement * element, ...@@ -4025,7 +4025,7 @@ gst_matroska_demux_check_subtitle_buffer (GstElement * element,
} }
} }
utf8 = g_convert_with_fallback (data, size, "UTF-8", encoding, "*", utf8 = g_convert_with_fallback (data, size, "UTF-8", encoding, (char *) "*",
NULL, NULL, &err); NULL, NULL, &err);
if (err) { if (err) {
...@@ -4036,7 +4036,7 @@ gst_matroska_demux_check_subtitle_buffer (GstElement * element, ...@@ -4036,7 +4036,7 @@ gst_matroska_demux_check_subtitle_buffer (GstElement * element,
/* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */ /* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */
encoding = "ISO-8859-15"; encoding = "ISO-8859-15";
utf8 = g_convert_with_fallback (data, size, "UTF-8", encoding, "*", utf8 = g_convert_with_fallback (data, size, "UTF-8", encoding, (char *) "*",
NULL, NULL, NULL); NULL, NULL, NULL);
} }
...@@ -5387,7 +5387,7 @@ gst_matroska_demux_chain (GstPad * pad, GstBuffer * buffer) ...@@ -5387,7 +5387,7 @@ gst_matroska_demux_chain (GstPad * pad, GstBuffer * buffer)
guint needed = 0; guint needed = 0;
guint32 id; guint32 id;
guint64 length; guint64 length;
gchar *name; const gchar *name;
gst_adapter_push (demux->adapter, buffer); gst_adapter_push (demux->adapter, buffer);
buffer = NULL; buffer = NULL;
......
...@@ -1278,10 +1278,10 @@ speex_streamheader_to_codecdata (const GValue * streamheader, ...@@ -1278,10 +1278,10 @@ speex_streamheader_to_codecdata (const GValue * streamheader,
return TRUE; return TRUE;
} }
static gchar * static const gchar *
aac_codec_data_to_codec_id (const GstBuffer * buf) aac_codec_data_to_codec_id (const GstBuffer * buf)
{ {
gchar *result; const gchar *result;
gint profile; gint profile;
/* default to MAIN */ /* default to MAIN */
...@@ -2080,8 +2080,8 @@ gst_matroska_mux_write_simple_tag (const GstTagList * list, const gchar * tag, ...@@ -2080,8 +2080,8 @@ gst_matroska_mux_write_simple_tag (const GstTagList * list, const gchar * tag,
/* TODO: more sensible tag mappings */ /* TODO: more sensible tag mappings */
struct struct
{ {
gchar *matroska_tagname; const gchar *matroska_tagname;
gchar *gstreamer_tagname; const gchar *gstreamer_tagname;
} }
tag_conv[] = { tag_conv[] = {
{ {
......
...@@ -6582,7 +6582,8 @@ qtdemux_tag_add_blob (GNode * node, GstQTDemux * demux) ...@@ -6582,7 +6582,8 @@ qtdemux_tag_add_blob (GNode * node, GstQTDemux * demux)
gint len; gint len;
guint8 *data; guint8 *data;
GstBuffer *buf; GstBuffer *buf;
gchar *media_type, *style; gchar *media_type;
const gchar *style;
GstCaps *caps; GstCaps *caps;
guint i; guint i;
guint8 ndata[4]; guint8 ndata[4];
...@@ -6998,7 +6999,7 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream, ...@@ -6998,7 +6999,7 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream,
guint8 *data_ptr = NULL; guint8 *data_ptr = NULL;
int data_len = 0; int data_len = 0;
guint8 object_type_id = 0; guint8 object_type_id = 0;
char *codec_name = NULL; const char *codec_name = NULL;
GstCaps *caps = NULL; GstCaps *caps = NULL;
GST_MEMDUMP_OBJECT (qtdemux, "esds", ptr, len); GST_MEMDUMP_OBJECT (qtdemux, "esds", ptr, len);
......
...@@ -185,7 +185,7 @@ gst_rtp_dv_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps) ...@@ -185,7 +185,7 @@ gst_rtp_dv_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
static gboolean static gboolean
gst_dv_pay_negotiate (GstRTPDVPay * rtpdvpay, guint8 * data, guint size) gst_dv_pay_negotiate (GstRTPDVPay * rtpdvpay, guint8 * data, guint size)
{ {
gchar *encode, *media; const gchar *encode, *media;
gboolean audio_bundled, res; gboolean audio_bundled, res;
if ((data[3] & 0x80) == 0) { /* DSF flag */ if ((data[3] & 0x80) == 0) { /* DSF flag */
......
...@@ -331,7 +331,7 @@ gst_rtp_mp4g_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps) ...@@ -331,7 +331,7 @@ gst_rtp_mp4g_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
GstRtpMP4GPay *rtpmp4gpay; GstRtpMP4GPay *rtpmp4gpay;
GstStructure *structure; GstStructure *structure;
const GValue *codec_data; const GValue *codec_data;
gchar *media_type = NULL; const gchar *media_type = NULL;
gboolean res; gboolean res;
rtpmp4gpay = GST_RTP_MP4G_PAY (payload); rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
......
...@@ -1245,7 +1245,7 @@ gst_rtspsrc_media_to_caps (gint pt, const GstSDPMedia * media) ...@@ -1245,7 +1245,7 @@ gst_rtspsrc_media_to_caps (gint pt, const GstSDPMedia * media)
pairs = g_strsplit (p, ";", 0); pairs = g_strsplit (p, ";", 0);
for (i = 0; pairs[i]; i++) { for (i = 0; pairs[i]; i++) {
gchar *valpos; gchar *valpos;
gchar *val, *key; const gchar *val, *key;
/* the key may not have a '=', the value can have other '='s */ /* the key may not have a '=', the value can have other '='s */
valpos = strstr (pairs[i], "="); valpos = strstr (pairs[i], "=");
...@@ -5564,9 +5564,9 @@ gst_rtspsrc_uri_get_type (void) ...@@ -5564,9 +5564,9 @@ gst_rtspsrc_uri_get_type (void)
static gchar ** static gchar **
gst_rtspsrc_uri_get_protocols (void) gst_rtspsrc_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "rtsp", "rtspu", "rtspt", "rtsph", NULL }; static const gchar *protocols[] = { "rtsp", "rtspu", "rtspt", "rtsph", NULL };
return protocols; return (gchar **) protocols;
} }
static const gchar * static const gchar *
......
...@@ -258,7 +258,7 @@ gst_udpsink_uri_get_type (void) ...@@ -258,7 +258,7 @@ gst_udpsink_uri_get_type (void)
static gchar ** static gchar **
gst_udpsink_uri_get_protocols (void) gst_udpsink_uri_get_protocols (void)
{ {
static gchar *protocols[] = { "udp", NULL }; static gchar *protocols[] = { (char *) "udp", NULL };
return protocols;