diff options
author | Andrea Canciani <ranma42@gmail.com> | 2010-06-24 15:15:37 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2010-06-28 16:55:57 +0200 |
commit | 9068b5768b8560fbf095f1c0eecb5c805232f794 (patch) | |
tree | 39a0fdaf8e55104fb47afb7348057f4f8dfbf348 /src/cairo-quartz-font.c | |
parent | ca161a585a7ce09cfcd468ea7591c5959077a907 (diff) | |
download | cairo-9068b5768b8560fbf095f1c0eecb5c805232f794.tar.gz |
quartz-font: silence compiler warnings
Remove an unused function, explicitly ignore or check return values,
don't define unused variables.
Diffstat (limited to 'src/cairo-quartz-font.c')
-rw-r--r-- | src/cairo-quartz-font.c | 84 |
1 files changed, 30 insertions, 54 deletions
diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c index 2147cd3f6..17b6ba19a 100644 --- a/src/cairo-quartz-font.c +++ b/src/cairo-quartz-font.c @@ -333,7 +333,8 @@ cairo_quartz_font_face_create_for_cgfont (CGFontRef font) font_face = malloc (sizeof (cairo_quartz_font_face_t)); if (!font_face) { - _cairo_error (CAIRO_STATUS_NO_MEMORY); + cairo_status_t ignore_status; + ignore_status = _cairo_error (CAIRO_STATUS_NO_MEMORY); return (cairo_font_face_t *)&_cairo_font_face_nil; } @@ -372,36 +373,6 @@ _cairo_quartz_scaled_glyph_index (cairo_scaled_glyph_t *scaled_glyph) { return (CGGlyph) index; } -static inline cairo_status_t -_cairo_matrix_to_unit_quartz_matrix (const cairo_matrix_t *m, CGAffineTransform *txout, - double *xout, double *yout) -{ - CGAffineTransform transform; - double xscale, yscale; - cairo_status_t status; - - status = _cairo_matrix_compute_basis_scale_factors (m, &xscale, &yscale, 1); - if (status) - return status; - - transform = CGAffineTransformMake (m->xx, - m->yx, - - m->xy, m->yy, - 0.0f, 0.0f); - if (xout) - *xout = xscale; - if (yout) - *yout = yscale; - - if (xscale) - xscale = 1.0 / xscale; - if (yscale) - yscale = 1.0 / yscale; - - *txout = CGAffineTransformScale (transform, xscale, yscale); - - return CAIRO_STATUS_SUCCESS; -} - static cairo_int_status_t _cairo_quartz_init_glyph_metrics (cairo_quartz_scaled_font_t *font, cairo_scaled_glyph_t *scaled_glyph) @@ -410,7 +381,6 @@ _cairo_quartz_init_glyph_metrics (cairo_quartz_scaled_font_t *font, cairo_quartz_font_face_t *font_face = _cairo_quartz_scaled_to_face(font); cairo_text_extents_t extents = {0, 0, 0, 0, 0, 0}; - CGAffineTransform textMatrix; CGGlyph glyph = _cairo_quartz_scaled_glyph_index (scaled_glyph); int advance; CGRect bbox; @@ -497,17 +467,20 @@ static void _cairo_quartz_path_apply_func (void *info, const CGPathElement *el) { cairo_path_fixed_t *path = (cairo_path_fixed_t *) info; + cairo_status_t status; switch (el->type) { case kCGPathElementMoveToPoint: - _cairo_path_fixed_move_to (path, - _cairo_fixed_from_double(el->points[0].x), - _cairo_fixed_from_double(el->points[0].y)); + status = _cairo_path_fixed_move_to (path, + _cairo_fixed_from_double(el->points[0].x), + _cairo_fixed_from_double(el->points[0].y)); + assert(!status); break; case kCGPathElementAddLineToPoint: - _cairo_path_fixed_line_to (path, - _cairo_fixed_from_double(el->points[0].x), - _cairo_fixed_from_double(el->points[0].y)); + status = _cairo_path_fixed_line_to (path, + _cairo_fixed_from_double(el->points[0].x), + _cairo_fixed_from_double(el->points[0].y)); + assert(!status); break; case kCGPathElementAddQuadCurveToPoint: { cairo_fixed_t fx, fy; @@ -517,26 +490,29 @@ _cairo_quartz_path_apply_func (void *info, const CGPathElement *el) x = _cairo_fixed_to_double (fx); y = _cairo_fixed_to_double (fy); - _cairo_path_fixed_curve_to (path, - _cairo_fixed_from_double((x + el->points[0].x * 2.0) / 3.0), - _cairo_fixed_from_double((y + el->points[0].y * 2.0) / 3.0), - _cairo_fixed_from_double((el->points[0].x * 2.0 + el->points[1].x) / 3.0), - _cairo_fixed_from_double((el->points[0].y * 2.0 + el->points[1].y) / 3.0), - _cairo_fixed_from_double(el->points[1].x), - _cairo_fixed_from_double(el->points[1].y)); + status = _cairo_path_fixed_curve_to (path, + _cairo_fixed_from_double((x + el->points[0].x * 2.0) / 3.0), + _cairo_fixed_from_double((y + el->points[0].y * 2.0) / 3.0), + _cairo_fixed_from_double((el->points[0].x * 2.0 + el->points[1].x) / 3.0), + _cairo_fixed_from_double((el->points[0].y * 2.0 + el->points[1].y) / 3.0), + _cairo_fixed_from_double(el->points[1].x), + _cairo_fixed_from_double(el->points[1].y)); } + assert(!status); break; case kCGPathElementAddCurveToPoint: - _cairo_path_fixed_curve_to (path, - _cairo_fixed_from_double(el->points[0].x), - _cairo_fixed_from_double(el->points[0].y), - _cairo_fixed_from_double(el->points[1].x), - _cairo_fixed_from_double(el->points[1].y), - _cairo_fixed_from_double(el->points[2].x), - _cairo_fixed_from_double(el->points[2].y)); + status = _cairo_path_fixed_curve_to (path, + _cairo_fixed_from_double(el->points[0].x), + _cairo_fixed_from_double(el->points[0].y), + _cairo_fixed_from_double(el->points[1].x), + _cairo_fixed_from_double(el->points[1].y), + _cairo_fixed_from_double(el->points[2].x), + _cairo_fixed_from_double(el->points[2].y)); + assert(!status); break; case kCGPathElementCloseSubpath: - _cairo_path_fixed_close_path (path); + status = _cairo_path_fixed_close_path (path); + assert(!status); break; } } @@ -683,7 +659,7 @@ _cairo_quartz_init_glyph_surface (cairo_quartz_scaled_font_t *font, kCGImageAlphaOnly); if (cgContext == NULL) { - cairo_surface_destroy (surface); + cairo_surface_destroy (&surface->base); return _cairo_error (CAIRO_STATUS_NO_MEMORY); } |