summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-07-31 11:47:45 -0700
committerCarl Worth <cworth@cworth.org>2006-08-07 14:30:06 -0700
commit43b579d757ded66f71da8a0e215abd7bccdfd695 (patch)
treeeae4d88ae0baf2d79123e213bb524f6f17256d9e
parentd1f9bef30ea7268fee74af50c0e9325e1ec0929c (diff)
Add -Wswitch-enum compiler flag and fix all trivial warnings
-rw-r--r--configure.in2
-rw-r--r--pixman/src/fbpict.c11
-rw-r--r--src/cairo-ft-font.c5
-rw-r--r--src/cairo-image-surface.c9
-rw-r--r--src/cairo-pattern.c2
-rw-r--r--src/cairo-pdf-surface.c6
-rw-r--r--src/cairo-xlib-surface.c12
7 files changed, 44 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 9be858cf5..6558a3ddb 100644
--- a/configure.in
+++ b/configure.in
@@ -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"
diff --git a/pixman/src/fbpict.c b/pixman/src/fbpict.c
index 0d547d9fd..07c293a29 100644
--- a/pixman/src/fbpict.c
+++ b/pixman/src/fbpict.c
@@ -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;
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 18aa68ced..6cc54bf31 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -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;
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 8aca7bce1..64c5cfe7b 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -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;
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 463c0e816..14adfd19f 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -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;
}
}
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index ea436e6e0..e7a87e4b6 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -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;
}
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 24c66a085..b9500bfc1 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -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;