summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2011-03-07 21:50:45 +0100
committerUoti Urpala <uau@mplayer2.org>2011-04-20 04:22:53 +0300
commit52743acba37451121d0820150694d13e2f660774 (patch)
treef9d924293f242bd969df4e19f3e5f56fc689d8e4
parentb17a1cf70c2666c0f8ea020c37350b178c62fc1a (diff)
downloadmpv-52743acba37451121d0820150694d13e2f660774.tar.bz2
mpv-52743acba37451121d0820150694d13e2f660774.tar.xz
cleanup: avoid various GCC warnings
-rw-r--r--av_log.c1
-rw-r--r--cfg-common.h2
-rw-r--r--libaf/af_ladspa.c25
-rw-r--r--libaf/af_lavcresample.c2
-rw-r--r--libao2/ao_esd.c2
-rw-r--r--libmpcodecs/vf_pp7.c4
-rw-r--r--libmpcodecs/vf_yadif.c2
-rw-r--r--libmpdemux/demux_ogg.c2
-rw-r--r--libvo/vo_fbdev.c1
-rw-r--r--libvo/x11_common.c11
-rw-r--r--libvo/x11_common.h8
-rw-r--r--stream/pnm.c2
-rw-r--r--stream/stream_smb.c1
-rw-r--r--sub/sub.c2
14 files changed, 32 insertions, 33 deletions
diff --git a/av_log.c b/av_log.c
index e3bb9e860c..bd42ce3bf1 100644
--- a/av_log.c
+++ b/av_log.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdbool.h>
+#include "av_log.h"
#include "config.h"
#include "mp_msg.h"
#include <libavutil/log.h>
diff --git a/cfg-common.h b/cfg-common.h
index ad3a775b2c..1023527551 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -623,7 +623,7 @@ const m_option_t common_opts[] = {
{"lavfdopts", (void *) lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#endif
#ifdef CONFIG_XVID4
- {"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"xvidopts", (void *)xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#endif
{"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
// ------------------------- subtitles options --------------------
diff --git a/libaf/af_ladspa.c b/libaf/af_ladspa.c
index 8ab2648ea3..30693f09f2 100644
--- a/libaf/af_ladspa.c
+++ b/libaf/af_ladspa.c
@@ -510,6 +510,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
return af_test_output(af, (af_data_t*)arg);
case AF_CONTROL_COMMAND_LINE: {
char *buf;
+ char *line = arg;
mp_msg(MSGT_AFILTER, MSGL_V, "%s: parse suboptions\n", setup->myname);
@@ -517,46 +518,46 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
* format is (ladspa=)file:label:controls....
*/
- if (!arg) {
+ if (!line) {
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
_("No suboptions specified."));
return AF_ERROR;
}
- buf = malloc(strlen(arg)+1);
+ buf = malloc(strlen(line)+1);
if (!buf) return af_ladspa_malloc_failed(setup->myname);
/* file... */
buf[0] = '\0';
- sscanf(arg, "%[^:]", buf);
+ sscanf(line, "%[^:]", buf);
if (buf[0] == '\0') {
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
_("No library file specified."));
free(buf);
return AF_ERROR;
}
- arg += strlen(buf);
+ line += strlen(buf);
setup->file = strdup(buf);
if (!setup->file) return af_ladspa_malloc_failed(setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: file --> %s\n", setup->myname,
setup->file);
- if (*(char*)arg != '\0') arg++; /* read ':' */
+ if (*line != '\0') line++; /* read ':' */
/* label... */
buf[0] = '\0';
- sscanf(arg, "%[^:]", buf);
+ sscanf(line, "%[^:]", buf);
if (buf[0] == '\0') {
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
_("No filter label specified."));
free(buf);
return AF_ERROR;
}
- arg += strlen(buf);
+ line += strlen(buf);
setup->label = strdup(buf);
if (!setup->label) return af_ladspa_malloc_failed(setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: label --> %s\n", setup->myname,
setup->label);
-/* if (*(char*)arg != '0') arg++; */ /* read ':' */
+/* if (*line != '0') line++; */ /* read ':' */
free(buf); /* no longer needed */
@@ -581,20 +582,20 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
/* ninputcontrols is set by now, read control values from arg */
for(i=0; i<setup->ninputcontrols; i++) {
- if (!arg || (*(char*)arg != ':') ) {
+ if (!line || *line != ':') {
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
_("Not enough controls specified on the command line."));
return AF_ERROR;
}
- arg++;
- r = sscanf(arg, "%f", &val);
+ line++;
+ r = sscanf(line, "%f", &val);
if (r!=1) {
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
_("Not enough controls specified on the command line."));
return AF_ERROR;
}
setup->inputcontrols[setup->inputcontrolsmap[i]] = val;
- arg = strchr(arg, ':');
+ line = strchr(line, ':');
}
mp_msg(MSGT_AFILTER, MSGL_V, "%s: input controls: ", setup->myname);
diff --git a/libaf/af_lavcresample.c b/libaf/af_lavcresample.c
index 48fcd75ac5..f1483aca77 100644
--- a/libaf/af_lavcresample.c
+++ b/libaf/af_lavcresample.c
@@ -119,7 +119,7 @@ static void uninit(struct af_instance_s* af)
static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
af_resample_t *s = af->setup;
- int i, j, consumed, ret;
+ int i, j, consumed, ret = 0;
int16_t *in = (int16_t*)data->audio;
int16_t *out;
int chans = data->nch;
diff --git a/libao2/ao_esd.c b/libao2/ao_esd.c
index 1097d4dfa6..d5423991bd 100644
--- a/libao2/ao_esd.c
+++ b/libao2/ao_esd.c
@@ -161,7 +161,7 @@ static int init(int rate_hz, int channels, int format, int flags)
int bytes_per_sample;
int fl;
char *server = ao_subdevice; /* NULL for localhost */
- float lag_seconds, lag_net, lag_serv;
+ float lag_seconds, lag_net = 0., lag_serv;
struct timeval proto_start, proto_end;
if (esd_fd < 0) {
diff --git a/libmpcodecs/vf_pp7.c b/libmpcodecs/vf_pp7.c
index 58f3e3ef06..1c0274d24f 100644
--- a/libmpcodecs/vf_pp7.c
+++ b/libmpcodecs/vf_pp7.c
@@ -288,8 +288,8 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stri
int x, y;
const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15));
uint8_t *p_src= p->src + 8*stride;
- DCTELEM *block= p->src;
- DCTELEM *temp= p->src + 32;
+ DCTELEM *block= (DCTELEM *)p->src;
+ DCTELEM *temp= (DCTELEM *)(p->src + 32);
if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
for(y=0; y<height; y++){
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 2b2c180405..a5bd542ab5 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -376,7 +376,7 @@ static int config(struct vf_instance *vf,
vf->priv->stride[i]= w;
for(j=0; j<3; j++)
- vf->priv->ref[j][i]= malloc(w*h*sizeof(uint8_t))+3*w;
+ vf->priv->ref[j][i]= (char *)malloc(w*h*sizeof(uint8_t))+3*w;
}
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 3ba2627414..f2a5aa7059 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -1412,7 +1412,7 @@ static void demux_ogg_seek(demuxer_t *demuxer, float rel_seek_secs,
demux_stream_t *ds;
ogg_packet op;
float rate;
- int i, sp, first, precision = 1, do_seek = 1;
+ int i, sp, first = 1, precision = 1, do_seek = 1;
vorbis_info *vi = NULL;
int64_t gp = 0, old_gp;
off_t pos, old_pos;
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index 0937c00312..7d2e9fb6a9 100644
--- a/libvo/vo_fbdev.c
+++ b/libvo/vo_fbdev.c
@@ -746,7 +746,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
{
struct fb_cmap *cmap;
int vm = flags & VOFLAG_MODESWITCHING;
- int zoom = flags & VOFLAG_SWSCALE;
fs = flags & VOFLAG_FULLSCREEN;
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index f695c11fa9..df35932504 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -711,7 +711,7 @@ void vo_x11_classhint(struct vo *vo, Window window, const char *name)
XClassHint wmClass;
pid_t pid = getpid();
- wmClass.res_name = opts->vo_winname ? opts->vo_winname : name;
+ wmClass.res_name = opts->vo_winname ? opts->vo_winname : (char *)name;
wmClass.res_class = "MPlayer";
XSetClassHint(x11->display, window, &wmClass);
XChangeProperty(x11->display, window, x11->XA_NET_WM_PID, XA_CARDINAL,
@@ -1088,7 +1088,6 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
goto final;
if (x11->window_state & VOFLAG_HIDDEN) {
XSizeHints hint;
- XEvent xev;
x11->window_state &= ~VOFLAG_HIDDEN;
vo_x11_classhint(vo, x11->window, classname);
XStoreName(mDisplay, x11->window, title);
@@ -1832,7 +1831,7 @@ static int transform_color(float val,
return (unsigned short) (s * 65535);
}
-uint32_t vo_x11_set_equalizer(struct vo *vo, char *name, int value)
+uint32_t vo_x11_set_equalizer(struct vo *vo, const char *name, int value)
{
float gamma, brightness, contrast;
float rf, gf, bf;
@@ -1883,7 +1882,7 @@ uint32_t vo_x11_set_equalizer(struct vo *vo, char *name, int value)
return VO_TRUE;
}
-uint32_t vo_x11_get_equalizer(char *name, int *value)
+uint32_t vo_x11_get_equalizer(const char *name, int *value)
{
if (cmap == None)
return VO_NOTAVAIL;
@@ -1899,7 +1898,7 @@ uint32_t vo_x11_get_equalizer(char *name, int *value)
}
#ifdef CONFIG_XV
-int vo_xv_set_eq(struct vo *vo, uint32_t xv_port, char *name, int value)
+int vo_xv_set_eq(struct vo *vo, uint32_t xv_port, const char *name, int value)
{
XvAttribute *attributes;
int i, howmany, xv_atom;
@@ -1973,7 +1972,7 @@ int vo_xv_set_eq(struct vo *vo, uint32_t xv_port, char *name, int value)
return VO_FALSE;
}
-int vo_xv_get_eq(struct vo *vo, uint32_t xv_port, char *name, int *value)
+int vo_xv_get_eq(struct vo *vo, uint32_t xv_port, const char *name, int *value)
{
XvAttribute *attributes;
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index 32cffbb639..ba3d0e2617 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -130,8 +130,8 @@ int vo_x11_update_geometry(struct vo *vo, bool update_pos);
void vo_x11_setlayer(struct vo *vo, Window vo_window, int layer);
void vo_x11_uninit(struct vo *vo);
Colormap vo_x11_create_colormap(struct vo *vo, XVisualInfo *vinfo);
-uint32_t vo_x11_set_equalizer(struct vo *vo, char *name, int value);
-uint32_t vo_x11_get_equalizer(char *name, int *value);
+uint32_t vo_x11_set_equalizer(struct vo *vo, const char *name, int value);
+uint32_t vo_x11_get_equalizer(const char *name, int *value);
void fstype_help(void);
void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis,
int x, int y, unsigned int width, unsigned int height, int flags,
@@ -145,8 +145,8 @@ void vo_x11_ewmh_fullscreen(struct vo_x11_state *x11, int action);
#endif
-int vo_xv_set_eq(struct vo *vo, uint32_t xv_port, char * name, int value);
-int vo_xv_get_eq(struct vo *vo, uint32_t xv_port, char * name, int *value);
+int vo_xv_set_eq(struct vo *vo, uint32_t xv_port, const char *name, int value);
+int vo_xv_get_eq(struct vo *vo, uint32_t xv_port, const char *name, int *value);
int vo_xv_enable_vsync(struct vo *vo);
diff --git a/stream/pnm.c b/stream/pnm.c
index 40da142b33..14ffa5d1c1 100644
--- a/stream/pnm.c
+++ b/stream/pnm.c
@@ -503,7 +503,7 @@ static int pnm_get_headers(pnm_t *p, int *need_response) {
uint8_t *ptr=p->header;
uint8_t *prop_hdr=NULL;
int chunk_size,size=0;
- int nr;
+ int nr = 0;
/* rmff_header_t *h; */
*need_response=0;
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index 684940749f..14791a2995 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -109,7 +109,6 @@ static void close_f(stream_t *s){
}
static int open_f (stream_t *stream, int mode, void *opts, int* file_format) {
- struct stream_priv_s *p = (struct stream_priv_s*)opts;
char *filename;
mode_t m = 0;
off_t len;
diff --git a/sub/sub.c b/sub/sub.c
index c9368a457f..3edbb025d2 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -718,7 +718,7 @@ inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,i
// reading the subtitle words from vo_sub->text[]
while (*t) {
if (sub_utf8)
- c = utf8_get_char(&t);
+ c = utf8_get_char((const char **)&t);
else if ((c = *t++) >= 0x80 && sub_unicode)
c = (c<<8) + *t++;
if (k==MAX_UCS){