diff options
-rw-r--r-- | src/cairo-arc.c | 2 | ||||
-rw-r--r-- | src/cairo-atsui-font.c | 4 | ||||
-rw-r--r-- | src/cairo-bentley-ottmann.c | 2 | ||||
-rw-r--r-- | src/cairo-cff-subset.c | 6 | ||||
-rw-r--r-- | src/cairo-hash.c | 2 | ||||
-rw-r--r-- | src/cairo-pattern.c | 8 | ||||
-rw-r--r-- | src/cairo-polygon.c | 2 | ||||
-rw-r--r-- | src/cairo-spline.c | 4 | ||||
-rw-r--r-- | src/cairo-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-svg-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-traps.c | 2 | ||||
-rw-r--r-- | src/cairo-truetype-subset.c | 6 | ||||
-rw-r--r-- | src/cairoint.h | 4 |
13 files changed, 23 insertions, 23 deletions
diff --git a/src/cairo-arc.c b/src/cairo-arc.c index 377da84f..89e6ce1a 100644 --- a/src/cairo-arc.c +++ b/src/cairo-arc.c @@ -87,7 +87,7 @@ _arc_max_angle_for_tolerance_normalized (double tolerance) { M_PI / 10.0, 1.73863223499021216974e-08 }, { M_PI / 11.0, 9.81410988043554039085e-09 }, }; - int table_size = ARRAY_LEN (table); + int table_size = ARRAY_LENGTH (table); for (i = 0; i < table_size; i++) if (table[i].error < tolerance) diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c index 79113d81..8aca2076 100644 --- a/src/cairo-atsui-font.c +++ b/src/cairo-atsui-font.c @@ -116,7 +116,7 @@ _cairo_atsui_font_face_scaled_font_create (void *abstract_face, ATSUStyle style; err = ATSUCreateStyle (&style); - err = ATSUSetAttributes(style, ARRAY_LEN (styleTags), + err = ATSUSetAttributes(style, ARRAY_LENGTH (styleTags), styleTags, styleSizes, styleValues); return _cairo_atsui_font_create_scaled (&font_face->base, font_face->font_id, style, @@ -372,7 +372,7 @@ _cairo_atsui_font_create_toy(cairo_toy_font_face_t *toy_face, ByteCount styleSizes[] = { sizeof(Boolean), sizeof(Boolean), sizeof(ATSUFontID) }; - err = ATSUSetAttributes(style, ARRAY_LEN (styleTags), + err = ATSUSetAttributes(style, ARRAY_LENGTH (styleTags), styleTags, styleSizes, styleValues); } diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c index 4c551f63..a9528376 100644 --- a/src/cairo-bentley-ottmann.c +++ b/src/cairo-bentley-ottmann.c @@ -1794,7 +1794,7 @@ main (void) unsigned int i, num_random; test_t *test; - for (i = 0; i < ARRAY_LEN (tests); i++) { + for (i = 0; i < ARRAY_LENGTH (tests); i++) { test = &tests[i]; run_test (test->name, test->edges, test->num_edges); } diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c index 1cdedee1..ab61ae26 100644 --- a/src/cairo-cff-subset.c +++ b/src/cairo-cff-subset.c @@ -895,7 +895,7 @@ cairo_cff_font_read_font (cairo_cff_font_t *font) cairo_int_status_t status; unsigned int i; - for (i = 0; i < ARRAY_LEN (font_read_funcs); i++) { + for (i = 0; i < ARRAY_LENGTH (font_read_funcs); i++) { status = font_read_funcs[i] (font); if (status) return status; @@ -955,7 +955,7 @@ cairo_cff_font_subset_dict_strings (cairo_cff_font_t *font, cairo_status_t status; unsigned int i; - for (i = 0; i < ARRAY_LEN (dict_strings); i++) { + for (i = 0; i < ARRAY_LENGTH (dict_strings); i++) { status = cairo_cff_font_subset_dict_string (font, dict, dict_strings[i]); if (status) return status; @@ -1316,7 +1316,7 @@ cairo_cff_font_write_subset (cairo_cff_font_t *font) cairo_int_status_t status; unsigned int i; - for (i = 0; i < ARRAY_LEN (font_write_funcs); i++) { + for (i = 0; i < ARRAY_LENGTH (font_write_funcs); i++) { status = font_write_funcs[i] (font); if (status) return status; diff --git a/src/cairo-hash.c b/src/cairo-hash.c index b55e7fb3..99343754 100644 --- a/src/cairo-hash.c +++ b/src/cairo-hash.c @@ -115,7 +115,7 @@ static const cairo_hash_table_arrangement_t hash_table_arrangements [] = { { 268435456, 590559793, 590559791 } }; -#define NUM_HASH_TABLE_ARRANGEMENTS ARRAY_LEN (hash_table_arrangements) +#define NUM_HASH_TABLE_ARRANGEMENTS ARRAY_LENGTH (hash_table_arrangements) struct _cairo_hash_table { cairo_hash_keys_equal_func_t keys_equal; diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 719067ca..5c51aa2b 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -286,7 +286,7 @@ _cairo_pattern_create_solid (const cairo_color_t *color) if (solid_pattern_cache.size) { int i = --solid_pattern_cache.size % - ARRAY_LEN (solid_pattern_cache.patterns); + ARRAY_LENGTH (solid_pattern_cache.patterns); pattern = solid_pattern_cache.patterns[i]; solid_pattern_cache.patterns[i] = NULL; } @@ -312,7 +312,7 @@ _cairo_pattern_reset_static_data (void) CAIRO_MUTEX_LOCK (_cairo_pattern_solid_cache_lock); - for (i = 0; i < MIN (ARRAY_LEN (solid_pattern_cache.patterns), solid_pattern_cache.size); i++) { + for (i = 0; i < MIN (ARRAY_LENGTH (solid_pattern_cache.patterns), solid_pattern_cache.size); i++) { free (solid_pattern_cache.patterns[i]); solid_pattern_cache.patterns[i] = NULL; } @@ -632,7 +632,7 @@ cairo_pattern_destroy (cairo_pattern_t *pattern) CAIRO_MUTEX_LOCK (_cairo_pattern_solid_cache_lock); i = solid_pattern_cache.size++ % - ARRAY_LEN (solid_pattern_cache.patterns); + ARRAY_LENGTH (solid_pattern_cache.patterns); /* swap an old pattern for this 'cache-hot' pattern */ if (solid_pattern_cache.patterns[i]) free (solid_pattern_cache.patterns[i]); @@ -725,7 +725,7 @@ _cairo_pattern_gradient_grow (cairo_gradient_pattern_t *pattern) { pixman_gradient_stop_t *new_stops; int old_size = pattern->stops_size; - int embedded_size = ARRAY_LEN (pattern->stops_embedded); + int embedded_size = ARRAY_LENGTH (pattern->stops_embedded); int new_size = 2 * MAX (old_size, 4); /* we have a local buffer at pattern->stops_embedded. try to fulfill the request diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c index c79eedc7..1eb09ec3 100644 --- a/src/cairo-polygon.c +++ b/src/cairo-polygon.c @@ -71,7 +71,7 @@ _cairo_polygon_grow (cairo_polygon_t *polygon) { cairo_edge_t *new_edges; int old_size = polygon->edges_size; - int embedded_size = ARRAY_LEN (polygon->edges_embedded); + int embedded_size = ARRAY_LENGTH (polygon->edges_embedded); int new_size = 2 * MAX (old_size, 16); /* we have a local buffer at polygon->edges_embedded. try to fulfill the request diff --git a/src/cairo-spline.c b/src/cairo-spline.c index b63ac57e..bf877700 100644 --- a/src/cairo-spline.c +++ b/src/cairo-spline.c @@ -81,7 +81,7 @@ _cairo_spline_init (cairo_spline_t *spline, _cairo_slope_init (&spline->final_slope, &spline->a, &spline->d); spline->points = spline->points_embedded; - spline->points_size = ARRAY_LEN (spline->points_embedded); + spline->points_size = ARRAY_LENGTH (spline->points_embedded); spline->num_points = 0; return CAIRO_STATUS_SUCCESS; @@ -94,7 +94,7 @@ _cairo_spline_fini (cairo_spline_t *spline) free (spline->points); spline->points = spline->points_embedded; - spline->points_size = ARRAY_LEN (spline->points_embedded); + spline->points_size = ARRAY_LENGTH (spline->points_embedded); spline->num_points = 0; } diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 93d4f468..e3d4c0e4 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1180,7 +1180,7 @@ _cairo_surface_fill_region (cairo_surface_t *surface, return CAIRO_STATUS_SUCCESS; rects = stack_rects; - if (num_rects > ARRAY_LEN (stack_rects)) { + if (num_rects > ARRAY_LENGTH (stack_rects)) { rects = malloc (sizeof (cairo_rectangle_int16_t) * num_rects); if (!rects) return CAIRO_STATUS_NO_MEMORY; diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index 7d217a99..70dce462 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -59,7 +59,7 @@ static const cairo_svg_version_t _cairo_svg_versions[] = CAIRO_SVG_VERSION_1_2 }; -#define CAIRO_SVG_VERSION_LAST ARRAY_LEN (_cairo_svg_versions) +#define CAIRO_SVG_VERSION_LAST ARRAY_LENGTH (_cairo_svg_versions) static cairo_bool_t _cairo_svg_version_has_page_set_support (cairo_svg_version_t version) diff --git a/src/cairo-traps.c b/src/cairo-traps.c index 2fa4f66a..2f341690 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -187,7 +187,7 @@ _cairo_traps_grow (cairo_traps_t *traps) { cairo_trapezoid_t *new_traps; int old_size = traps->traps_size; - int embedded_size = ARRAY_LEN (traps->traps_embedded); + int embedded_size = ARRAY_LENGTH (traps->traps_embedded); int new_size = 2 * MAX (old_size, 16); /* we have a local buffer at traps->traps_embedded. try to fulfill the request diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c index 262912ec..dd8357e4 100644 --- a/src/cairo-truetype-subset.c +++ b/src/cairo-truetype-subset.c @@ -703,7 +703,7 @@ cairo_truetype_font_write_offset_table (cairo_truetype_font_t *font) unsigned short search_range, entry_selector, range_shift; int num_tables; - num_tables = ARRAY_LEN (truetype_tables); + num_tables = ARRAY_LENGTH (truetype_tables); search_range = 1; entry_selector = 0; while (search_range * 2 <= num_tables) { @@ -722,7 +722,7 @@ cairo_truetype_font_write_offset_table (cairo_truetype_font_t *font) /* Allocate space for the table directory. Each directory entry * will be filled in by cairo_truetype_font_update_entry() after * the table is written. */ - table_buffer_length = ARRAY_LEN (truetype_tables) * 16; + table_buffer_length = ARRAY_LENGTH (truetype_tables) * 16; status = cairo_truetype_font_allocate_write_buffer (font, table_buffer_length, &table_buffer); if (status) @@ -785,7 +785,7 @@ cairo_truetype_font_generate (cairo_truetype_font_t *font, end = start; end = 0; - for (i = 0; i < ARRAY_LEN (truetype_tables); i++) { + for (i = 0; i < ARRAY_LENGTH (truetype_tables); i++) { if (truetype_tables[i].write (font, truetype_tables[i].tag)) goto fail; diff --git a/src/cairoint.h b/src/cairoint.h index c537a002..fba0ab9d 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -153,8 +153,8 @@ CAIRO_BEGIN_DECLS #define M_PI 3.14159265358979323846 #endif -#undef ARRAY_LEN -#define ARRAY_LEN(__array) ((int) (sizeof (__array) / sizeof (__array[0]))) +#undef ARRAY_LENGTH +#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0]))) /* Size in bytes of buffer to use off the stack per functions. * Mostly used by text functions. For larger allocations, they'll |