[cairo-ft-font] Simplify return of the nil font face during construction.

Simply return the nil font face from the internal constructor rather
than returning NULL and repeating the same fixup in the callers.
This commit is contained in:
Chris Wilson 2008-02-29 11:12:57 +00:00
parent fd7d5d6e1d
commit d9fb4d4bc5

View file

@ -2330,7 +2330,7 @@ _cairo_ft_font_face_create (cairo_ft_unscaled_font_t *unscaled,
font_face = malloc (sizeof (cairo_ft_font_face_t));
if (!font_face) {
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
return NULL;
return (cairo_font_face_t *)&_cairo_font_face_nil;
}
font_face->unscaled = unscaled;
@ -2508,10 +2508,7 @@ cairo_ft_font_face_create_for_pattern (FcPattern *pattern)
font_face = _cairo_ft_font_face_create (unscaled, &ft_options);
_cairo_unscaled_font_destroy (&unscaled->base);
if (font_face)
return font_face;
else
return (cairo_font_face_t *)&_cairo_font_face_nil;
return font_face;
}
/**
@ -2561,10 +2558,7 @@ cairo_ft_font_face_create_for_ft_face (FT_Face face,
font_face = _cairo_ft_font_face_create (unscaled, &ft_options);
_cairo_unscaled_font_destroy (&unscaled->base);
if (font_face)
return font_face;
else
return (cairo_font_face_t *)&_cairo_font_face_nil;
return font_face;
}
/**