summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-23 00:45:23 +0200
committerwm4 <wm4@nowhere>2013-07-23 00:45:23 +0200
commite83cbde1a4b816a64cefde1fb8bdbac403079600 (patch)
tree1ac71b13723174ab48465915fd5e9916faa7df35 /video/out
parent78ebb3c6fa637206bb369349ba93328b36895e2b (diff)
downloadmpv-e83cbde1a4b816a64cefde1fb8bdbac403079600.tar.bz2
mpv-e83cbde1a4b816a64cefde1fb8bdbac403079600.tar.xz
Fix some -Wshadow warnings
In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gl_lcms.c4
-rw-r--r--video/out/gl_video.c10
-rw-r--r--video/out/vo_opengl_old.c4
-rw-r--r--video/out/vo_sdl.c4
-rw-r--r--video/out/vo_vdpau.c3
5 files changed, 12 insertions, 13 deletions
diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c
index f7e418f1d1..fdab119fb1 100644
--- a/video/out/gl_lcms.c
+++ b/video/out/gl_lcms.c
@@ -39,9 +39,9 @@
#include <lcms2.h>
-static bool parse_3dlut_size(const char *s, int *p1, int *p2, int *p3)
+static bool parse_3dlut_size(const char *arg, int *p1, int *p2, int *p3)
{
- if (sscanf(s, "%dx%dx%d", p1, p2, p3) != 3)
+ if (sscanf(arg, "%dx%dx%d", p1, p2, p3) != 3)
return false;
for (int n = 0; n < 3; n++) {
int s = ((int[]) { *p1, *p2, *p3 })[n];
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 98862b92e7..bb99d769b4 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1592,7 +1592,7 @@ static void draw_osd_cb(void *ctx, struct mpgl_osd_part *osd,
for (int n = 0; n < osd->packer->count; n++) {
struct sub_bitmap *b = &imgs->parts[n];
- struct pos p = osd->packer->result[n];
+ struct pos pos = osd->packer->result[n];
// NOTE: the blend color is used with SUBBITMAP_LIBASS only, so it
// doesn't matter that we upload garbage for the other formats
@@ -1602,7 +1602,7 @@ static void draw_osd_cb(void *ctx, struct mpgl_osd_part *osd,
write_quad(&va[osd->num_vertices],
b->x, b->y, b->x + b->dw, b->y + b->dh,
- p.x, p.y, p.x + b->w, p.y + b->h,
+ pos.x, pos.y, pos.x + b->w, pos.y + b->h,
osd->w, osd->h, color, false);
osd->num_vertices += VERTICES_PER_QUAD;
}
@@ -1657,12 +1657,12 @@ static bool test_fbo(struct gl_video *p, GLenum format)
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo.fbo);
gl->ReadBuffer(GL_COLOR_ATTACHMENT0);
for (int i = 0; i < 4; i++) {
- float p = -1;
+ float pixel = -1;
float val = vals[i];
gl->ClearColor(val, 0.0f, 0.0f, 1.0f);
gl->Clear(GL_COLOR_BUFFER_BIT);
- gl->ReadPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &p);
- mp_msg(MSGT_VO, MSGL_V, " %s: %a\n", val_names[i], val - p);
+ gl->ReadPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &pixel);
+ mp_msg(MSGT_VO, MSGL_V, " %s: %a\n", val_names[i], val - pixel);
}
gl->BindFramebuffer(GL_FRAMEBUFFER, 0);
glCheckError(gl, "after FBO read");
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c
index 2caf0c3f28..1e8fba6495 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -1832,8 +1832,8 @@ static bool get_image(struct vo *vo, mp_image_t *mpi, int *th, bool *cplane)
height = p->texture_height;
}
int avgbpp16 = 0;
- for (int p = 0; p < 4; p++)
- avgbpp16 += (16 * mpi->fmt.bpp[p]) >> mpi->fmt.xs[p] >> mpi->fmt.ys[p];
+ for (int pl = 0; pl < 4; pl++)
+ avgbpp16 += (16 * mpi->fmt.bpp[pl]) >> mpi->fmt.xs[pl] >> mpi->fmt.ys[pl];
int avgbpp = avgbpp16 / 16;
mpi->stride[0] = width * avgbpp / 8;
needed_size = mpi->stride[0] * height;
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index c5ecc2be8c..6b8b393984 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -721,11 +721,11 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
{
struct priv *vc = vo->priv;
- static const bool formats[SUBBITMAP_COUNT] = {
+ static const bool osdformats[SUBBITMAP_COUNT] = {
[SUBBITMAP_RGBA] = true,
};
- osd_draw(osd, vc->osd_res, osd->vo_pts, 0, formats, draw_osd_cb, vo);
+ osd_draw(osd, vc->osd_res, osd->vo_pts, 0, osdformats, draw_osd_cb, vo);
}
static int preinit(struct vo *vo)
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 85ad4ecf80..6f1483cdd9 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1390,7 +1390,6 @@ static void destroy_vdpau_objects(struct vo *vo)
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
- int i;
VdpStatus vdp_st;
free_video_specific(vo);
@@ -1406,7 +1405,7 @@ static void destroy_vdpau_objects(struct vo *vo)
"vdp_presentation_queue_target_destroy");
}
- for (i = 0; i < vc->num_output_surfaces; i++) {
+ for (int i = 0; i < vc->num_output_surfaces; i++) {
if (vc->output_surfaces[i] == VDP_INVALID_HANDLE)
continue;
vdp_st = vdp->output_surface_destroy(vc->output_surfaces[i]);