[cairo] Assertion failed in sample code

Nis Martensen nis.martensen at web.de
Sat Feb 26 00:57:00 PST 2011


Hi,
The code used to generate the samples on the operator page,
http://cgit.freedesktop.org/cairo-www/tree/src/operators/ops.c
does not work any more, but hits an assertion.

The commit that caused this even starts with "bad":

commit badf32290ff894351e0f6879aafeac6db8e0d846
Author: Benjamin Otte <otte at redhat.com>
Date:   Fri Feb 18 18:23:25 2011 +0100

    surface: Don't be nice to people setting internal error codes

    Just DIE DIE DIE in the _cairo_status_set_status() assertion.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index b9d9e16..4c6dc76 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -169,12 +169,6 @@ cairo_status_t
 _cairo_surface_set_error (cairo_surface_t *surface,
                          cairo_status_t status)
 {
-    if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
-       status = CAIRO_STATUS_SUCCESS;
-
-    if (status == CAIRO_STATUS_SUCCESS || status >=
CAIRO_INT_STATUS_UNSUPPORTED)
-       return status;
-
     /* Don't overwrite an existing error. This preserves the first
      * error, which is the most significant. */
     _cairo_status_set_error (&surface->status, status);


More information about the cairo mailing list