Fix some more -Wshadow warnings

These aren't printed with newer gcc or clang versions for some reason.

All of them seem to be about local variables shadowing global functions.
This commit is contained in:
wm4 2013-11-01 17:33:11 +01:00
parent 4b6c00c50a
commit e0b6fdeb8d
10 changed files with 36 additions and 36 deletions

View File

@ -187,11 +187,11 @@ static void config_destroy(void *p)
m_option_free(config->opts[n].opt, config->opts[n].data);
}
struct m_config *m_config_new(void *talloc_parent, size_t size,
struct m_config *m_config_new(void *talloc_ctx, size_t size,
const void *defaults,
const struct m_option *options)
{
struct m_config *config = talloc(talloc_parent, struct m_config);
struct m_config *config = talloc(talloc_ctx, struct m_config);
talloc_set_destructor(config, config_destroy);
*config = (struct m_config) {0};
// size==0 means a dummy object is created
@ -205,18 +205,18 @@ struct m_config *m_config_new(void *talloc_parent, size_t size,
return config;
}
struct m_config *m_config_from_obj_desc(void *talloc_parent,
struct m_config *m_config_from_obj_desc(void *talloc_ctx,
struct m_obj_desc *desc)
{
return m_config_new(talloc_parent, desc->priv_size, desc->priv_defaults,
return m_config_new(talloc_ctx, desc->priv_size, desc->priv_defaults,
desc->options);
}
// Like m_config_from_obj_desc(), but don't allocate option struct.
struct m_config *m_config_from_obj_desc_noalloc(void *talloc_parent,
struct m_config *m_config_from_obj_desc_noalloc(void *talloc_ctx,
struct m_obj_desc *desc)
{
return m_config_new(talloc_parent, 0, desc->priv_defaults, desc->options);
return m_config_new(talloc_ctx, 0, desc->priv_defaults, desc->options);
}
int m_config_set_obj_params(struct m_config *conf, char **args)
@ -748,10 +748,10 @@ void m_config_set_profile(struct m_config *config, struct m_profile *p,
config->profile_depth--;
}
void *m_config_alloc_struct(void *talloc_parent,
void *m_config_alloc_struct(void *talloc_ctx,
const struct m_sub_options *subopts)
{
void *substruct = talloc_zero_size(talloc_parent, subopts->size);
void *substruct = talloc_zero_size(talloc_ctx, subopts->size);
if (subopts->defaults)
memcpy(substruct, subopts->defaults, subopts->size);
return substruct;

View File

@ -65,7 +65,7 @@ typedef struct m_config {
} m_config_t;
// Create a new config object.
// talloc_parent: talloc parent context for the m_config allocation
// talloc_ctx: talloc parent context for the m_config allocation
// size: size of the optstruct (where option values are stored)
// size==0 creates a config object with no option struct allocated
// defaults: if not NULL, points to a struct of same type as optstruct, which
@ -74,14 +74,14 @@ typedef struct m_config {
// and a corresponding option switch or sub-option field.
// suboptinit: if not NULL, initialize the suboption string (used for presets)
// Note that the m_config object will keep pointers to defaults and options.
struct m_config *m_config_new(void *talloc_parent, size_t size,
struct m_config *m_config_new(void *talloc_ctx, size_t size,
const void *defaults,
const struct m_option *options);
struct m_config *m_config_from_obj_desc(void *talloc_parent,
struct m_config *m_config_from_obj_desc(void *talloc_ctx,
struct m_obj_desc *desc);
struct m_config *m_config_from_obj_desc_noalloc(void *talloc_parent,
struct m_config *m_config_from_obj_desc_noalloc(void *talloc_ctx,
struct m_obj_desc *desc);
int m_config_set_obj_params(struct m_config *conf, char **args);
@ -208,7 +208,7 @@ int m_config_set_profile_option(struct m_config *config, struct m_profile *p,
void m_config_set_profile(struct m_config *config, struct m_profile *p,
int flags);
void *m_config_alloc_struct(void *talloc_parent,
void *m_config_alloc_struct(void *talloc_ctx,
const struct m_sub_options *subopts);
#endif /* MPLAYER_M_CONFIG_H */

View File

@ -26,7 +26,7 @@
static int init(priv_t *priv);
static int uninit(priv_t *priv);
static int control(priv_t *priv, int cmd, void *arg);
static int do_control(priv_t *priv, int cmd, void *arg);
static int start(priv_t *priv);
static double grab_video_frame(priv_t *priv, char *buffer, int len);
static int get_video_framesize(priv_t *priv);
@ -37,7 +37,7 @@ static const tvi_functions_t functions =
{
init,
uninit,
control,
do_control,
start,
grab_video_frame,
get_video_framesize,

View File

@ -67,7 +67,7 @@ static int uninit(priv_t *priv)
return 1;
}
static int control(priv_t *priv, int cmd, void *arg)
static int do_control(priv_t *priv, int cmd, void *arg)
{
switch(cmd)
{

View File

@ -678,7 +678,7 @@ static void *vbi_grabber(void *data)
return NULL;
}
static int control(priv_t *priv, int cmd, void *arg)
static int do_control(priv_t *priv, int cmd, void *arg)
{
struct v4l2_control control;
struct v4l2_frequency frequency;

View File

@ -99,8 +99,8 @@ static void update_sub(struct vf_priv_s *p, double pts)
fix_band(p);
}
static void delogo(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height,
int logo_x, int logo_y, int logo_w, int logo_h, int band, int show) {
static void do_delogo(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height,
int logo_x, int logo_y, int logo_w, int logo_h, int band, int show) {
int y, x;
int interp, dist;
uint8_t *xdst, *xsrc;
@ -183,12 +183,12 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
if (vf->priv->timed_rect)
update_sub(vf->priv, dmpi->pts);
delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h,
vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show);
delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show);
delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show);
do_delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h,
vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show);
do_delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show);
do_delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2,
vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show);
if (dmpi != mpi)
talloc_free(mpi);

View File

@ -268,7 +268,7 @@ static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **
/***************************************************************************/
static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){
static void donoise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){
int8_t *noise= fp->noise;
int y;
int shift=0;
@ -324,9 +324,9 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
mp_image_copy_attributes(dmpi, mpi);
}
noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
donoise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam);
donoise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
donoise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam);
#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");

View File

@ -367,7 +367,7 @@ void gl_video_set_debug(struct gl_video *p, bool enable)
p->gl_debug = enable;
}
static void tex_size(struct gl_video *p, int w, int h, int *texw, int *texh)
static void texture_size(struct gl_video *p, int w, int h, int *texw, int *texh)
{
if (p->opts.npot) {
*texw = w;
@ -457,7 +457,7 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h,
.vp_h = h,
};
tex_size(p, w, h, &fbo->tex_w, &fbo->tex_h);
texture_size(p, w, h, &fbo->tex_w, &fbo->tex_h);
MP_VERBOSE(p, "Create FBO: %dx%d\n", fbo->tex_w, fbo->tex_h);
@ -1243,8 +1243,8 @@ static void init_video(struct gl_video *p)
plane->w = full_w >> p->image_desc.xs[n];
plane->h = full_h >> p->image_desc.ys[n];
tex_size(p, plane->w, plane->h,
&plane->tex_w, &plane->tex_h);
texture_size(p, plane->w, plane->h,
&plane->tex_w, &plane->tex_h);
MP_VERBOSE(p, "Texture for plane %d: %dx%d\n",
n, plane->tex_w, plane->tex_h);

View File

@ -161,9 +161,9 @@ static void free_mp_sws(void *p)
// You're supposed to set your scaling parameters on the returned context.
// Free the context with talloc_free().
struct mp_sws_context *mp_sws_alloc(void *talloc_parent)
struct mp_sws_context *mp_sws_alloc(void *talloc_ctx)
{
struct mp_sws_context *ctx = talloc_ptrtype(talloc_parent, ctx);
struct mp_sws_context *ctx = talloc_ptrtype(talloc_ctx, ctx);
*ctx = (struct mp_sws_context) {
.flags = SWS_BILINEAR,
.contrast = 1 << 16, // 1.0 in 16.16 fixed point

View File

@ -47,7 +47,7 @@ struct mp_sws_context {
struct mp_sws_context *cached;
};
struct mp_sws_context *mp_sws_alloc(void *talloc_parent);
struct mp_sws_context *mp_sws_alloc(void *talloc_ctx);
int mp_sws_reinit(struct mp_sws_context *ctx);
void mp_sws_set_from_cmdline(struct mp_sws_context *ctx);
int mp_sws_scale(struct mp_sws_context *ctx, struct mp_image *dst,