[cairo] Deprecating CAIRO_FORMAT_RGB16_565 and adding cairo-deprecated.h

Carl Worth cworth at cworth.org
Mon Sep 11 10:24:58 PDT 2006

On Sun, 10 Sep 2006 12:26:14 +0200, Torsten Schoenfeld wrote:
> On Sat, 2006-09-09 at 15:41 -0700, Carl Worth wrote:
> > The patch below implements this (also available in the
> > rgb16-deprecated branch of my personal tree). Please provide any
> > feedback you might have.
> The patch removes CAIRO_FORMAT_RGB16_565 from cairo_format_t and adds a
> define hard-coding it to be 4.  Wouldn't this cause problems when later
> a new entry is added to cairo_format_t?  This new entry would also
> evaluate to 4 and functions that use cairo_format_t would have no way of
> differentiating between the new format and CAIRO_FORMAT_RGB16_565.

The idea I had was to simply avoid the value of 4 when adding the next
value, (explicitly giving it a value of 5). But, yes, as mentioned
elsewhere, we should have a comment in cairo.h to help us remember
that. So I'll do something like the following:

	typedef enum _cairo_format {
	    /* The value of 4 is reserved by a deprecated enum value.
	     * The next format added must have an explicit value of 5. */
	      CAIRO_FORMAT_RGB16_565 = 4,
	} cairo_format_t;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060911/88868ad9/attachment.pgp

More information about the cairo mailing list