From 22269c9a43c93221bfd8f2fadbb6c13f84e1b60a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 11 May 2021 14:53:23 +0900 Subject: [PATCH] flood_fill_seed: initialize left_up and left_down together Just for readability. --- lib/identify.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/identify.c b/lib/identify.c index 3b69d36..b6993f7 100644 --- a/lib/identify.c +++ b/lib/identify.c @@ -178,21 +178,22 @@ static struct quirc_flood_fill_vars *flood_fill_call_next( while (*leftp <= vars->right) { if (row[*leftp] == from) { struct quirc_flood_fill_vars *next_vars; + int next_left; /* Set up the next context */ next_vars = vars + 1; - next_vars->left_up = *leftp; next_vars->y = vars->y + direction; /* Fill the extent */ flood_fill_line(q, - next_vars->left_up, + *leftp, next_vars->y, from, to, func, user_data, - &next_vars->left_up, + &next_left, &next_vars->right); - next_vars->left_down = next_vars->left_up; + next_vars->left_down = next_left; + next_vars->left_up = next_left; return next_vars; } @@ -215,17 +216,18 @@ static void flood_fill_seed(struct quirc *q, QUIRC_ASSERT(q->pixels[y0 * q->w + x0] == from); struct quirc_flood_fill_vars *next_vars; + int next_left; /* Set up the first context */ next_vars = stack; - next_vars->left_up = x0; next_vars->y = y0; /* Fill the extent */ - flood_fill_line(q, next_vars->left_up, next_vars->y, from, to, + flood_fill_line(q, x0, next_vars->y, from, to, func, user_data, - &next_vars->left_up, &next_vars->right); - next_vars->left_down = next_vars->left_up; + &next_left, &next_vars->right); + next_vars->left_down = next_left; + next_vars->left_up = next_left; while (true) { struct quirc_flood_fill_vars * const vars = next_vars;