diff --git a/sch2fig/Makefile b/sch2fig/Makefile index a4a041c..5af7077 100644 --- a/sch2fig/Makefile +++ b/sch2fig/Makefile @@ -13,7 +13,7 @@ NAME = sch2fig OBJS = main.o sch.o lib.o fig.o text.o misc.o -CFLAGS = -g -Wall -Wextra -Wno-unused-parameter +CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow LIBS = -lm include ../common/Makefile.c-common diff --git a/sch2fig/lib.c b/sch2fig/lib.c index b5e480a..a1cdaae 100644 --- a/sch2fig/lib.c +++ b/sch2fig/lib.c @@ -101,7 +101,7 @@ struct comp { static struct comp *comps = NULL; -static struct comp *comp; /* current component */ +static struct comp *curr_comp; /* current component */ static struct comp **next_comp = &comps; static struct obj **next_obj; @@ -301,22 +301,22 @@ static bool parse_def(const char *line) &s, &name_offset, &draw_num, &draw_name) != 4) return 0; - comp = alloc_type(struct comp); + curr_comp = alloc_type(struct comp); if (*s == '~') s++; - comp->name = s; + curr_comp->name = s; - comp->visible = 0; - comp->show_pin_name = draw_name == 'Y'; - comp->show_pin_num = draw_num == 'Y'; - comp->name_offset = name_offset; + curr_comp->visible = 0; + curr_comp->show_pin_name = draw_name == 'Y'; + curr_comp->show_pin_num = draw_num == 'Y'; + curr_comp->name_offset = name_offset; - comp->objs = NULL; - next_obj = &comp->objs; + curr_comp->objs = NULL; + next_obj = &curr_comp->objs; - comp->next = NULL; - *next_comp = comp; - next_comp = &comp->next; + curr_comp->next = NULL; + *next_comp = curr_comp; + next_comp = &curr_comp->next; return 1; } @@ -352,7 +352,7 @@ bool lib_parse(struct lib_ctx *ctx, const char *line) || sscanf(line, "F%d \"%*[^\"]\" %*d %*d %*d %*c %c", &n, &vis) == 2) { if (vis == 'V') - comp->visible |= 1 << n; + curr_comp->visible |= 1 << n; return 1; } /* @@@ explicitly ignore FPLIST */