From 40def012e77516e12b0fe685b441834bcdca1353 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 11 May 2021 13:03:10 +0900 Subject: [PATCH] flood_fill_seed: Unify "left" and "x" vars This reduces the memory usage a bit. --- lib/identify.c | 8 ++++---- lib/quirc_internal.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/identify.c b/lib/identify.c index d3631d0..90f41ff 100644 --- a/lib/identify.c +++ b/lib/identify.c @@ -170,14 +170,14 @@ static void flood_fill_seed(struct quirc *q, /* Set up the first context */ next_vars = stack; - next_vars->x = x0; + next_vars->left = x0; next_vars->y = y0; call: vars = next_vars; /* 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); if (func) @@ -199,7 +199,7 @@ call: /* Set up the next context */ next_vars = vars + 1; - next_vars->x = i; + next_vars->left = i; next_vars->y = vars->y - 1; goto call; return_from_call1: ; @@ -217,7 +217,7 @@ return_from_call1: ; /* Set up the next context */ next_vars = vars + 1; - next_vars->x = i; + next_vars->left = i; next_vars->y = vars->y + 1; goto call; return_from_call2: ; diff --git a/lib/quirc_internal.h b/lib/quirc_internal.h index a94d8e9..ed23319 100644 --- a/lib/quirc_internal.h +++ b/lib/quirc_internal.h @@ -78,7 +78,6 @@ struct quirc_grid { }; struct quirc_flood_fill_vars { - int x; int y; int right; int left;