[cairo-commit] src/cairo-cff-subset.c src/cairo-clip.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Nov 29 03:48:37 PST 2008
src/cairo-cff-subset.c | 4 ++--
src/cairo-clip.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 7247017cf5e6b497a5836d9081ee153d27c6b15e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Nov 29 11:47:25 2008 +0000
Fix up a couple of likely(malloc==NULL)
Adrian Johnson spotted that I marked a few malloc failures as likely,
whoops.
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index d1e5a6d..75e1ab5 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -2233,7 +2233,7 @@ _cairo_cff_fallback_init (cairo_cff_subset_t *cff_subset,
}
cff_subset->widths = calloc (sizeof (int), font->scaled_font_subset->num_glyphs);
- if (likely (cff_subset->widths == NULL)) {
+ if (unlikely (cff_subset->widths == NULL)) {
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto fail3;
}
@@ -2248,7 +2248,7 @@ _cairo_cff_fallback_init (cairo_cff_subset_t *cff_subset,
cff_subset->descent = type2_subset.y_min;
cff_subset->data = malloc (length);
- if (likely (cff_subset->data == NULL)) {
+ if (unlikely (cff_subset->data == NULL)) {
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto fail4;
}
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 35082f9..4303b60 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -298,7 +298,7 @@ _cairo_clip_intersect_path (cairo_clip_t *clip,
return CAIRO_INT_STATUS_UNSUPPORTED;
clip_path = malloc (sizeof (cairo_clip_path_t));
- if (likely (clip_path == NULL))
+ if (unlikely (clip_path == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
status = _cairo_path_fixed_init_copy (&clip_path->path, path);
More information about the cairo-commit
mailing list