summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-16 19:35:35 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-17 21:26:34 +0000
commit1684ed6a5e8c26ecb48cc1a5025107466526fe94 (patch)
tree92b493a6614d840b8bcaa1e0c03c0358eba563e1
parent300586b229ae941ac31850af00d120d8c441c583 (diff)
sna: Clean up compiler warnings for shadowed variables
No outright bug, just plenty of unwanted noise. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c40
-rw-r--r--src/sna/sna_glyphs.c3
-rw-r--r--src/sna/sna_trapezoids.c26
3 files changed, 35 insertions, 34 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index da61d012..8957a668 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -841,11 +841,11 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, BoxPtr box)
region_set(&r, box);
if (sna_damage_intersect(priv->cpu_damage, &r, &i)) {
- BoxPtr box = REGION_RECTS(&i);
int n = REGION_NUM_RECTS(&i);
struct kgem_bo *src_bo;
Bool ok = FALSE;
+ box = REGION_RECTS(&i);
src_bo = pixmap_vmap(&sna->kgem, pixmap);
if (src_bo)
ok = sna->render.copy_boxes(sna, GXcopy,
@@ -1774,10 +1774,10 @@ sna_put_xypixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
src = (uint8_t*)bits + (box->y1 - y) * src_stride + bx1/8;
src_stride -= bw;
do {
- int i = bw;
+ int j = bw;
do {
*dst++ = byte_reverse(*src++);
- } while (--i);
+ } while (--j);
dst += bstride;
src += src_stride;
} while (--bh);
@@ -6270,13 +6270,15 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
w, h,
dst_x + dx, dst_y + dy);
if (damage) {
- BoxRec box;
- box.x1 = dst_x + dx;
- box.y1 = dst_y + dy;
- box.x2 = box.x1 + w;
- box.y2 = box.y1 + h;
- assert_pixmap_contains_box(pixmap, &box);
- sna_damage_add_box(damage, &box);
+ BoxRec b;
+
+ b.x1 = dst_x + dx;
+ b.y1 = dst_y + dy;
+ b.x2 = b.x1 + w;
+ b.y2 = b.y1 + h;
+
+ assert_pixmap_contains_box(pixmap, &b);
+ sna_damage_add_box(damage, &b);
}
dst_x += w;
@@ -6328,15 +6330,15 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
w, h,
dst_x + dx, dst_y + dy);
if (damage) {
- BoxRec box;
+ BoxRec b;
- box.x1 = dst_x + dx;
- box.y1 = dst_y + dy;
- box.x2 = box.x1 + w;
- box.y2 = box.y1 + h;
+ b.x1 = dst_x + dx;
+ b.y1 = dst_y + dy;
+ b.x2 = b.x1 + w;
+ b.y2 = b.y1 + h;
- assert_pixmap_contains_box(pixmap, &box);
- sna_damage_add_box(damage, &box);
+ assert_pixmap_contains_box(pixmap, &b);
+ sna_damage_add_box(damage, &b);
}
dst_x += w;
@@ -6401,11 +6403,11 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
uint8_t *dst = (uint8_t *)pat;
const uint8_t *src = gc->stipple->devPrivate.ptr;
int stride = gc->stipple->devKind;
- int n = gc->stipple->drawable.height;
+ int j = gc->stipple->drawable.height;
do {
*dst++ = byte_reverse(*src);
src += stride;
- } while (--n);
+ } while (--j);
}
kgem_set_mode(&sna->kgem, KGEM_BLT);
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index e065c6a2..82d091a9 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1093,7 +1093,6 @@ glyphs_fallback(CARD8 op,
GlyphPtr g = *glyphs++;
PicturePtr picture;
pixman_image_t *glyph_image;
- int dx, dy;
if (g->info.width == 0 || g->info.height == 0)
goto next_glyph;
@@ -1109,7 +1108,7 @@ glyphs_fallback(CARD8 op,
if (mask_format) {
DBG(("%s: glyph+(%d,%d) to mask (%d, %d)x(%d, %d)\n",
__FUNCTION__,
- dx,dy,
+ dx, dy,
x - g->info.x,
y - g->info.y,
g->info.width,
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 8899f388..27987d87 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -2095,7 +2095,7 @@ free_boxes:
return ret;
}
-static inline int coverage(int samples, pixman_fixed_t f)
+static inline int grid_coverage(int samples, pixman_fixed_t f)
{
return (samples * pixman_fixed_frac(f) + pixman_fixed_1/2) / pixman_fixed_1;
}
@@ -2155,7 +2155,7 @@ composite_unaligned_trap_row(struct sna *sna,
box.x2 = x2 + 1;
opacity = covered;
- opacity *= coverage(SAMPLES_X, trap->right.p1.x) - coverage(SAMPLES_X, trap->left.p1.x);
+ opacity *= grid_coverage(SAMPLES_X, trap->right.p1.x) - grid_coverage(SAMPLES_X, trap->left.p1.x);
if (opacity)
composite_unaligned_box(sna, tmp, &box,
@@ -2166,7 +2166,7 @@ composite_unaligned_trap_row(struct sna *sna,
box.x2 = x1++;
opacity = covered;
- opacity *= SAMPLES_X - coverage(SAMPLES_X, trap->left.p1.x);
+ opacity *= SAMPLES_X - grid_coverage(SAMPLES_X, trap->left.p1.x);
if (opacity)
composite_unaligned_box(sna, tmp, &box,
@@ -2186,7 +2186,7 @@ composite_unaligned_trap_row(struct sna *sna,
box.x2 = x2 + 1;
opacity = covered;
- opacity *= coverage(SAMPLES_X, trap->right.p1.x);
+ opacity *= grid_coverage(SAMPLES_X, trap->right.p1.x);
if (opacity)
composite_unaligned_box(sna, tmp, &box,
@@ -2210,13 +2210,13 @@ composite_unaligned_trap(struct sna *sna,
if (y1 == y2) {
composite_unaligned_trap_row(sna, tmp, trap, dx,
y1, y1 + 1,
- coverage(SAMPLES_Y, trap->bottom) - coverage(SAMPLES_Y, trap->top),
+ grid_coverage(SAMPLES_Y, trap->bottom) - grid_coverage(SAMPLES_Y, trap->top),
clip);
} else {
if (pixman_fixed_frac(trap->top)) {
composite_unaligned_trap_row(sna, tmp, trap, dx,
y1, y1 + 1,
- SAMPLES_Y - coverage(SAMPLES_Y, trap->top),
+ SAMPLES_Y - grid_coverage(SAMPLES_Y, trap->top),
clip);
y1++;
}
@@ -2230,7 +2230,7 @@ composite_unaligned_trap(struct sna *sna,
if (pixman_fixed_frac(trap->bottom))
composite_unaligned_trap_row(sna, tmp, trap, dx,
y2, y2 + 1,
- coverage(SAMPLES_Y, trap->bottom),
+ grid_coverage(SAMPLES_Y, trap->bottom),
clip);
}
}
@@ -2295,13 +2295,13 @@ blt_unaligned_box_row(PixmapPtr scratch,
blt_opacity(scratch,
x1, x1+1,
y1, y2,
- covered * (coverage(SAMPLES_X, trap->right.p1.x) - coverage(SAMPLES_X, trap->left.p1.x)));
+ covered * (grid_coverage(SAMPLES_X, trap->right.p1.x) - grid_coverage(SAMPLES_X, trap->left.p1.x)));
} else {
if (pixman_fixed_frac(trap->left.p1.x))
blt_opacity(scratch,
x1, x1+1,
y1, y2,
- covered * (SAMPLES_X - coverage(SAMPLES_X, trap->left.p1.x)));
+ covered * (SAMPLES_X - grid_coverage(SAMPLES_X, trap->left.p1.x)));
if (x2 > x1 + 1) {
blt_opacity(scratch,
@@ -2314,7 +2314,7 @@ blt_unaligned_box_row(PixmapPtr scratch,
blt_opacity(scratch,
x2, x2 + 1,
y1, y2,
- covered * coverage(SAMPLES_X, trap->right.p1.x));
+ covered * grid_coverage(SAMPLES_X, trap->right.p1.x));
}
}
@@ -2374,11 +2374,11 @@ composite_unaligned_boxes_fallback(CARD8 op,
if (y1 == y2) {
blt_unaligned_box_row(scratch, &extents, t, y1, y1 + 1,
- coverage(SAMPLES_Y, t->bottom) - coverage(SAMPLES_Y, t->top));
+ grid_coverage(SAMPLES_Y, t->bottom) - grid_coverage(SAMPLES_Y, t->top));
} else {
if (pixman_fixed_frac(t->top))
blt_unaligned_box_row(scratch, &extents, t, y1, y1 + 1,
- SAMPLES_Y - coverage(SAMPLES_Y, t->top));
+ SAMPLES_Y - grid_coverage(SAMPLES_Y, t->top));
if (y2 > y1 + 1)
blt_unaligned_box_row(scratch, &extents, t, y1+1, y2,
@@ -2386,7 +2386,7 @@ composite_unaligned_boxes_fallback(CARD8 op,
if (pixman_fixed_frac(t->bottom))
blt_unaligned_box_row(scratch, &extents, t, y2, y2+1,
- coverage(SAMPLES_Y, t->bottom));
+ grid_coverage(SAMPLES_Y, t->bottom));
}
mask = CreatePicture(0, &scratch->drawable,