Add -Wswitch-enum compiler flag and fix all trivial warnings

This commit is contained in:
Carl Worth 2006-07-31 11:47:45 -07:00
parent d1f9bef30e
commit 43b579d757
7 changed files with 44 additions and 3 deletions

View file

@ -535,7 +535,7 @@ WARN_CFLAGS=""
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wsign-compare -Werror-implicit-function-declaration \
-Wstrict-aliasing=2 -Wpointer-arith -Wwrite-strings -Winit-self \
-Wunsafe-loop-optimizations \
-Wswitch-enum -Wunsafe-loop-optimizations \
-Wpacked -Wmissing-format-attribute -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement \
-Wnested-externs -fno-strict-aliasing -Wold-style-definition"

View file

@ -1798,6 +1798,17 @@ pixman_composite (pixman_operator_t op,
}
}
break;
case PIXMAN_OPERATOR_CLEAR:
case PIXMAN_OPERATOR_DST:
case PIXMAN_OPERATOR_OVER_REVERSE:
case PIXMAN_OPERATOR_IN:
case PIXMAN_OPERATOR_IN_REVERSE:
case PIXMAN_OPERATOR_OUT:
case PIXMAN_OPERATOR_OUT_REVERSE:
case PIXMAN_OPERATOR_ATOP:
case PIXMAN_OPERATOR_ATOP_REVERSE:
case PIXMAN_OPERATOR_XOR:
case PIXMAN_OPERATOR_SATURATE:
default:
/* For any operator not specifically handled above we default out to the general code. */
func = NULL;

View file

@ -978,6 +978,7 @@ _render_glyph_outline (FT_Face face,
switch (font_options->subpixel_order) {
case CAIRO_SUBPIXEL_ORDER_RGB:
case CAIRO_SUBPIXEL_ORDER_BGR:
case CAIRO_SUBPIXEL_ORDER_DEFAULT:
default:
matrix.xx *= 3;
hmul = 3;
@ -2204,6 +2205,9 @@ cairo_ft_font_options_substitute (const cairo_font_options_t *options,
int hint_style;
switch (options->hint_style) {
case CAIRO_HINT_STYLE_NONE:
hint_style = FC_HINT_NONE;
break;
case CAIRO_HINT_STYLE_SLIGHT:
hint_style = FC_HINT_SLIGHT;
break;
@ -2211,6 +2215,7 @@ cairo_ft_font_options_substitute (const cairo_font_options_t *options,
hint_style = FC_HINT_MEDIUM;
break;
case CAIRO_HINT_STYLE_FULL:
case CAIRO_HINT_STYLE_DEFAULT:
default:
hint_style = FC_HINT_FULL;
break;

View file

@ -639,6 +639,12 @@ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t
case CAIRO_FILTER_BILINEAR:
pixman_filter = PIXMAN_FILTER_BILINEAR;
break;
case CAIRO_FILTER_GAUSSIAN:
/* XXX: The GAUSSIAN value has no implementation in cairo
* whatsoever, so it was really a mistake to have it in the
* API. We could fix this by officially deprecating it, or
* else inventing semantics and providing an actual
* implementation for it. */
default:
pixman_filter = PIXMAN_FILTER_BEST;
}
@ -895,6 +901,9 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
mask_stride = (width + 31)/8;
mask_bpp = 1;
break;
case CAIRO_ANTIALIAS_GRAY:
case CAIRO_ANTIALIAS_SUBPIXEL:
case CAIRO_ANTIALIAS_DEFAULT:
default:
format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
mask_stride = (width + 3) & ~3;

View file

@ -75,8 +75,8 @@ _cairo_pattern_nil_for_status (cairo_status_t status)
return &cairo_pattern_nil_file_not_found.base;
case CAIRO_STATUS_READ_ERROR:
return &cairo_pattern_nil_read_error.base;
default:
case CAIRO_STATUS_NO_MEMORY:
default:
return &cairo_pattern_nil.base;
}
}

View file

@ -893,8 +893,12 @@ emit_surface_pattern (cairo_pdf_surface_t *surface,
xstep = image->width;
ystep = image->height;
break;
/* All the reset should have been analyzed away, so this case
* should be unreachable. */
case CAIRO_EXTEND_REFLECT:
case CAIRO_EXTEND_PAD:
default:
ASSERT_NOT_REACHED; /* all others should be analyzed away */
ASSERT_NOT_REACHED;
xstep = 0;
ystep = 0;
}

View file

@ -177,6 +177,8 @@ _CAIRO_FORMAT_DEPTH (cairo_format_t format)
return 1;
case CAIRO_FORMAT_A8:
return 8;
case CAIRO_FORMAT_RGB16_565:
return 16;
case CAIRO_FORMAT_RGB24:
return 24;
case CAIRO_FORMAT_ARGB32:
@ -963,6 +965,12 @@ _cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
case CAIRO_FILTER_BILINEAR:
render_filter = FilterBilinear;
break;
case CAIRO_FILTER_GAUSSIAN:
/* XXX: The GAUSSIAN value has no implementation in cairo
* whatsoever, so it was really a mistake to have it in the
* API. We could fix this by officially deprecating it, or
* else inventing semantics and providing an actual
* implementation for it. */
default:
render_filter = FilterBest;
break;
@ -1372,6 +1380,7 @@ _cairo_xlib_surface_composite (cairo_operator_t op,
dst_x, dst_y, width, height);
break;
case DO_UNSUPPORTED:
default:
ASSERT_NOT_REACHED;
}
@ -1561,6 +1570,9 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t op,
case CAIRO_ANTIALIAS_NONE:
pict_format = XRenderFindStandardFormat (dst->dpy, PictStandardA1);
break;
case CAIRO_ANTIALIAS_GRAY:
case CAIRO_ANTIALIAS_SUBPIXEL:
case CAIRO_ANTIALIAS_DEFAULT:
default:
pict_format = XRenderFindStandardFormat (dst->dpy, PictStandardA8);
break;