diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-08-16 14:20:35 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-08-29 08:08:39 +0100 |
commit | 8d1bf830c0137eac837091bda92a636c0fcb0456 (patch) | |
tree | 2ecde17e863ad39bb7a010007c5af1046b470c26 /src/cairo-xlib-surface.c | |
parent | d8dbce021a4493330864154e67ca6e4a1f2f50b2 (diff) |
Fix errors found by clang
Shadowed variables, unused writes and some dead code.
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r-- | src/cairo-xlib-surface.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 62a12560..cf3bdfef 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -822,7 +822,7 @@ _get_image_surface (cairo_xlib_surface_t *surface, int a_width=0, r_width=0, g_width=0, b_width=0; int a_shift=0, r_shift=0, g_shift=0, b_shift=0; int x, y, x0, y0, x_off, y_off; - cairo_xlib_visual_info_t *visual_info; + cairo_xlib_visual_info_t *visual_info = NULL; if (surface->visual == NULL || surface->visual->class == TrueColor) { cairo_bool_t has_alpha; @@ -888,7 +888,7 @@ _get_image_surface (cairo_xlib_surface_t *surface, int dither_adjustment = dither_row[x_off]; in_pixel = XGetPixel (ximage, x, y); - if (surface->visual == NULL || surface->visual->class == TrueColor) { + if (visual_info == NULL) { out_pixel = ( _field_to_8 (in_pixel & a_mask, a_width, a_shift) << 24 | _field_to_8_undither (in_pixel & r_mask, r_width, r_shift, dither_adjustment) << 16 | @@ -4141,7 +4141,6 @@ _emit_glyphs_chunk (cairo_xlib_surface_t *dst, if (n) { elts[nelt].nchars = n; nelt++; - n = 0; } /* Check that we agree with _cairo_xlib_surface_emit_glyphs() on the |