[cairo] [cairo-commit] 2 commits - src/cairo.c src/cairo-font-face.c src/cairo-font-options.c src/cairo-ft-font.c src/cairo-gstate.c src/cairo-scaled-font.c src/cairo-win32-font.c test/font-options.c test/.gitignore test/Makefile.am

Behdad Esfahbod behdad at behdad.org
Thu Jan 17 21:51:29 PST 2008

On Thu, 2008-01-17 at 18:02 -0500, Carl Worth wrote:
> But I'm sure Behdad won't like the .data implications. (Or
> is it free in this case given the other object already exists?)

I need to see one of two reasons for handling NULL's:

  - That this is common practice for us,

  - The particular API would be much easier to use with NULL handling.

None is true about cairo_scaled_font_create() as that API's use is
pretty much limited.

Now, lemme stress again, I definitely see this is coming from.  Checking
for NULL's so we don't crash apps is definitely a good thing, but:

  - Sometimes crashes are much much easier at finding out bugs.  Take
Alp's example.  If it didn't crash on the obscure system and simply used
NULL font options, any complications resulting from that would have been
pretty impossible to detect.

  - That's why g_return[_val]_if_fail() is SO nice.  Best of both
worlds: no crash, big warning about NULL being pass in.  Maybe that's
something we should do?

Anyway, I think we shouldn't rush this into 1.6.

> -Carl

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list