From 383676f1ad66222ea7698f50a2d3f7214abb6c82 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 20 Aug 2016 23:17:29 -0300 Subject: [PATCH] eeshow/kicad/delta.c: improve sectioning --- eeshow/kicad/delta.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/eeshow/kicad/delta.c b/eeshow/kicad/delta.c index 99f4a89..a257784 100644 --- a/eeshow/kicad/delta.c +++ b/eeshow/kicad/delta.c @@ -352,20 +352,7 @@ bool sheet_eq(const struct sheet *a, const struct sheet *b) } -static void free_obj(struct sch_obj *obj) -{ - /* there may be more to free once we get into cloning components */ - free(obj); -} - - -static void init_res(struct sheet *res) -{ - res->title = NULL; - res->objs = NULL; - res->next_obj = &res->objs; - res->next = NULL; -} +/* ----- Merge wires ------------------------------------------------------- */ static int min(int a, int b) @@ -436,6 +423,25 @@ static void merge_wires(struct sch_obj *a) } +/* ----- Split objects from A and B into only-A, only-B, and A-and-B ------- */ + + +static void free_obj(struct sch_obj *obj) +{ + /* there may be more to free once we get into cloning components */ + free(obj); +} + + +static void init_res(struct sheet *res) +{ + res->title = NULL; + res->objs = NULL; + res->next_obj = &res->objs; + res->next = NULL; +} + + void delta(const struct sheet *a, const struct sheet *b, struct sheet *res_a, struct sheet *res_b, struct sheet *res_ab) {