From 4f880deeabc36842b3b4b0d7ad16383db708cd42 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 1 Sep 2009 14:24:59 +0100 Subject: Compiler warnings Add an impossible default condition to avoid a compiler warning. And tweak the code to avoid mismatching signed/unsigned comparisons. --- src/cairo-pdf-surface.c | 1 + src/cairo-xml-surface.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 6fa61334..76016872 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1099,6 +1099,7 @@ _cairo_pdf_surface_add_source_surface (cairo_pdf_surface_t *surface, cairo_bool_t interpolate; switch (filter) { + default: case CAIRO_FILTER_GOOD: case CAIRO_FILTER_BEST: case CAIRO_FILTER_BILINEAR: diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c index ec4d3fda..61e8f61a 100644 --- a/src/cairo-xml-surface.c +++ b/src/cairo-xml-surface.c @@ -266,7 +266,7 @@ _cairo_xml_printf (cairo_xml_t *xml, const char *fmt, ...) char indent[80]; int len; - len = MIN (xml->indent, sizeof (indent)); + len = MIN (xml->indent, ARRAY_LENGTH (indent)); memset (indent, ' ', len); _cairo_output_stream_write (xml->stream, indent, len); @@ -283,7 +283,7 @@ _cairo_xml_printf_start (cairo_xml_t *xml, const char *fmt, ...) char indent[80]; int len; - len = MIN (xml->indent, sizeof (indent)); + len = MIN (xml->indent, ARRAY_LENGTH (indent)); memset (indent, ' ', len); _cairo_output_stream_write (xml->stream, indent, len); @@ -535,7 +535,7 @@ static void _cairo_xml_emit_gradient (cairo_xml_t *xml, const cairo_gradient_pattern_t *gradient) { - int i; + unsigned int i; for (i = 0; i < gradient->n_stops; i++) { _cairo_xml_printf (xml, @@ -784,7 +784,7 @@ _cairo_xml_surface_stroke (void *abstract_surface, return status; if (style->num_dashes) { - int i; + unsigned int i; _cairo_xml_printf_start (xml, "", style->dash_offset); -- cgit v1.2.3