1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-04 23:29:42 +02:00

eeshow/gui.c (add_hist): avoid excessive use of "(*anchor)"

This commit is contained in:
Werner Almesberger 2016-08-10 14:07:03 -03:00
parent 971ba27131
commit 4a2177e041

View File

@ -1004,7 +1004,7 @@ static void add_hist(void *user, struct hist *h)
{
struct add_hist_ctx *ahc = user;
struct gui_ctx *ctx = ahc->ctx;
struct gui_hist **anchor;
struct gui_hist **anchor, *hist;
const struct sheet *sch;
unsigned age = 0;
@ -1014,13 +1014,16 @@ static void add_hist(void *user, struct hist *h)
for (anchor = &ctx->hist; *anchor; anchor = &(*anchor)->next)
age++;
*anchor = alloc_type(struct gui_hist);
(*anchor)->ctx = ctx;
(*anchor)->vcs_hist = h;
hist = alloc_type(struct gui_hist);
hist->ctx = ctx;
hist->vcs_hist = h;
sch = parse_sheets(h, ahc->n_args, ahc->args, ahc->recurse);
(*anchor)->sheets = sch ? get_sheets(ctx, sch) : NULL;
(*anchor)->age = age;
(*anchor)->next = NULL;
hist->sheets = sch ? get_sheets(ctx, sch) : NULL;
hist->age = age;
hist->next = NULL;
*anchor = hist;
}