Commit 5c440817 authored by Eric Anholt's avatar Eric Anholt

glamor: Use ARRAY_SIZE in a couple more places for consistency.

Signed-off-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7b6edb52
...@@ -145,8 +145,6 @@ static glamor_location_var location_vars[] = { ...@@ -145,8 +145,6 @@ static glamor_location_var location_vars[] = {
}, },
}; };
#define NUM_LOCATION_VARS (sizeof location_vars / sizeof location_vars[0])
static char * static char *
add_var(char *cur, const char *add) add_var(char *cur, const char *add)
{ {
...@@ -170,7 +168,7 @@ vs_location_vars(glamor_program_location locations) ...@@ -170,7 +168,7 @@ vs_location_vars(glamor_program_location locations)
int l; int l;
char *vars = strdup(""); char *vars = strdup("");
for (l = 0; vars && l < NUM_LOCATION_VARS; l++) for (l = 0; vars && l < ARRAY_SIZE(location_vars); l++)
if (locations & location_vars[l].location) if (locations & location_vars[l].location)
vars = add_var(vars, location_vars[l].vs_vars); vars = add_var(vars, location_vars[l].vs_vars);
return vars; return vars;
...@@ -182,7 +180,7 @@ fs_location_vars(glamor_program_location locations) ...@@ -182,7 +180,7 @@ fs_location_vars(glamor_program_location locations)
int l; int l;
char *vars = strdup(""); char *vars = strdup("");
for (l = 0; vars && l < NUM_LOCATION_VARS; l++) for (l = 0; vars && l < ARRAY_SIZE(location_vars); l++)
if (locations & location_vars[l].location) if (locations & location_vars[l].location)
vars = add_var(vars, location_vars[l].fs_vars); vars = add_var(vars, location_vars[l].fs_vars);
return vars; return vars;
......
...@@ -707,10 +707,7 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src, ...@@ -707,10 +707,7 @@ combine_pict_format(PictFormatShort * des, const PictFormatShort src,
return TRUE; return TRUE;
} }
for (i = 0; for (i = 0; i < ARRAY_SIZE(pict_format_combine_tab); i++) {
i <
sizeof(pict_format_combine_tab) /
sizeof(pict_format_combine_tab[0]); i++) {
if ((src_type == pict_format_combine_tab[i][0] if ((src_type == pict_format_combine_tab[i][0]
&& mask_type == pict_format_combine_tab[i][1]) && mask_type == pict_format_combine_tab[i][1])
|| (src_type == pict_format_combine_tab[i][1] || (src_type == pict_format_combine_tab[i][1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment