diff --git a/src/cairo-array.c b/src/cairo-array.c index 218f511..9d07f56 100644 --- a/src/cairo-array.c +++ b/src/cairo-array.c @@ -203,7 +203,7 @@ _cairo_array_index (cairo_array_t *array if (index == 0 && array->num_elements == 0) return NULL; - assert (0 <= index && index < array->num_elements); + assert (index < array->num_elements); return (void *) &(*array->elements)[index * array->element_size]; } diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index eddf715..141e06c 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -603,7 +603,6 @@ _cairo_ft_unscaled_font_set_scale (cairo { cairo_ft_font_transform_t sf; FT_Matrix mat; - FT_UInt pixel_width, pixel_height; FT_Error error; assert (unscaled->face != NULL); @@ -642,8 +641,6 @@ _cairo_ft_unscaled_font_set_scale (cairo FT_Set_Transform(unscaled->face, &mat, NULL); if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) { - pixel_width = sf.x_scale; - pixel_height = sf.y_scale; error = FT_Set_Char_Size (unscaled->face, sf.x_scale * 64.0, sf.y_scale * 64.0, @@ -653,8 +650,6 @@ _cairo_ft_unscaled_font_set_scale (cairo int i; int best_i = 0; - pixel_width = pixel_height = 0; - for (i = 0; i < unscaled->face->num_fixed_sizes; i++) { #if HAVE_FT_BITMAP_SIZE_Y_PPEM double size = unscaled->face->available_sizes[i].y_ppem / 64.; @@ -925,7 +920,6 @@ _render_glyph_outline (FT_Face int hmul = 1; int vmul = 1; unsigned int width, height, stride; - cairo_bool_t subpixel = FALSE; cairo_status_t status; FT_Outline_Get_CBox (outline, &cbox); @@ -985,13 +979,11 @@ _render_glyph_outline (FT_Face default: matrix.xx *= 3; hmul = 3; - subpixel = TRUE; break; case CAIRO_SUBPIXEL_ORDER_VRGB: case CAIRO_SUBPIXEL_ORDER_VBGR: matrix.yy *= 3; vmul = 3; - subpixel = TRUE; break; } FT_Outline_Transform (outline, &matrix); diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 91a1968..60cef2c 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1847,7 +1847,7 @@ _cairo_pdf_surface_emit_bitmap_glyph (ca cairo_status_t status; cairo_image_surface_t *image; unsigned char *row, *byte; - int rows, cols, bytes_per_row; + int rows, cols; status = _cairo_scaled_glyph_lookup (scaled_font, glyph_index, @@ -1892,7 +1892,6 @@ _cairo_pdf_surface_emit_bitmap_glyph (ca _cairo_output_stream_printf (surface->output, "ID "); - bytes_per_row = (image->width + 7) / 8; for (row = image->data, rows = image->height; rows; row += image->stride, rows--) { for (byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) { unsigned char output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte); diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 6ae3a38..5371f08 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -538,7 +538,7 @@ _cairo_ps_surface_emit_bitmap_glyph_data cairo_status_t status; cairo_image_surface_t *image; unsigned char *row, *byte; - int rows, cols, bytes_per_row; + int rows, cols; status = _cairo_scaled_glyph_lookup (scaled_font, glyph_index, @@ -579,7 +579,6 @@ _cairo_ps_surface_emit_bitmap_glyph_data _cairo_output_stream_printf (surface->final_stream, " /DataSource {<"); - bytes_per_row = (image->width + 7) / 8; for (row = image->data, rows = image->height; rows; row += image->stride, rows--) { for (byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) { unsigned char output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte); diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index abc1ec3..aef5b71 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -561,7 +561,7 @@ _cairo_svg_document_emit_bitmap_glyph_da cairo_scaled_glyph_t *scaled_glyph; cairo_status_t status; unsigned char *row, *byte; - int rows, cols, bytes_per_row; + int rows, cols; int x, y, bit; status = _cairo_scaled_glyph_lookup (scaled_font, @@ -582,7 +582,6 @@ _cairo_svg_document_emit_bitmap_glyph_da _cairo_output_stream_printf (document->xml_node_glyphs, "xml_node_glyphs, " transform", ">/n", &image->base.device_transform); - bytes_per_row = (image->width + 7) / 8; for (y = 0, row = image->data, rows = image->height; rows; row += image->stride, rows--, y++) { for (x = 0, byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) { unsigned char output_byte = CAIRO_BITSWAP8_IF_LITTLE_ENDIAN (*byte); diff --git a/src/cairo-wideint-private.h b/src/cairo-wideint-private.h index 1841a44..5ebfae8 100644 --- a/src/cairo-wideint-private.h +++ b/src/cairo-wideint-private.h @@ -76,7 +76,7 @@ #endif #define I cairo_private -#if !HAVE_UINT64_T +#ifndef HAVE_UINT64_T typedef struct _cairo_uint64 { uint32_t lo, hi; @@ -195,7 +195,7 @@ _cairo_int64_divrem (cairo_int64_t num, * on ia64 */ -#if !HAVE_UINT128_T +#ifndef HAVE_UINT128_T typedef struct cairo_uint128 { cairo_uint64_t lo, hi; diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c index cbdb540..c85f222 100644 --- a/src/cairo-xlib-screen.c +++ b/src/cairo-xlib-screen.c @@ -377,7 +377,7 @@ _cairo_xlib_screen_reset_static_data (vo { _cairo_xlib_screen_info_reset (); -#if HAVE_XRMFINALIZE +#ifdef HAVE_XRMFINALIZE XrmFinalize (); #endif diff --git a/src/cairoint.h b/src/cairoint.h index 4846ac3..4d15347 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -46,7 +46,7 @@ #ifndef _CAIROINT_H_ #define _CAIROINT_H_ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -133,7 +133,7 @@ #else #define INLINE #endif -#if HAVE_PTHREAD_H +#ifdef HAVE_PTHREAD_H # include # define CAIRO_MUTEX_DECLARE(name) static pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER #define CAIRO_MUTEX_DECLARE_GLOBAL(name) pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER @@ -642,13 +642,13 @@ extern const cairo_private struct _cairo #endif -#if CAIRO_HAS_WIN32_FONT +#ifdef CAIRO_HAS_WIN32_FONT extern const cairo_private struct _cairo_scaled_font_backend cairo_win32_scaled_font_backend; #endif -#if CAIRO_HAS_ATSUI_FONT +#ifdef CAIRO_HAS_ATSUI_FONT extern const cairo_private struct _cairo_scaled_font_backend cairo_atsui_scaled_font_backend; @@ -1072,17 +1072,21 @@ #define CAIRO_WIN32_FONT_FAMILY_DEFAULT #define CAIRO_ATSUI_FONT_FAMILY_DEFAULT "Monaco" #define CAIRO_FT_FONT_FAMILY_DEFAULT "" -#if CAIRO_HAS_WIN32_FONT +#ifdef CAIRO_HAS_WIN32_FONT #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_win32_scaled_font_backend -#elif CAIRO_HAS_ATSUI_FONT +#endif + +#ifdef CAIRO_HAS_ATSUI_FONT #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_ATSUI_FONT_FAMILY_DEFAULT #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_atsui_scaled_font_backend -#elif CAIRO_HAS_FT_FONT +#endif + +#ifdef CAIRO_HAS_FT_FONT #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT #define CAIRO_SCALED_FONT_BACKEND_DEFAULT &cairo_ft_scaled_font_backend