[cairo] [PATCH 1/8] Fix warnings about unhandled cases

Behdad Esfahbod behdad at behdad.org
Sun Aug 13 01:37:46 PDT 2006


On Sun, 2006-08-13 at 01:57 -0400, Pavel Roskin wrote:
> From: Pavel Roskin <proski at gnu.org>

Thanks for the patches Pavel.  I'll be committing the trivial ones and
reply to the others.

> It's a good idea to write all valid cases explicitly.  Even though
> CAIRO_FORMAT_RGB16_565 is obsolete, it's still present in the headers.

Carl and I intentionally left them producing warnings to deal with them
in the correct way later.  We probably will remove RBG16_565 from the
enum completely and define it as a deprecated macro.  So, this one
should wait for now.

behdad

> Signed-off-by: Pavel Roskin <proski at gnu.org>
> ---
> 
>  src/cairo-png.c          |    1 +
>  src/cairo-xlib-surface.c |    2 ++
>  2 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/src/cairo-png.c b/src/cairo-png.c
> index 63966b5..807bd2f 100644
> --- a/src/cairo-png.c
> +++ b/src/cairo-png.c
> @@ -153,6 +153,7 @@ write_png (cairo_surface_t	*surface,
>  	depth = 1;
>  	png_color_type = PNG_COLOR_TYPE_GRAY;
>  	break;
> +    case CAIRO_FORMAT_RGB16_565:
>      default:
>  	status = CAIRO_STATUS_NULL_POINTER;
>  	goto BAIL3;
> diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
> index 4ed29b7..ef23d4a 100644
> --- a/src/cairo-xlib-surface.c
> +++ b/src/cairo-xlib-surface.c
> @@ -199,6 +199,7 @@ _CAIRO_FORMAT_TO_XRENDER_FORMAT(Display 
>      case CAIRO_FORMAT_RGB24:
>  	pict_format = PictStandardRGB24; break;
>      case CAIRO_FORMAT_ARGB32:
> +    case CAIRO_FORMAT_RGB16_565:
>      default:
>  	pict_format = PictStandardARGB32; break;
>      }
> @@ -2463,6 +2464,7 @@ _cairo_xlib_surface_add_glyph (Display *
>  	}
>  	break;
>      case CAIRO_FORMAT_RGB24:
> +    case CAIRO_FORMAT_RGB16_565:
>      default:
>  	ASSERT_NOT_REACHED;
>  	break;
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list