flood_fill_seed: Unify "left" and "x" vars
This reduces the memory usage a bit.
This commit is contained in:
parent
aad3fc63b6
commit
40def012e7
2 changed files with 4 additions and 5 deletions
|
@ -170,14 +170,14 @@ static void flood_fill_seed(struct quirc *q,
|
||||||
|
|
||||||
/* Set up the first context */
|
/* Set up the first context */
|
||||||
next_vars = stack;
|
next_vars = stack;
|
||||||
next_vars->x = x0;
|
next_vars->left = x0;
|
||||||
next_vars->y = y0;
|
next_vars->y = y0;
|
||||||
|
|
||||||
call:
|
call:
|
||||||
vars = next_vars;
|
vars = next_vars;
|
||||||
|
|
||||||
/* Fill the extent */
|
/* Fill the extent */
|
||||||
flood_fill_line(q, vars->x, vars->y, from, to, &vars->left,
|
flood_fill_line(q, vars->left, vars->y, from, to, &vars->left,
|
||||||
&vars->right);
|
&vars->right);
|
||||||
|
|
||||||
if (func)
|
if (func)
|
||||||
|
@ -199,7 +199,7 @@ call:
|
||||||
|
|
||||||
/* Set up the next context */
|
/* Set up the next context */
|
||||||
next_vars = vars + 1;
|
next_vars = vars + 1;
|
||||||
next_vars->x = i;
|
next_vars->left = i;
|
||||||
next_vars->y = vars->y - 1;
|
next_vars->y = vars->y - 1;
|
||||||
goto call;
|
goto call;
|
||||||
return_from_call1: ;
|
return_from_call1: ;
|
||||||
|
@ -217,7 +217,7 @@ return_from_call1: ;
|
||||||
|
|
||||||
/* Set up the next context */
|
/* Set up the next context */
|
||||||
next_vars = vars + 1;
|
next_vars = vars + 1;
|
||||||
next_vars->x = i;
|
next_vars->left = i;
|
||||||
next_vars->y = vars->y + 1;
|
next_vars->y = vars->y + 1;
|
||||||
goto call;
|
goto call;
|
||||||
return_from_call2: ;
|
return_from_call2: ;
|
||||||
|
|
|
@ -78,7 +78,6 @@ struct quirc_grid {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct quirc_flood_fill_vars {
|
struct quirc_flood_fill_vars {
|
||||||
int x;
|
|
||||||
int y;
|
int y;
|
||||||
int right;
|
int right;
|
||||||
int left;
|
int left;
|
||||||
|
|
Loading…
Reference in a new issue