Skip to content

Commit

Permalink
lstopo/draw: rename colors into color_list
Browse files Browse the repository at this point in the history
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Nov 23, 2021
1 parent 38cbbe6 commit dead0c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/lstopo/lstopo-draw.c
Expand Up @@ -54,7 +54,7 @@ struct lstopo_color BRIDGE_COLOR = { 0xff, 0xff, 0xff, 0 };
#pragma GCC diagnostic warning "-Wmissing-field-initializers"
#endif

static struct lstopo_color *colors = NULL;
static struct lstopo_color *color_list = NULL;

static struct lstopo_color *
declare_color(struct lstopo_output *loutput, struct lstopo_color *color)
Expand All @@ -69,8 +69,8 @@ declare_color(struct lstopo_output *loutput, struct lstopo_color *color)
}

/* insert */
color->next = colors;
colors = color;
color->next = color_list;
color_list = color;

return color;
}
Expand Down Expand Up @@ -103,7 +103,7 @@ declare_colors(struct lstopo_output *output)
void
destroy_colors(struct lstopo_output *loutput)
{
struct lstopo_color *tmp = colors;
struct lstopo_color *tmp = color_list;

while (tmp) {
struct lstopo_color *next = tmp->next;
Expand All @@ -115,15 +115,15 @@ destroy_colors(struct lstopo_output *loutput)
tmp = next;
}

colors = NULL; /* so that it works after refresh */
color_list = NULL; /* so that it works after refresh */
}

static struct lstopo_color *
find_or_declare_rgb_color(struct lstopo_output *loutput, int r, int g, int b)
{
struct lstopo_color *color, *tmp;

for(tmp = colors; tmp; tmp = tmp->next)
for(tmp = color_list; tmp; tmp = tmp->next)
if (tmp->r == r && tmp->g == g && tmp->b == b)
return tmp;

Expand Down

0 comments on commit dead0c9

Please sign in to comment.