summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-29 14:32:20 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-29 14:33:05 (GMT)
commit766c52e7a582996fba1a89b4c15f6d74a1974c05 (patch)
treee75248e34e51df64a72094a1730e97e410a40e7e /kicad
parent59ddf85e6f924a136e5cf7a8f42d53da2aab4204 (diff)
downloadeeshow-766c52e7a582996fba1a89b4c15f6d74a1974c05.zip
eeshow-766c52e7a582996fba1a89b4c15f6d74a1974c05.tar.gz
eeshow-766c52e7a582996fba1a89b4c15f6d74a1974c05.tar.bz2
kicad/sch-render.c (sch_render): avoid very deep nesting for sch_obj_comp
(Which will get another level soon.)
Diffstat (limited to 'kicad')
-rw-r--r--kicad/sch-render.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/kicad/sch-render.c b/kicad/sch-render.c
index 27b5ecb..2a4a9a0 100644
--- a/kicad/sch-render.c
+++ b/kicad/sch-render.c
@@ -116,6 +116,16 @@ static void do_hsheet_text(const struct sch_obj *obj,
}
+static void render_comp(const struct sch_comp *comp, struct gfx *gfx)
+{
+ const struct comp_field *field;
+
+ lib_render(comp->comp, gfx, comp->unit, comp->convert, comp->m);
+ for (field = comp->fields; field; field = field->next)
+ dump_field(field, gfx, comp->m);
+}
+
+
static void render_sheet(const struct sch_obj *obj,
const struct sch_sheet *sheet, struct gfx *gfx)
{
@@ -166,16 +176,7 @@ void sch_render(const struct sheet *sheet, struct gfx *gfx)
}
break;
case sch_obj_comp:
- {
- const struct sch_comp *comp = &obj->u.comp;
- const struct comp_field *field;
-
- lib_render(comp->comp, gfx, comp->unit,
- comp->convert, comp->m);
- for (field = comp->fields; field;
- field = field->next)
- dump_field(field, gfx, comp->m);
- }
+ render_comp(&obj->u.comp, gfx);
break;
case sch_obj_sheet:
render_sheet(obj, &obj->u.sheet, gfx);