mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-18 09:40:44 +02:00
Rename ARRAY_LEN to ARRAY_LENGTH
Yet another victim in my hunt against abbreviations within cairo's implementation.
This commit is contained in:
parent
d317e8175d
commit
01955a6e82
13 changed files with 23 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue