diff options
41 files changed, 112 insertions, 110 deletions
diff --git a/configure.ac b/configure.ac index a79c17874..6a9fb04ca 100644 --- a/configure.ac +++ b/configure.ac @@ -240,11 +240,13 @@ AG_GST_SET_PLUGINDIR dnl define an ERROR_CFLAGS Makefile variable AG_GST_SET_ERROR_CFLAGS($GST_GIT, [ - -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef ]) + -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef + -Wwrite-strings ]) dnl define an ERROR_CXXFLAGS Makefile variable AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [ - -Wmissing-declarations -Wredundant-decls -Wundef ]) + -Wmissing-declarations -Wredundant-decls -Wundef + -Wwrite-strings ]) dnl define correct level for debugging messages AG_GST_SET_LEVEL_DEFAULT($GST_GIT) diff --git a/ext/cdaudio/gstcdaudio.c b/ext/cdaudio/gstcdaudio.c index 4eb113f02..6e1dc4e06 100644 --- a/ext/cdaudio/gstcdaudio.c +++ b/ext/cdaudio/gstcdaudio.c @@ -589,7 +589,7 @@ cdaudio_uri_get_type (void) static gchar ** cdaudio_uri_get_protocols (void) { - static gchar *protocols[] = { "cd", NULL }; + static gchar *protocols[] = { (char *) "cd", NULL }; return protocols; } diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index f6d2617d0..39862f414 100644 --- a/ext/directfb/dfbvideosink.c +++ b/ext/directfb/dfbvideosink.c @@ -574,7 +574,7 @@ gst_dfbvideosink_setup (GstDfbVideoSink * dfbvideosink) "DirectFB fullscreen"); if (!dfbvideosink->dfb) { DFBGraphicsDeviceDescription hw_caps; - char *argv[] = { "-", "--dfb:quiet", NULL }; + char *argv[] = { (char *) "-", (char *) "--dfb:quiet", NULL }; int argc = 2; char **args; @@ -667,16 +667,16 @@ gst_dfbvideosink_setup (GstDfbVideoSink * dfbvideosink) /* Check that this layer is able to do colorbalance settings */ if (dl_desc.caps & DLCAPS_BRIGHTNESS) { - channels_list = g_list_append (channels_list, "BRIGHTNESS"); + channels_list = g_list_append (channels_list, (char *) "BRIGHTNESS"); } if (dl_desc.caps & DLCAPS_CONTRAST) { - channels_list = g_list_append (channels_list, "CONTRAST"); + channels_list = g_list_append (channels_list, (char *) "CONTRAST"); } if (dl_desc.caps & DLCAPS_HUE) { - channels_list = g_list_append (channels_list, "HUE"); + channels_list = g_list_append (channels_list, (char *) "HUE"); } if (dl_desc.caps & DLCAPS_SATURATION) { - channels_list = g_list_append (channels_list, "SATURATION"); + channels_list = g_list_append (channels_list, (char *) "SATURATION"); } if (channels_list) { diff --git a/ext/jp2k/gstjasperdec.c b/ext/jp2k/gstjasperdec.c index 61ba18d2c..05c1963ac 100644 --- a/ext/jp2k/gstjasperdec.c +++ b/ext/jp2k/gstjasperdec.c @@ -218,7 +218,7 @@ gst_jasper_dec_sink_setcaps (GstPad * pad, GstCaps * caps) break; } - dec->fmt = jas_image_strtofmt ("jpc"); + dec->fmt = jas_image_strtofmt ((char *) "jpc"); /* strip the j2c box stuff it is embedded in */ if (!strcmp (mimetype, "image/x-jpc")) dec->strip = 0; @@ -231,7 +231,7 @@ gst_jasper_dec_sink_setcaps (GstPad * pad, GstCaps * caps) gst_buffer_ref (dec->codec_data); } } else if (!strcmp (mimetype, "image/jp2")) - dec->fmt = jas_image_strtofmt ("jp2"); + dec->fmt = jas_image_strtofmt ((char *) "jp2"); if (dec->fmt < 0) goto refuse_caps; @@ -457,7 +457,7 @@ gst_jasper_dec_get_picture (GstJasperDec * dec, guint8 * data, if (!(stream = jas_stream_memopen ((gpointer) data, size))) goto fail_stream; - if (!(image = jas_image_decode (stream, dec->fmt, ""))) + if (!(image = jas_image_decode (stream, dec->fmt, (char *) ""))) goto fail_decode; if (!gst_jasper_dec_negotiate (dec, image)) diff --git a/ext/jp2k/gstjasperenc.c b/ext/jp2k/gstjasperenc.c index 7c923a413..92038f50e 100644 --- a/ext/jp2k/gstjasperenc.c +++ b/ext/jp2k/gstjasperenc.c @@ -255,10 +255,10 @@ gst_jasper_enc_init_encoder (GstJasperEnc * enc) switch (enc->mode) { case GST_JP2ENC_MODE_J2C: case GST_JP2ENC_MODE_JPC: - enc->fmt = jas_image_strtofmt ("jpc"); + enc->fmt = jas_image_strtofmt ((char *) "jpc"); break; case GST_JP2ENC_MODE_JP2: - enc->fmt = jas_image_strtofmt ("jp2"); + enc->fmt = jas_image_strtofmt ((char *) "jp2"); break; } @@ -422,7 +422,7 @@ gst_jasper_enc_get_data (GstJasperEnc * enc, guint8 * data, GstBuffer ** outbuf) GST_LOG_OBJECT (enc, "all components written"); - if (jas_image_encode (enc->image, stream, enc->fmt, "")) + if (jas_image_encode (enc->image, stream, enc->fmt, (char *) "")) goto fail_encode; GST_LOG_OBJECT (enc, "image encoded"); diff --git a/ext/libmms/gstmms.c b/ext/libmms/gstmms.c index cbaa8e799..86df5ee94 100644 --- a/ext/libmms/gstmms.c +++ b/ext/libmms/gstmms.c @@ -561,9 +561,9 @@ gst_mms_uri_get_type (void) static gchar ** gst_mms_uri_get_protocols (void) { - static gchar *protocols[] = { "mms", "mmsh", "mmst", "mmsu", NULL }; + static const gchar *protocols[] = { "mms", "mmsh", "mmst", "mmsu", NULL }; - return protocols; + return (gchar **) protocols; } static const gchar * diff --git a/ext/metadata/gstbasemetadata.c b/ext/metadata/gstbasemetadata.c index 6f13851ae..28579313f 100644 --- a/ext/metadata/gstbasemetadata.c +++ b/ext/metadata/gstbasemetadata.c @@ -322,7 +322,7 @@ gst_base_metadata_dispose_members (GstBaseMetadata * filter) const gchar * gst_base_metadata_get_type_name (int img_type) { - gchar *type_name = NULL; + const gchar *type_name = NULL; switch (img_type) { case IMG_JPEG: @@ -412,7 +412,7 @@ gst_base_metadata_configure_caps (GstBaseMetadata * filter) { GstCaps *caps = NULL; gboolean ret = FALSE; - gchar *mime = NULL; + const gchar *mime = NULL; GstPad *peer = NULL; peer = gst_pad_get_peer (filter->sinkpad); diff --git a/ext/metadata/gstmetadatademux.c b/ext/metadata/gstmetadatademux.c index a4d485e9c..bb1080f0d 100644 --- a/ext/metadata/gstmetadatademux.c +++ b/ext/metadata/gstmetadatademux.c @@ -201,7 +201,7 @@ gst_metadata_demux_configure_srccaps (GstMetadataDemux * filter) { GstCaps *caps = NULL; gboolean ret = FALSE; - gchar *mime = NULL; + const gchar *mime = NULL; switch (GST_BASE_METADATA_IMG_TYPE (filter)) { case IMG_JPEG: diff --git a/ext/metadata/gstmetadatamux.c b/ext/metadata/gstmetadatamux.c index 61d2b4f9d..df8ff1cc4 100644 --- a/ext/metadata/gstmetadatamux.c +++ b/ext/metadata/gstmetadatamux.c @@ -195,7 +195,7 @@ gst_metadata_mux_configure_srccaps (GstMetadataMux * filter) { GstCaps *caps = NULL; gboolean ret = FALSE; - gchar *mime = NULL; + const gchar *mime = NULL; switch (GST_BASE_METADATA_IMG_TYPE (filter)) { case IMG_JPEG: diff --git a/ext/mythtv/gstmythtvsrc.c b/ext/mythtv/gstmythtvsrc.c index c80bae86d..1afc01ea5 100644 --- a/ext/mythtv/gstmythtvsrc.c +++ b/ext/mythtv/gstmythtvsrc.c @@ -969,9 +969,9 @@ gst_mythtv_src_uri_get_type (void) static gchar ** gst_mythtv_src_uri_get_protocols (void) { - static gchar *protocols[] = { "myth", "myths", NULL }; + static const gchar *protocols[] = { "myth", "myths", NULL }; - return protocols; + return (gchar **) protocols; } static const gchar * diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c index fd704f85b..653e21e4e 100644 --- a/ext/neon/gstneonhttpsrc.c +++ b/ext/neon/gstneonhttpsrc.c @@ -1026,8 +1026,8 @@ gst_neonhttp_src_uri_get_type (void) static gchar ** gst_neonhttp_src_uri_get_protocols (void) { - static gchar *protocols[] = { "http", "https", NULL }; - return protocols; + static const gchar *protocols[] = { "http", "https", NULL }; + return (gchar **) protocols; } static const gchar * diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c index df0df2d0b..e1d6c16a8 100644 --- a/ext/resindvd/resindvdbin.c +++ b/ext/resindvd/resindvdbin.c @@ -175,7 +175,7 @@ rsn_dvdbin_uri_get_type (void) static gchar ** rsn_dvdbin_uri_get_protocols (void) { - static gchar *protocols[] = { "dvd", NULL }; + static gchar *protocols[] = { (char *) "dvd", NULL }; return protocols; } diff --git a/ext/timidity/gsttimidity.c b/ext/timidity/gsttimidity.c index d6a0ccc4a..5b083892a 100644 --- a/ext/timidity/gsttimidity.c +++ b/ext/timidity/gsttimidity.c @@ -128,7 +128,7 @@ gst_timidity_init (GstTimidity * filter, GstTimidityClass * g_class) GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter); /* initialise timidity library */ - if (mid_init (TIMIDITY_CFG) == 0) { + if (mid_init ((char *) TIMIDITY_CFG) == 0) { filter->initialized = TRUE; } else { GST_WARNING ("can't initialize timidity with config: " TIMIDITY_CFG); diff --git a/ext/xvid/gstxvid.c b/ext/xvid/gstxvid.c index fa5ebdc84..320516923 100644 --- a/ext/xvid/gstxvid.c +++ b/ext/xvid/gstxvid.c @@ -58,10 +58,10 @@ gst_xvid_init (void) return TRUE; } -gchar * +const gchar * gst_xvid_error (int errorcode) { - gchar *error; + const gchar *error; switch (errorcode) { case XVID_ERR_FAIL: diff --git a/ext/xvid/gstxvid.h b/ext/xvid/gstxvid.h index 4dca2c21b..cb28ccb72 100644 --- a/ext/xvid/gstxvid.h +++ b/ext/xvid/gstxvid.h @@ -42,15 +42,15 @@ G_BEGIN_DECLS "green_mask = (int) " G_STRINGIFY (g_mask) ", " \ "blue_mask = (int) " G_STRINGIFY (b_mask) -extern gchar * gst_xvid_error (int errorcode); -extern gboolean gst_xvid_init (void); - -extern gint gst_xvid_structure_to_csp (GstStructure *structure); -extern GstCaps *gst_xvid_csp_to_caps (gint csp, gint w, gint h); -extern gint gst_xvid_image_get_size (gint csp, +extern const gchar *gst_xvid_error (int errorcode); +extern gboolean gst_xvid_init (void); + +extern gint gst_xvid_structure_to_csp (GstStructure *structure); +extern GstCaps * gst_xvid_csp_to_caps (gint csp, gint w, gint h); +extern gint gst_xvid_image_get_size (gint csp, + gint width, gint height); +extern gint gst_xvid_image_fill (xvid_image_t * im, void * ptr, gint csp, gint width, gint height); -extern gint gst_xvid_image_fill (xvid_image_t * im, void * ptr, gint csp, - gint width, gint height); G_END_DECLS diff --git a/gst/adpcmenc/adpcmenc.c b/gst/adpcmenc/adpcmenc.c index 0a9d0e96f..bc45c3da4 100644 --- a/gst/adpcmenc/adpcmenc.c +++ b/gst/adpcmenc/adpcmenc.c @@ -152,8 +152,8 @@ adpcmenc_setup (ADPCMEnc * enc) const int DVI_IMA_HEADER_SIZE = 4; const int ADPCM_SAMPLES_PER_BYTE = 2; guint64 sample_bytes; + const char *layout; - char *layout; switch (enc->layout) { case LAYOUT_ADPCM_DVI: layout = "dvi"; diff --git a/gst/dataurisrc/gstdataurisrc.c b/gst/dataurisrc/gstdataurisrc.c index bb4b895fe..17ebf4b10 100644 --- a/gst/dataurisrc/gstdataurisrc.c +++ b/gst/dataurisrc/gstdataurisrc.c @@ -314,7 +314,7 @@ gst_data_uri_src_get_uri_type (void) static gchar ** gst_data_uri_src_get_protocols (void) { - static gchar *protocols[] = { "data", 0 }; + static gchar *protocols[] = { (char *) "data", 0 }; return protocols; } @@ -423,8 +423,8 @@ gst_data_uri_src_set_uri (GstURIHandler * handler, const gchar * uri) gchar *data; data = - g_convert_with_fallback (old_data, -1, "UTF-8", charset, "*", &read, - &written, NULL); + g_convert_with_fallback (old_data, -1, "UTF-8", charset, (char *) "*", + &read, &written, NULL); g_free (old_data); GST_BUFFER_DATA (src->buffer) = GST_BUFFER_MALLOCDATA (src->buffer) = (guint8 *) data; diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c index f1244b62b..8831b39cf 100644 --- a/gst/dtmf/gstdtmfsrc.c +++ b/gst/dtmf/gstdtmfsrc.c @@ -147,7 +147,7 @@ typedef struct st_dtmf_key { - char *event_name; + const char *event_name; int event_encoding; float low_frequency; float high_frequency; diff --git a/gst/dtmf/gstrtpdtmfdepay.c b/gst/dtmf/gstrtpdtmfdepay.c index 9f5ae9278..00ea508e5 100644 --- a/gst/dtmf/gstrtpdtmfdepay.c +++ b/gst/dtmf/gstrtpdtmfdepay.c @@ -117,7 +117,7 @@ typedef struct st_dtmf_key { - char *event_name; + const char *event_name; int event_encoding; float low_frequency; float high_frequency; diff --git a/gst/festival/gstfestival.h b/gst/festival/gstfestival.h index 66350f442..d099954e6 100644 --- a/gst/festival/gstfestival.h +++ b/gst/festival/gstfestival.h @@ -75,9 +75,9 @@ extern "C" { typedef struct FT_Info { int encoding; - char *server_host; + const char *server_host; int server_port; - char *text_mode; + const char *text_mode; int server_fd; } FT_Info; diff --git a/gst/id3tag/id3tag.c b/gst/id3tag/id3tag.c index 899bd4be2..301307e5d 100644 --- a/gst/id3tag/id3tag.c +++ b/gst/id3tag/id3tag.c @@ -926,7 +926,7 @@ add_relative_volume_tag (GstId3v2Tag * id3v2tag, const GstTagList * list, gint16 gain_int; guint8 peak_bits; GstId3v2Frame frame; - gchar *frame_id; + const gchar *frame_id; /* figure out tag names and the identification string to use */ if (strcmp (tag, GST_TAG_TRACK_PEAK) == 0 || @@ -1154,7 +1154,8 @@ latin1_convert (const GstTagList * list, const gchar * tag, /* Convert to Latin-1 (ISO-8859-1), replacing unrepresentable characters with '?' */ - latin1 = g_convert_with_fallback (str, -1, "ISO-8859-1", "UTF-8", "?", + latin1 = + g_convert_with_fallback (str, -1, "ISO-8859-1", "UTF-8", (char *) "?", NULL, &len, NULL); if (latin1 != NULL && *latin1 != '\0') { diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index ccc3262d7..875f9712e 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -799,10 +799,10 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer, DESC_DVB_SATELLITE_DELIVERY_SYSTEM_west_east_flag (delivery); guint8 polarization = DESC_DVB_SATELLITE_DELIVERY_SYSTEM_polarization (delivery); - gchar *polarization_str; + const gchar *polarization_str; guint8 modulation = DESC_DVB_SATELLITE_DELIVERY_SYSTEM_modulation (delivery); - gchar *modulation_str; + const gchar *modulation_str; guint8 *symbol_rate_bcd = DESC_DVB_SATELLITE_DELIVERY_SYSTEM_symbol_rate (delivery); guint32 symbol_rate = @@ -814,7 +814,7 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer, 100000 * ((symbol_rate_bcd[0] & 0xF0) >> 4); guint8 fec_inner = DESC_DVB_SATELLITE_DELIVERY_SYSTEM_fec_inner (delivery); - gchar *fec_inner_str; + const gchar *fec_inner_str; switch (polarization) { case 0: @@ -914,7 +914,7 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer, DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_transmission_mode (delivery); gboolean other_frequency = DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM_other_frequency (delivery); - gchar *constellation_str, *code_rate_hp_str, *code_rate_lp_str, + const gchar *constellation_str, *code_rate_hp_str, *code_rate_lp_str, *transmission_mode_str; /* do the stuff */ /* bandwidth is 8 if 0, 7 if 1, 6 if 2, reserved otherwise */ @@ -1041,7 +1041,7 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer, 10000000 * ((frequency_bcd[0] & 0xF0) >> 4)); guint8 modulation = DESC_DVB_CABLE_DELIVERY_SYSTEM_modulation (delivery); - gchar *modulation_str; + const gchar *modulation_str; guint8 *symbol_rate_bcd = DESC_DVB_CABLE_DELIVERY_SYSTEM_symbol_rate (delivery); guint32 symbol_rate = @@ -1052,7 +1052,7 @@ mpegts_packetizer_parse_nit (MpegTSPacketizer * packetizer, 10000 * (symbol_rate_bcd[0] & 0x0F) + 100000 * ((symbol_rate_bcd[0] & 0xF0) >> 4); guint8 fec_inner = DESC_DVB_CABLE_DELIVERY_SYSTEM_fec_inner (delivery); - gchar *fec_inner_str; + const gchar *fec_inner_str; switch (fec_inner) { case 0: @@ -1386,7 +1386,7 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer, (gchar *) DESC_DVB_SERVICE_name_text (service_descriptor); if (servicename_length + serviceprovider_name_length + 2 <= DESC_LENGTH (service_descriptor)) { - gchar *running_status_tmp; + const gchar *running_status_tmp; switch (running_status) { case 0: running_status_tmp = "undefined"; @@ -1700,7 +1700,7 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer, gint freq = 25; /* 25 or 30 measured in Hertz */ gboolean highdef = FALSE; gboolean panvectors = FALSE; - gchar *comptype = ""; + const gchar *comptype = ""; comp_descriptor = g_array_index (component_descriptors, guint8 *, i); switch (DESC_DVB_COMPONENT_stream_content (comp_descriptor)) { diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c index e678da63c..6fcfdeb1e 100644 --- a/gst/mxf/mxftypes.c +++ b/gst/mxf/mxftypes.c @@ -645,8 +645,8 @@ mxf_utf8_to_utf16 (const gchar * str, guint16 * size) } ret = (guint8 *) - g_convert_with_fallback (str, -1, "UTF-16BE", "UTF-8", "*", NULL, &s, - &error); + g_convert_with_fallback (str, -1, "UTF-16BE", "UTF-8", (char *) "*", NULL, + &s, &error); if (ret == NULL) { GST_WARNING ("UTF-16-BE to UTF-8 conversion failed: %s", error->message); diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c index 841900d55..d87174e72 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -2817,7 +2817,7 @@ atom_hdlr_set_type (AtomHDLR * hdlr, AtomsContext * context, guint32 comp_type, } static void -atom_hdlr_set_name (AtomHDLR * hdlr, char *name) +atom_hdlr_set_name (AtomHDLR * hdlr, const char *name) { if (hdlr->name) g_free (hdlr->name); diff --git a/gst/qtmux/gstqtmuxmap.h b/gst/qtmux/gstqtmuxmap.h index 67c613902..8e89351dd 100644 --- a/gst/qtmux/gstqtmuxmap.h +++ b/gst/qtmux/gstqtmuxmap.h @@ -61,9 +61,9 @@ typedef enum _GstQTMuxFormat typedef struct _GstQTMuxFormatProp { GstQTMuxFormat format; - gchar *name; - gchar *long_name; - gchar *type_name; + const gchar *name; + const gchar *long_name; + const gchar *type_name; GstStaticCaps src_caps; GstStaticCaps video_sink_caps; GstStaticCaps audio_sink_caps; diff --git a/gst/real/gstrealaudiodec.c b/gst/real/gstrealaudiodec.c index b3f2ad52e..70103cee0 100644 --- a/gst/real/gstrealaudiodec.c +++ b/gst/real/gstrealaudiodec.c @@ -87,7 +87,7 @@ typedef struct guint16 (*RAOpenCodec2) (gpointer, const gchar *); guint16 (*RASetFlavor) (gpointer, guint16); void (*SetDLLAccessPath) (gchar *); - void (*RASetPwd) (gpointer, gchar *); + void (*RASetPwd) (gpointer, const gchar *); } GstRADecLibrary; typedef struct @@ -211,7 +211,7 @@ close_library (GstRealAudioDec * dec, GstRADecLibrary * lib) static gboolean open_library (GstRealAudioDec * dec, gint version, GstRADecLibrary * lib) { - gchar *path, *names; + const gchar *path, *names; gchar **split_names, **split_path; gint i, j; gpointer ra_close_codec, ra_decode, ra_free_decoder; @@ -300,7 +300,7 @@ codec_search_done: lib->RAOpenCodec2 = (guint16 (*)(gpointer, const gchar *)) ra_open_codec2; lib->RAInitDecoder = (guint16 (*)(gpointer, gpointer)) ra_init_decoder; lib->RASetFlavor = (guint16 (*)(gpointer, guint16)) ra_set_flavor; - lib->RASetPwd = (void (*)(gpointer, gchar *)) ra_set_pwd; + lib->RASetPwd = (void (*)(gpointer, const gchar *)) ra_set_pwd; lib->SetDLLAccessPath = (void (*)(gchar *)) set_dll_access_path; if (lib->SetDLLAccessPath) diff --git a/gst/real/gstrealvideodec.c b/gst/real/gstrealvideodec.c index 4485a312f..0c4fb1542 100644 --- a/gst/real/gstrealvideodec.c +++ b/gst/real/gstrealvideodec.c @@ -443,7 +443,7 @@ open_library (GstRealVideoDec * dec, GstRealVideoDecVersion version, { gpointer rv_custom_msg, rv_free, rv_init, rv_transform; GModule *module = NULL; - gchar *path, *names; + const gchar *path, *names; gchar **split_names, **split_path; int i, j; diff --git a/gst/sdp/gstsdpdemux.c b/gst/sdp/gstsdpdemux.c index 3f9306e27..47c6e4a60 100644 --- a/gst/sdp/gstsdpdemux.c +++ b/gst/sdp/gstsdpdemux.c @@ -682,8 +682,8 @@ gst_sdp_demux_media_to_caps (gint pt, const GstSDPMedia * media) /* <param>[=<value>] are separated with ';' */ pairs = g_strsplit (p, ";", 0); for (i = 0; pairs[i]; i++) { - gchar *valpos; - gchar *val, *key; + gchar *valpos, *key; + const gchar *val; /* the key may not have a '=', the value can have other '='s */ valpos = strstr (pairs[i], "="); @@ -933,7 +933,8 @@ start_session_failure: static gboolean gst_sdp_demux_stream_configure_udp (GstSDPDemux * demux, GstSDPStream * stream) { - gchar *uri, *name, *destination; + gchar *uri, *name; + const gchar *destination; GstPad *pad; GST_DEBUG_OBJECT (demux, "creating UDP sources for multicast"); diff --git a/sys/dvb/dvbbasebin.c b/sys/dvb/dvbbasebin.c index 5118146eb..207b7e112 100644 --- a/sys/dvb/dvbbasebin.c +++ b/sys/dvb/dvbbasebin.c @@ -973,7 +973,7 @@ dvb_base_bin_uri_get_type (void) static gchar ** dvb_base_bin_uri_get_protocols (void) { - static gchar *protocols[] = { "dvb", NULL }; + static gchar *protocols[] = { (char *) "dvb", NULL }; return protocols; } diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c index a9cda667e..cb2e12740 100644 --- a/sys/dvb/gstdvbsrc.c +++ b/sys/dvb/gstdvbsrc.c @@ -687,7 +687,7 @@ static gboolean gst_dvbsrc_open_frontend (GstDvbSrc * object) { struct dvb_frontend_info fe_info; - char *adapter_desc = NULL; + const char *adapter_desc = NULL; gchar *frontend_dev; GstStructure *adapter_structure; char *adapter_name = NULL; diff --git a/sys/dvb/parsechannels.c b/sys/dvb/parsechannels.c index 3df3a6df5..6de7b12a3 100644 --- a/sys/dvb/parsechannels.c +++ b/sys/dvb/parsechannels.c @@ -37,14 +37,14 @@ parse_channels_conf_from_file (const gchar * filename) gchar **lines; gchar *line; gchar **fields; - gchar *terrestrial[] = { "inversion", "bandwidth", + const gchar *terrestrial[] = { "inversion", "bandwidth", "code-rate-hp", "code-rate-lp", "modulation", "transmission-mode", "guard", "hierarchy" }; - gchar *satellite[] = { "polarity", "diseqc-source", + const gchar *satellite[] = { "polarity", "diseqc-source", "symbol-rate" }; - gchar *cable[] = { "inversion", "symbol-rate", "code-rate-hp", + const gchar *cable[] = { "inversion", "symbol-rate", "code-rate-hp", "modulation" }; int i; diff --git a/sys/vcd/vcdsrc.c b/sys/vcd/vcdsrc.c index 938b1b19e..fa6f0439c 100644 --- a/sys/vcd/vcdsrc.c +++ b/sys/vcd/vcdsrc.c @@ -458,7 +458,7 @@ gst_vcdsrc_uri_get_type (void) static gchar ** gst_vcdsrc_uri_get_protocols (void) { - static gchar *protocols[] = { "vcd", NULL }; + static gchar *protocols[] = { (char *) "vcd", NULL }; return protocols; } diff --git a/tests/check/elements/asfmux.c b/tests/check/elements/asfmux.c index 40834e9ff..6c3dab511 100644 --- a/tests/check/elements/asfmux.c +++ b/tests/check/elements/asfmux.c @@ -57,7 +57,7 @@ static GstStaticPadTemplate srcaudiotemplate = GST_STATIC_PAD_TEMPLATE ("src", static GstPad * setup_src_pad (GstElement * element, - GstStaticPadTemplate * template, GstCaps * caps, gchar * sinkname) + GstStaticPadTemplate * template, GstCaps * caps, const gchar * sinkname) { GstPad *srcpad, *sinkpad; @@ -86,7 +86,7 @@ setup_src_pad (GstElement * element, } static void -teardown_src_pad (GstElement * element, gchar * sinkname) +teardown_src_pad (GstElement * element, const gchar * sinkname) { GstPad *srcpad, *sinkpad; gchar *padname; @@ -122,7 +122,7 @@ teardown_src_pad (GstElement * element, gchar * sinkname) } static GstElement * -setup_asfmux (GstStaticPadTemplate * srctemplate, gchar * sinkname) +setup_asfmux (GstStaticPadTemplate * srctemplate, const gchar * sinkname) { GstElement *asfmux; @@ -137,7 +137,7 @@ setup_asfmux (GstStaticPadTemplate * srctemplate, gchar * sinkname) } static void -cleanup_asfmux (GstElement * asfmux, gchar * sinkname) +cleanup_asfmux (GstElement * asfmux, const gchar * sinkname) { GST_DEBUG ("cleanup_asfmux"); gst_element_set_state (asfmux, GST_STATE_NULL); @@ -149,8 +149,8 @@ cleanup_asfmux (GstElement * asfmux, gchar * sinkname) } static void -check_asfmux_pad (GstStaticPadTemplate * srctemplate, gchar * src_caps_string, - gchar * sinkname) +check_asfmux_pad (GstStaticPadTemplate * srctemplate, + const gchar * src_caps_string, const gchar * sinkname) { GstElement *asfmux; GstBuffer *inbuffer; diff --git a/tests/check/elements/autoconvert.c b/tests/check/elements/autoconvert.c index 83813bd9f..c36247f70 100644 --- a/tests/check/elements/autoconvert.c +++ b/tests/check/elements/autoconvert.c @@ -62,7 +62,7 @@ teardown (void) static void set_autoconvert_factories (GstElement * autoconvert) { - gchar *desired_features[] = { "testelement1", "testelement2" }; + const gchar *desired_features[] = { "testelement1", "testelement2" }; GstElementFactory *feature; GList *factories = NULL; gint i; @@ -167,7 +167,7 @@ autoconvert_suite (void) /* Implementation of the test elements */ static void -configure_test_element (GstBin * bin, gchar * capsfilter) +configure_test_element (GstBin * bin, const gchar * capsfilter) { GstElement *filter; GstElement *identity; diff --git a/tests/check/elements/mplex.c b/tests/check/elements/mplex.c index 0b62e247e..356de173f 100644 --- a/tests/check/elements/mplex.c +++ b/tests/check/elements/mplex.c @@ -118,7 +118,7 @@ test_sink_event (GstPad * pad, GstEvent * event) /* setup and teardown needs some special handling for muxer */ static GstPad * setup_src_pad (GstElement * element, - GstStaticPadTemplate * template, GstCaps * caps, gchar * sinkname) + GstStaticPadTemplate * template, GstCaps * caps, const gchar * sinkname) { GstPad *srcpad, *sinkpad; @@ -146,7 +146,7 @@ setup_src_pad (GstElement * element, } static void -teardown_src_pad (GstElement * element, gchar * sinkname) +teardown_src_pad (GstElement * element, const gchar * sinkname) { GstPad *srcpad, *sinkpad; gchar *padname; diff --git a/tests/check/elements/qtmux.c b/tests/check/elements/qtmux.c index 0c0581812..c5d6d1c35 100644 --- a/tests/check/elements/qtmux.c +++ b/tests/check/elements/qtmux.c @@ -58,7 +58,7 @@ static GstStaticPadTemplate srcaudiotemplate = GST_STATIC_PAD_TEMPLATE ("src", /* setup and teardown needs some special handling for muxer */ static GstPad * setup_src_pad (GstElement * element, - GstStaticPadTemplate * template, GstCaps * caps, gchar * sinkname) + GstStaticPadTemplate * template, GstCaps * caps, const gchar * sinkname) { GstPad *srcpad, *sinkpad; @@ -111,7 +111,7 @@ teardown_src_pad (GstPad * srcpad) } static GstElement * -setup_qtmux (GstStaticPadTemplate * srctemplate, gchar * sinkname) +setup_qtmux (GstStaticPadTemplate * srctemplate, const gchar * sinkname) { GstElement *qtmux; @@ -126,7 +126,7 @@ setup_qtmux (GstStaticPadTemplate * srctemplate, gchar * sinkname) } static void -cleanup_qtmux (GstElement * qtmux, gchar * sinkname) +cleanup_qtmux (GstElement * qtmux, const gchar * sinkname) { GST_DEBUG ("cleanup_qtmux"); gst_element_set_state (qtmux, GST_STATE_NULL); @@ -139,7 +139,7 @@ cleanup_qtmux (GstElement * qtmux, gchar * sinkname) } static void -check_qtmux_pad (GstStaticPadTemplate * srctemplate, gchar * sinkname) +check_qtmux_pad (GstStaticPadTemplate * srctemplate, const gchar * sinkname) { GstElement *qtmux; GstBuffer *inbuffer, *outbuffer; diff --git a/tests/check/elements/selector.c b/tests/check/elements/selector.c index e9449c030..56d2840ec 100644 --- a/tests/check/elements/selector.c +++ b/tests/check/elements/selector.c @@ -38,7 +38,7 @@ static gboolean probe_cb (GstPad * pad, GstMiniObject * obj, gpointer user_data) { gint count = 0; - gchar *count_type = NULL; + const gchar *count_type = NULL; GST_LOG_OBJECT (pad, "got data"); @@ -184,17 +184,15 @@ count_output_buffers (GList * output_pads, gint expected_buffers) static void selector_set_active_pad (GstElement * elem, GstPad * selpad) { - gchar *padname = ""; + gchar *padname = NULL; if (selpad) { padname = gst_pad_get_name (selpad); } g_object_set (G_OBJECT (elem), "active-pad", selpad, NULL); - GST_DEBUG_OBJECT (elem, "activated selector pad: %s", padname); - if (selpad) { - g_free (padname); - } + GST_DEBUG_OBJECT (elem, "activated selector pad: %s", GST_STR_NULL (padname)); + g_free (padname); } /* Push buffers and switch for each selector pad */ diff --git a/tests/examples/camerabin/gst-camera.c b/tests/examples/camerabin/gst-camera.c index 52c72c6b3..3082a0ff5 100644 --- a/tests/examples/camerabin/gst-camera.c +++ b/tests/examples/camerabin/gst-camera.c @@ -127,8 +127,8 @@ static guint32 num_vids = 0; static gint max_fr_n = 0; static gint max_fr_d = 0; -static gchar *video_post; -static gchar *image_post; +static const gchar *video_post; +static const gchar *image_post; static GList *video_caps_list = NULL; @@ -139,7 +139,7 @@ static gchar *iso_speed_labels[] = { "auto", "100", "200", "400" }; static struct { - gchar *label; + const gchar *label; gint width; gint height; } image_resolution_label_map[] = { @@ -920,8 +920,8 @@ on_radiobuttonVideoCapture_toggled (GtkToggleButton * togglebutton, } } -void -on_rbBntVidEff_toggled (GtkToggleButton * togglebutton, gchar * effect) +static void +on_rbBntVidEff_toggled (GtkToggleButton * togglebutton, const gchar * effect) { if (gtk_toggle_button_get_active (togglebutton)) { /* lets also use those effects to image */ @@ -1601,7 +1601,7 @@ static gboolean ui_create (void) { GError *error = NULL; - gchar *uifile = DEFAULT_UI_FILE; + const gchar *uifile = DEFAULT_UI_FILE; if (!g_file_test (uifile, G_FILE_TEST_EXISTS)) { uifile = SHARED_UI_FILE; diff --git a/tests/examples/camerabin/gst-camera.h b/tests/examples/camerabin/gst-camera.h index b027ecd23..f1d88446c 100644 --- a/tests/examples/camerabin/gst-camera.h +++ b/tests/examples/camerabin/gst-camera.h @@ -55,9 +55,6 @@ on_radiobuttonVideoCapture_toggled (GtkToggleButton * togglebutton, gpointer user_data); void -on_rbBntVidEff_toggled (GtkToggleButton * togglebutton, gchar * effect); - -void on_rbBntVidEffNone_toggled (GtkToggleButton * togglebutton, gpointer data); void diff --git a/tests/examples/scaletempo/demo-gui.c b/tests/examples/scaletempo/demo-gui.c index 5ff976064..9d5779052 100644 --- a/tests/examples/scaletempo/demo-gui.c +++ b/tests/examples/scaletempo/demo-gui.c @@ -411,7 +411,7 @@ demo_gui_do_playlist_next (GtkAction * action, gpointer data) static void demo_gui_do_about_dialog (GtkAction * action, gpointer data) { - static gchar *authors[] = + static const gchar *authors[] = { "Rov Juvano <rovjuvano@users.sourceforge.net>", NULL }; gtk_show_about_dialog (NULL, diff --git a/tests/examples/scaletempo/demo-main.c b/tests/examples/scaletempo/demo-main.c index 0902d7b26..6ddcde71d 100644 --- a/tests/examples/scaletempo/demo-main.c +++ b/tests/examples/scaletempo/demo-main.c @@ -26,10 +26,15 @@ extern GOptionGroup *gtk_get_option_group (gboolean); extern GOptionGroup *gst_init_get_option_group (void); static void -handle_error_message (DemoPlayer * player, const gchar * msg, gpointer data) +handle_player_error (DemoPlayer * player, const gchar * msg, gpointer unused) { - const gchar *format = (const gchar *) data; - g_print (format, msg); + g_print ("PLAYER ERROR: %s\n", msg); +} + +static void +handle_gui_error (DemoPlayer * player, const gchar * msg, gpointer unused) +{ + g_print ("GUI ERROR: %s\n", msg); } static void @@ -71,10 +76,8 @@ main (int argc, char *argv[]) gui = g_object_new (DEMO_TYPE_GUI, NULL); player = g_object_new (DEMO_TYPE_PLAYER, NULL); - g_signal_connect (player, "error", G_CALLBACK (handle_error_message), - "PLAYER ERROR: %s\n"); - g_signal_connect (gui, "error", G_CALLBACK (handle_error_message), - "GUI ERROR: %s\n"); + g_signal_connect (player, "error", G_CALLBACK (handle_player_error), NULL); + g_signal_connect (gui, "error", G_CALLBACK (handle_gui_error), NULL); demo_gui_set_player (gui, player); loop = g_main_loop_new (NULL, FALSE); |