diff options
author | František Dvořák <valtri@civ.zcu.cz> | 2008-11-20 20:56:19 +0100 |
---|---|---|
committer | František Dvořák <valtri@civ.zcu.cz> | 2008-11-20 20:56:19 +0100 |
commit | ea2b5508e35f5125fd65730822b30bb8895ad87d (patch) | |
tree | e03317e974e1bf818ca50904242595fa01db25df /src | |
parent | 2ba1e128cbb791cfdb2829895a854bb664018912 (diff) | |
download | xine-lib-ea2b5508e35f5125fd65730822b30bb8895ad87d.tar.gz xine-lib-ea2b5508e35f5125fd65730822b30bb8895ad87d.tar.bz2 |
Some warning fixes: XINE_FORMAT_SCANF, statics in headers, consts, ...
Add warning flags to the DEBUG_CFLAGS too.
Diffstat (limited to 'src')
37 files changed, 112 insertions, 109 deletions
diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c index 24a31c1cb..0606586cb 100644 --- a/src/demuxers/demux_dts.c +++ b/src/demuxers/demux_dts.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 the xine project + * Copyright (C) 2005-2008 the xine project * * This file is part of xine, a free video player. * @@ -199,6 +199,12 @@ static int open_dts_file(demux_dts_t *this) { sfreq = peak[this->data_start+8] & 0x0f; break; + default: + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, + LOG_MODULE ": unsupported DTS bitstream encoding %d\n", + dts_version); + return 0; + } if ((sfreq > sizeof(dts_sample_rates)/sizeof(int)) || diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c index 32dd2cb51..d9ac952d8 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2006 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -257,7 +257,6 @@ static void demux_mpeg_pes_parse_pack (demux_mpeg_pes_t *this, int preview_mode) uint8_t *p; int32_t result; off_t i; - int32_t n; uint8_t buf6[ 6 ]; this->scr = 0; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 32b516537..aa4dfc26b 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -1067,7 +1067,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) { /* read the packet information */ const uint16_t stream = _X_BE_16(&header[4]); - const off_t offset = this->input->get_current_pos(this->input); + const off_t offset __attr_unused = this->input->get_current_pos(this->input); uint16_t size = _X_BE_16(&header[2]) - DATA_PACKET_HEADER_SIZE; const uint32_t timestamp= _X_BE_32(&header[6]); int64_t pts = (int64_t) timestamp * 90; @@ -1111,7 +1111,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) { * seems to be a very short header * 2 bytes, purpose of the second byte yet unknown */ - const int bummer = stream_read_char (this); + const int bummer __attr_unused = stream_read_char (this); lprintf ("bummer == %02X\n",bummer); vpkg_offset = 0; diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index a49084ba7..442bffadc 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -139,8 +139,7 @@ #define CD_RAW_SECTOR_SIZE 2352 -static const uint8_t STR_MAGIC = - { 0x60, 0x01, 0x01, 0x80 }; +#define STR_MAGIC "\x60\x01\x01\x80" #define STR_MAX_CHANNELS 32 #define CDXA_TYPE_MASK 0x0E diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 4a1cc78ec..5fbec7b69 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2005 the xine project + * Copyright (C) 2001-2008 the xine project * * This file is part of xine, a free video player. * @@ -112,6 +112,7 @@ static int find_chunk_by_tag(demux_wav_t *this, const uint32_t given_chunk_tag, static int open_wav_file(demux_wav_t *this) { uint8_t signature[WAV_SIGNATURE_SIZE]; off_t wave_pos; + uint32_t wave_size; /* check the signature */ if (_x_demux_read_header(this->input, signature, WAV_SIGNATURE_SIZE) != WAV_SIGNATURE_SIZE) @@ -122,8 +123,9 @@ static int open_wav_file(demux_wav_t *this) { /* search for the 'fmt ' chunk first */ wave_pos = 0; - if (find_chunk_by_tag(this, fmt_TAG, &this->wave_size, &wave_pos)==0) + if (find_chunk_by_tag(this, fmt_TAG, &wave_size, &wave_pos)==0) return 0; + this->wave_size = wave_size; this->input->seek(this->input, wave_pos, SEEK_SET); this->wave = malloc( this->wave_size ); @@ -146,7 +148,7 @@ static int open_wav_file(demux_wav_t *this) { /* search for the 'data' chunk */ this->data_start = this->data_size = 0; - if (find_chunk_by_tag(this, data_TAG, &this->data_size, &this->data_start)==0) + if (find_chunk_by_tag(this, data_TAG, NULL, &this->data_start)==0) { free (this->wave); return 0; diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 06ab9d626..996460832 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -1033,13 +1033,13 @@ network_command( xine_stream_t *stream, int socket, char *data_buf, char *msg, . #ifndef WIN32 -static int network_connect(xine_stream_t *stream, char *url ) +static int network_connect(xine_stream_t *stream, const char *got_url ) { - char *host; + char *host, *url; int port; int fd; - url = strdup(url); + url = strdup(got_url); parse_url(url, &host, &port); if( !host || !strlen(host) || !port ) @@ -1450,7 +1450,7 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) { while((pdir = readdir(dir)) != NULL) { char discid[9]; - snprintf(discid, sizeof(discid), "%08lx", this->cddb.disc_id); + snprintf(discid, sizeof(discid), "%08" PRIx32, this->cddb.disc_id); if(!strcasecmp(pdir->d_name, discid)) { FILE *fd; @@ -1549,7 +1549,7 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) { } } xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_cdda: cached entry for disc ID %08lx not found.\n", this->cddb.disc_id); + "input_cdda: cached entry for disc ID %08" PRIx32 " not found.\n", this->cddb.disc_id); closedir(dir); } @@ -1573,7 +1573,7 @@ static void _cdda_save_cached_cddb_infos(cdda_input_plugin_t *this, char *fileco _cdda_mkdir_recursive_safe(this->stream->xine, cfile); - snprintf(cfile, sizeof(cfile), "%s/%08lx", this->cddb.cache_dir, this->cddb.disc_id); + snprintf(cfile, sizeof(cfile), "%s/%08" PRIx32 , this->cddb.cache_dir, this->cddb.disc_id); if((fd = fopen(cfile, "w")) == NULL) { xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, @@ -1712,7 +1712,7 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) { /* Send query command */ memset(&buffer, 0, sizeof(buffer)); - size_t size = sprintf(buffer, "cddb query %08lx %d ", this->cddb.disc_id, this->cddb.num_tracks); + size_t size = sprintf(buffer, "cddb query %08" PRIx32 " %d ", this->cddb.disc_id, this->cddb.num_tracks); for (i = 0; i < this->cddb.num_tracks; i++) { size += snprintf(buffer + size, sizeof(buffer) - size, "%d ", this->cddb.track[i].start); } @@ -2004,7 +2004,7 @@ static void _cdda_free_cddb_info(cdda_input_plugin_t *this) { */ static int cdda_open(cdda_input_plugin_t *this_gen, - char *cdda_device, cdrom_toc *toc, int *fdd) { + const char *cdda_device, cdrom_toc *toc, int *fdd) { #ifndef WIN32 int fd = -1; diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 19b479a06..0fa5ba971 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -3196,7 +3196,6 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, { dvb_input_class_t *class = (dvb_input_class_t *) this_gen; channel_t *channels=NULL; - char foobuffer[BUFSIZE]; int ch, apch, num_channels = 0; int default_channel = -1; xine_cfg_entry_t lastchannel_enable = {0}; diff --git a/src/input/input_smb.c b/src/input/input_smb.c index dbab772c9..3d495f04e 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 the xine project + * Copyright (C) 2008 the xine project * * This file is part of xine, a free video player. * @@ -51,7 +51,7 @@ typedef struct { xine_stream_t *stream; /* File */ - char *mrl; + const char *mrl; int fd; } smb_input_t; @@ -138,7 +138,7 @@ smb_plugin_get_length (input_plugin_t *this_gen) return st.st_size; } -static char* +static const char* smb_plugin_get_mrl (input_plugin_t *this_gen) { smb_input_t *this = (smb_input_t *) this_gen; @@ -150,7 +150,7 @@ static uint32_t smb_plugin_get_blocksize (input_plugin_t *this_gen) { return 0; } -static char +static const char *smb_class_get_description (input_class_t *this_gen) { return _("CIFS/SMB input plugin based on libsmbclient"); @@ -280,7 +280,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, dir_files[num_dir_files].link = NULL; dir_files[num_dir_files].type = mrl_file | mrl_file_directory; dir_files[num_dir_files].origin = strdup("smb:/"); - asprintf(*(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", pdirent->name); + asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", pdirent->name); dir_files[num_dir_files].size = pdirent->dirlen; num_dir_files ++; } else if (pdirent->smbc_type == SMBC_FILE_SHARE){ @@ -423,7 +423,7 @@ smb_plugin_dispose (input_plugin_t *this_gen ) if (this->fd>=0) smbc_close(this->fd); if (this->mrl) - free (this->mrl); + free ((char *)this->mrl); free (this); } diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index b97f11ace..3a020bd69 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2004 the xine project + * Copyright (C) 2003-2008 the xine project * Copyright (C) 2003 J.Asselman <j.asselman@itsec-ps.nl> * * This file is part of xine, a free video player. @@ -100,10 +100,6 @@ static const resolution_t resolutions[] = { static char *tv_standard_names[] = { "AUTO", "PAL", "NTSC", "SECAM", "OLD", NULL }; static int tv_standard_values[] = { VIDEO_MODE_AUTO, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM, -1 }; -#if !defined(NDELAY) && defined(O_NDELAY) -#define FNDELAY O_NDELAY -#endif - typedef struct pvrscr_s pvrscr_t; typedef struct { @@ -844,7 +840,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this) { int found = 0; int tuner_found = 0; - int i, ret; + int ret; unsigned int j; cfg_entry_t *entry; @@ -1870,11 +1866,11 @@ static input_plugin_t *v4l_class_get_radio_instance (input_class_t *cls_gen, * v4l input plugin class stuff */ -static char *v4l_class_get_video_description (input_class_t *this_gen) { +static const char *v4l_class_get_video_description (input_class_t *this_gen) { return _("v4l tv input plugin"); } -static char *v4l_class_get_radio_description (input_class_t *this_gen) { +static const char *v4l_class_get_radio_description (input_class_t *this_gen) { return _("v4l radio input plugin"); } diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 90f6fcc70..760910a01 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2006 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -939,7 +939,6 @@ static void vcd_filelist_dispose(vcd_input_class_t *this) { static void vcd_class_dispose (input_class_t *this_gen) { vcd_input_class_t *this = (vcd_input_class_t *) this_gen; - int i; config_values_t *config = this->xine->config; config->unregister_callback(config, "media.vcd.device"); @@ -1068,7 +1067,6 @@ static void *init_class (xine_t *xine, void *data) { vcd_input_class_t *this; config_values_t *config = xine->config; - int i; this = calloc(1, sizeof (vcd_input_class_t)); diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index f4f823918..55b7f9b84 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -966,7 +966,7 @@ vcd_class_eject_media (input_class_t *this_gen) * From spec: * return current MRL */ -static char * +static const char * vcd_plugin_get_mrl (input_plugin_t *this_gen) { vcd_input_plugin_t *t = (vcd_input_plugin_t *) this_gen; @@ -987,7 +987,7 @@ vcd_plugin_get_mrl (input_plugin_t *this_gen) /* Bad type. */ LOG_ERR("%s %d", _("Invalid current entry type"), vcdplayer->play_item.type); - return strdup(""); + return ""; } else { n += offset; if (n < t->class->num_mrls) { @@ -995,7 +995,7 @@ vcd_plugin_get_mrl (input_plugin_t *this_gen) t->class->mrls[n]->mrl); return t->class->mrls[n]->mrl; } else { - return strdup(""); + return ""; } } } @@ -1005,7 +1005,7 @@ vcd_plugin_get_mrl (input_plugin_t *this_gen) return human readable (verbose = 1 line) description for this plugin */ -static char * +static const char * vcd_class_get_description (input_class_t *this_gen) { dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n"); diff --git a/src/libmad/bit.c b/src/libmad/bit.c index 8d9571e8f..cd0fe4904 100644 --- a/src/libmad/bit.c +++ b/src/libmad/bit.c @@ -27,7 +27,8 @@ # ifdef HAVE_LIMITS_H # include <limits.h> -# else +# endif +# ifndef CHAR_BIT # define CHAR_BIT 8 # endif diff --git a/src/libmad/layer12.c b/src/libmad/layer12.c index 25fd04d70..76def1189 100644 --- a/src/libmad/layer12.c +++ b/src/libmad/layer12.c @@ -27,7 +27,8 @@ # ifdef HAVE_LIMITS_H # include <limits.h> -# else +# endif +#ifndef CHAR_BIT # define CHAR_BIT 8 # endif diff --git a/src/libmad/layer3.c b/src/libmad/layer3.c index c5d46e8d1..899102e0d 100644 --- a/src/libmad/layer3.c +++ b/src/libmad/layer3.c @@ -34,7 +34,8 @@ # ifdef HAVE_LIMITS_H # include <limits.h> -# else +#endif +# ifndef CHAR_BIT # define CHAR_BIT 8 # endif diff --git a/src/libmpeg2/mpeg2.h b/src/libmpeg2/mpeg2.h index 253f300a2..ae69688f5 100644 --- a/src/libmpeg2/mpeg2.h +++ b/src/libmpeg2/mpeg2.h @@ -31,7 +31,8 @@ typedef struct mpeg2dec_s { uint32_t frame_format; /* this is where we keep the state of the decoder */ - struct picture_s * picture, *picture_base; + struct picture_s * picture; + void *picture_base; uint32_t shift; int new_sequence; @@ -45,7 +46,8 @@ typedef struct mpeg2dec_s { /* which is 224K for MP@ML streams. */ /* (we make no pretenses of decoding anything more than that) */ /* allocated in init - gcc has problems allocating such big structures */ - uint8_t * chunk_buffer, *chunk_base; + uint8_t * chunk_buffer; + void *chunk_base; /* pointer to current position in chunk_buffer */ uint8_t * chunk_ptr; /* last start code ? */ diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c index 7f4942cc5..20f67a984 100644 --- a/src/libreal/xine_real_audio_decoder.c +++ b/src/libreal/xine_real_audio_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -510,7 +510,6 @@ static void dispose_class (audio_decoder_class_t *this) { void *init_realadec (xine_t *xine, void *data) { real_class_t *this; - config_values_t *config = xine->config; this = (real_class_t *) calloc(1, sizeof(real_class_t)); diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c index e048b04d6..3c575d0a8 100644 --- a/src/libreal/xine_real_video_decoder.c +++ b/src/libreal/xine_real_video_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -533,7 +533,6 @@ static void dispose_class (video_decoder_class_t *this) { void *init_realvdec (xine_t *xine, void *data) { real_class_t *this; - config_values_t *config = xine->config; this = (real_class_t *) calloc(1, sizeof(real_class_t)); diff --git a/src/libspucc/cc_decoder.h b/src/libspucc/cc_decoder.h index 8698189a6..47703b6d1 100644 --- a/src/libspucc/cc_decoder.h +++ b/src/libspucc/cc_decoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * Copyright (C) Christian Vogler * cvogler@gradient.cis.upenn.edu - December 2001 @@ -31,11 +31,7 @@ typedef struct cc_decoder_s cc_decoder_t; typedef struct cc_renderer_s cc_renderer_t; #define NUM_CC_PALETTES 2 -static const char *cc_schemes[NUM_CC_PALETTES + 1] = { - "White/Gray/Translucent", - "White/Black/Solid", - NULL -}; +extern const char *cc_schemes[]; #define CC_FONT_MAX 256 diff --git a/src/libspucc/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c index 0018bfa1e..1d9c87366 100644 --- a/src/libspucc/xine_cc_decoder.c +++ b/src/libspucc/xine_cc_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -33,6 +33,12 @@ #define LOG_DEBUG 1 */ +const char *cc_schemes[NUM_CC_PALETTES + 1] = { + "White/Gray/Translucent", + "White/Black/Solid", + NULL +}; + typedef struct spucc_decoder_s { spu_decoder_t spu_decoder; @@ -193,7 +199,7 @@ static void spucc_register_cfg_vars(spucc_class_t *this, cc_vars->cc_scheme = xine_cfg->register_enum(xine_cfg, "subtitles.closedcaption.scheme", 0, - cc_schemes, + (char **)cc_schemes, _("closed-captioning foreground/background scheme"), _("Choose your favourite rendering of the closed " "captions."), diff --git a/src/libspucmml/xine_cmml_decoder.c b/src/libspucmml/xine_cmml_decoder.c index 1a8f65e14..c3da1b0fd 100644 --- a/src/libspucmml/xine_cmml_decoder.c +++ b/src/libspucmml/xine_cmml_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -446,7 +446,7 @@ static spu_decoder_t *spucmml_class_open_plugin (spu_decoder_class_t *class_gen, this->spu_decoder.set_button = NULL; this->spu_decoder.dispose = spudec_dispose; - this->class = class_gen; + this->class = class; this->stream = stream; this->event_queue = xine_event_new_queue (this->stream); diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c index e63bdf8b9..02bae6ac9 100644 --- a/src/libspudec/xine_spu_decoder.c +++ b/src/libspudec/xine_spu_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2008 the xine project * * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001 * @@ -70,7 +70,6 @@ static const clut_t default_clut[] = { static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { spudec_decoder_t *this = (spudec_decoder_t *) this_gen; const uint8_t stream_id = buf->type & 0x1f ; - spudec_seq_t *cur_seq = &this->spudec_stream_state[stream_id].ra_seq; #ifdef LOG_DEBUG printf("libspudec:got buffer type = %x\n", buf->type); diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c index 8a4fe6926..e6e885e1f 100644 --- a/src/libspudvb/xine_spudvb_decoder.c +++ b/src/libspudvb/xine_spudvb_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 the xine project + * Copyright (C) 2008 the xine project * * This file is part of xine, a free video player. * @@ -515,7 +515,6 @@ static void process_object_data_segment (dvb_spu_decoder_t * this) dvbsub->i += 2; const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i += 2; - const int j = dvbsub->i + segment_length; const uint16_t object_id = _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i += 2; @@ -779,7 +778,6 @@ static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf) this->dvbsub->buf = this->pes_pkt; - int PES_header_data_length = 0; this->dvbsub->i = 0; const uint8_t data_identifier = this->dvbsub->buf[this->dvbsub->i++]; @@ -875,6 +873,7 @@ static void spudec_dispose (spu_decoder_t * this_gen) static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen, xine_stream_t * stream) { dvb_spu_decoder_t *this = calloc(1, sizeof (dvb_spu_decoder_t)); + dvb_spu_class_t *class = (dvb_spu_class_t *)class_gen; this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -883,7 +882,7 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen this->spu_decoder.get_interact_info = NULL; this->spu_decoder.set_button = NULL; - this->class = class_gen; + this->class = class; this->stream = stream; this->pes_pkt = calloc(65, 1024); diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 9d99e1a25..d9744ae35 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -1430,7 +1430,7 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) } static int WINAPI expGetCurrentThreadId() { - dbgprintf("GetCurrentThreadId() => %ld\n", pthread_self()); + dbgprintf("GetCurrentThreadId() => %ld\n", (long int)pthread_self()); return (int)pthread_self(); } static int WINAPI expGetCurrentProcess() @@ -2134,7 +2134,6 @@ static const char* WINAPI expGetCommandLineA() dbgprintf("GetCommandLineA() => \"c:\\aviplay.exe\"\n"); return "c:\\aviplay.exe"; } -static short envs[]={'p', 'a', 't', 'h', ' ', 'c', ':', '\\', 0, 0}; static LPWSTR WINAPI expGetEnvironmentStringsW() { dbgprintf("GetEnvironmentStringsW() => 0\n"); @@ -3998,7 +3997,7 @@ static int XINE_FORMAT_PRINTF(2, 3) expsprintf(char* str, const char* format, .. va_end(args); return r; } -static int XINE_FORMAT_PRINTF(2, 3) expsscanf(const char* str, const char* format, ...) +static int XINE_FORMAT_SCANF(2, 3) expsscanf(const char* str, const char* format, ...) { va_list args; int r; @@ -4162,7 +4161,7 @@ static void* expmemset(void* dest, int c, size_t n) static time_t exptime(time_t* t) { time_t result = time(t); - dbgprintf("time(%p) => %ld\n", t, result); + dbgprintf("time(%p) => %ld\n", t, (long int)result); return result; } diff --git a/src/post/audio/filter.c b/src/post/audio/filter.c index c5602736c..55d75e1e4 100644 --- a/src/post/audio/filter.c +++ b/src/post/audio/filter.c @@ -414,7 +414,7 @@ void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef * * return -1 if fail 0 if success. */ -int szxform(_ftype_t* a, _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef) +int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef) { _ftype_t at[3]; _ftype_t bt[3]; diff --git a/src/post/audio/filter.h b/src/post/audio/filter.h index 0b0ce1c1b..0e08aa2b9 100644 --- a/src/post/audio/filter.h +++ b/src/post/audio/filter.h @@ -55,7 +55,7 @@ extern int design_pfir(unsigned int n, unsigned int k, _ftype_t* w, _ftype_t** p extern void prewarp(_ftype_t* a, _ftype_t fc, _ftype_t fs); void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef); -extern int szxform(_ftype_t* a, _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef); +extern int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef); /* Add new data to circular queue designed to be used with a FIR * filter. xq is the circular queue, in pointing at the new sample, xi diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 4fdb7dbfc..792618322 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -412,7 +412,6 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs, post_out_t *output; xine_post_in_t *input_api; post_audio_port_t *port; - int i; if (!this || !audio_target || !audio_target[0] ) { free(this); diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c index 0ead54f55..a1c208919 100644 --- a/src/post/planar/eq2.c +++ b/src/post/planar/eq2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2006 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -432,8 +432,6 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs, xine_post_in_t *input_api; post_out_t *output; post_video_port_t *port; - vf_eq2_t *eq2; - int i; if (!this || !video_target || !video_target[0]) { free(this); diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c index 8ba161ebb..263160808 100644 --- a/src/video_out/deinterlace.c +++ b/src/video_out/deinterlace.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 the xine project + * Copyright (C) 2001-2008 the xine project * * This file is part of xine, a free video player. * @@ -37,6 +37,18 @@ #include "xineutils.h" +const char *deinterlace_methods[] = { + "none", + "bob", + "weave", + "greedy", + "onefield", + "onefield_xv", + "linearblend", + NULL +}; + + /* DeinterlaceFieldBob algorithm Based on Virtual Dub plugin by Gunnar Thalin diff --git a/src/video_out/deinterlace.h b/src/video_out/deinterlace.h index 2ebbf53d9..d7712f581 100644 --- a/src/video_out/deinterlace.h +++ b/src/video_out/deinterlace.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 the xine project + * Copyright (C) 2001-2008 the xine project * * This file is part of xine, a free video player. * @@ -41,15 +41,6 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], #define DEINTERLACE_ONEFIELDXV 5 #define DEINTERLACE_LINEARBLEND 6 -static const char *deinterlace_methods[] = { - "none", - "bob", - "weave", - "greedy", - "onefield", - "onefield_xv", - "linearblend", - NULL -}; +extern const char *deinterlace_methods[]; #endif diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 6a11ebc34..b71518958 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1093,7 +1093,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, return 0; } -static void xv_store_port_attribute(xv_driver_t *this, char *name) { +static void xv_store_port_attribute(xv_driver_t *this, const char *name) { Atom atom; xv_portattribute_t *attr; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 366a03859..c2560ccc0 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -699,6 +699,7 @@ static cxid_t *xvmc_set_context (xvmc_driver_t *this, return NULL; } +#if 0 static XvImage *create_ximage (xvmc_driver_t *this, XShmSegmentInfo *shminfo, int width, int height, int format) { unsigned int xvmc_format; @@ -754,6 +755,7 @@ static void dispose_ximage (xvmc_driver_t *this, lprintf ("dispose_ximage\n"); XFree(myimage); } +#endif static void xvmc_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen, diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index b8d6abf83..b3ac39697 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -159,7 +159,6 @@ static void xxmc_xvmc_dump_subpictures(xxmc_driver_t *this) static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this) { - int i; xvmc_surface_handler_t *handler = &this->xvmc_surf_handler; pthread_mutex_init(&handler->mutex,NULL); @@ -1608,8 +1607,8 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) * other than 100 %, so let's disable deinterlacing at all for this frame */ if (this->deinterlace_enabled && this->bob) { - disable_deinterlace = this->disable_bob_for_progressive_frames && frame->vo_frame.progressive_frame - || this->disable_bob_for_scaled_osd && this->scaled_osd_active + disable_deinterlace = (this->disable_bob_for_progressive_frames && frame->vo_frame.progressive_frame) + || (this->disable_bob_for_scaled_osd && this->scaled_osd_active) || !frame->vo_frame.stream || xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) != XINE_FINE_SPEED_NORMAL; if (!disable_deinterlace) { @@ -2406,7 +2405,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi x11_visual_t *visual = (x11_visual_t *) visual_gen; XColor dummy; XvImage *myimage; - unsigned int adaptors, j; + unsigned int adaptors; unsigned int ver,rel,req,ev,err; XShmSegmentInfo myshminfo; XvPortID xv_port; diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 9a30ea7e8..04fa030bf 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -622,13 +622,13 @@ fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XIN uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; /* return codec name given BUF_VIDEO_xxx */ -char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; +const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; /* return BUF_AUDIO_xxx given the formattag */ uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; /* return codec name given BUF_AUDIO_xxx */ -char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; +const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; #ifndef SUPPORT_ATTRIBUTE_PACKED diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 8bee0e791..b7571d1d7 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -1200,7 +1200,7 @@ static uint32_t cached_buf_type=0; return 0; } -char * _x_buf_video_name( uint32_t buf_type ) { +const char * _x_buf_video_name( uint32_t buf_type ) { int i; buf_type &= 0xffff0000; @@ -1234,7 +1234,7 @@ static uint32_t cached_buf_type=0; return 0; } -char * _x_buf_audio_name( uint32_t buf_type ) { +const char * _x_buf_audio_name( uint32_t buf_type ) { int i; buf_type &= 0xffff0000; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index d8f77c464..4f7492c65 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2006 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -2463,7 +2463,7 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) { * @param joining String to use to join the various strings together. * @param final_length The pre-calculated final length of the string. */ -static char *_x_concatenate_with_string(char **strings, size_t count, char *joining, size_t final_length) { +static char *_x_concatenate_with_string(char const **strings, size_t count, char *joining, size_t final_length) { size_t i; char *const result = malloc(final_length+1); /* Better be safe */ char *str = result; diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h index 3819818d5..d7a0e2f1e 100644 --- a/src/xine-utils/attributes.h +++ b/src/xine-utils/attributes.h @@ -1,7 +1,7 @@ /* * attributes.h * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> - * Copyright (C) 2001-2007 xine developers + * Copyright (C) 2001-2008 xine developers * * This file was originally part of mpeg2dec, a free MPEG-2 video stream * decoder. @@ -72,7 +72,7 @@ # define XINE_SENTINEL #endif -#ifdef SUPPORT_ATTRIBUTE_DEPRECATED +#if defined(SUPPORT_ATTRIBUTE_DEPRECATED) && !defined(XINE_COMPILE) # define XINE_DEPRECATED __attribute__((__deprecated__)) #else # define XINE_DEPRECATED @@ -89,8 +89,10 @@ /* Format attributes */ #ifdef SUPPORT_ATTRIBUTE_FORMAT # define XINE_FORMAT_PRINTF(fmt,var) __attribute__((__format__(__printf__, fmt, var))) +# define XINE_FORMAT_SCANF(fmt,var) __attribute__((__format__(__scanf__, fmt, var))) #else # define XINE_FORMAT_PRINTF(fmt,var) +# define XINE_FORMAT_SCANF(fmt,var) #endif #ifdef SUPPORT_ATTRIBUTE_FORMAT_ARG # define XINE_FORMAT_PRINTF_ARG(fmt) __attribute__((__format_arg__(fmt))) diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c index 301d6c22f..650c10f99 100644 --- a/src/xine-utils/monitor.c +++ b/src/xine-utils/monitor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -38,7 +38,6 @@ static long profiler_calls[MAX_ID] ; static const char *profiler_label[MAX_ID] ; void xine_profiler_init () { - int i; memset(profiler_times, 0, sizeof(profiler_times)); memset(profiler_start, 0, sizeof(profiler_start)); memset(profiler_calls, 0, sizeof(profiler_calls)); |