summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-30 03:28:45 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-30 03:28:45 -0300
commite3aea192ee483678648797b091c9e863bbf7d9c8 (patch)
tree51a1b9895e503da0123830c571985568648d00a0
parentccb43979d970bc7ee26a4128e1e5b3882008ec63 (diff)
downloadeeshow-e3aea192ee483678648797b091c9e863bbf7d9c8.tar.gz
eeshow-e3aea192ee483678648797b091c9e863bbf7d9c8.tar.bz2
eeshow-e3aea192ee483678648797b091c9e863bbf7d9c8.zip
kicad/delta.c (sheet_eq): make recursing optional; don't recurse in index
In the index, we don't want to have pages marked because there's a page underneath that has changed. After all, that other page is being shown in the index as well. However, in all other cases we still want to recurse.
-rw-r--r--gui/gui.c2
-rw-r--r--gui/index.c2
-rw-r--r--gui/render.c2
-rw-r--r--kicad/delta.c6
-rw-r--r--kicad/delta.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/gui/gui.c b/gui/gui.c
index 5f084c8..c566d1d 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -319,7 +319,7 @@ static const struct sheet *parse_files(struct gui_hist *hist,
*/
if (prev && prev->sheets &&
- sheet_eq(prev->sch_ctx.sheets, hist->sch_ctx.sheets))
+ sheet_eq(prev->sch_ctx.sheets, hist->sch_ctx.sheets, 1))
prev->identical = 1;
/*
diff --git a/gui/index.c b/gui/index.c
index 7a5c925..f87f158 100644
--- a/gui/index.c
+++ b/gui/index.c
@@ -277,7 +277,7 @@ static void index_render_sheet(const struct gui *gui,
old = find_corresponding_sheet(gui->old_hist->sheets,
gui->new_hist->sheets, sheet);
- if (!sheet_eq(sheet->sch, old->sch))
+ if (!sheet_eq(sheet->sch, old->sch, 0))
yellow = 1;
}
diff --git a/gui/render.c b/gui/render.c
index 48003f5..ea17b8c 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -140,7 +140,7 @@ static struct area *changed_sheets(const struct gui *gui,
old_sub = find_corresponding_sheet(gui->old_hist->sheets,
gui->new_hist->sheets, new_sub);
- if (!sheet_eq(new_sub->sch, old_sub->sch))
+ if (!sheet_eq(new_sub->sch, old_sub->sch, 1))
add_area(&areas, cx(obj->x, xo, f), cy(obj->y, yo, f),
cx(obj->x + obj->u.sheet.w, xo, f),
cy(obj->y + obj->u.sheet.h, yo, f), 0xffff00);
diff --git a/kicad/delta.c b/kicad/delta.c
index a09a014..c45212f 100644
--- a/kicad/delta.c
+++ b/kicad/delta.c
@@ -319,14 +319,14 @@ static bool obj_eq(const struct sch_obj *a, const struct sch_obj *b,
return 1;
if (a->u.sheet.error != b->u.sheet.error)
return 0;
- return sheet_eq(a->u.sheet.sheet, b->u.sheet.sheet);
+ return sheet_eq(a->u.sheet.sheet, b->u.sheet.sheet, 1);
default:
BUG("invalid type %d", a->type);
}
}
-bool sheet_eq(const struct sheet *a, const struct sheet *b)
+bool sheet_eq(const struct sheet *a, const struct sheet *b, bool recurse)
{
const struct sch_obj *obj_a, *obj_b;
@@ -345,7 +345,7 @@ bool sheet_eq(const struct sheet *a, const struct sheet *b)
obj_a = a->objs;
obj_b = b->objs;
while (obj_a && obj_b) {
- if (!obj_eq(obj_a, obj_b, 1))
+ if (!obj_eq(obj_a, obj_b, recurse))
return 0;
obj_a = obj_a->next;
obj_b = obj_b->next;
diff --git a/kicad/delta.h b/kicad/delta.h
index fdb641a..7abd1cb 100644
--- a/kicad/delta.h
+++ b/kicad/delta.h
@@ -17,7 +17,7 @@
#include "kicad/sch.h"
-bool sheet_eq(const struct sheet *a, const struct sheet *b);
+bool sheet_eq(const struct sheet *a, const struct sheet *b, bool recurse);
void delta(const struct sheet *a, const struct sheet *b,
struct sheet *res_a, struct sheet *res_b, struct sheet *res_ab);