From 18be341c2dc354644cae1dd67921b1673a2da74f Mon Sep 17 00:00:00 2001 From: werner Date: Sat, 22 Aug 2009 14:29:48 +0000 Subject: [PATCH] Bug-fixing ... - obj.c: embarrasingly, the default offset wasn't a distance - connect_obj: didn't update the object's frame pointer, deeply confusing deletion git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5524 99fdad57-331a-0410-800a-d7fa5415bdb3 --- gui_tool.c | 1 + obj.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gui_tool.c b/gui_tool.c index d06ea67..6f0fb51 100644 --- a/gui_tool.c +++ b/gui_tool.c @@ -101,6 +101,7 @@ void connect_obj(struct frame *frame, struct obj *obj) { struct obj **walk; + obj->frame = frame; for (walk = &frame->objs; *walk; walk = &(*walk)->next); *walk = obj; } diff --git a/obj.c b/obj.c index 54ba7e1..3042ef3 100644 --- a/obj.c +++ b/obj.c @@ -25,6 +25,7 @@ #define DEFAULT_SILK_WIDTH make_mil(15) /* @@@ */ +#define DEFAULT_OFFSET make_mil(0) /* @@@ */ #define MAX_ITERATIONS 1000 /* abort "loop"s at this limit */ @@ -94,11 +95,6 @@ error: static int generate_objs(struct frame *frame, struct coord base, int active) { - static const struct num zero_offset = { - .type = nt_mm, - .exponent = 0, - .n = 0, - }; struct obj *obj; char *name; int ok; @@ -157,7 +153,7 @@ static int generate_objs(struct frame *frame, struct coord base, int active) case ot_meas: assert(frame == root_frame); offset = eval_unit_default(obj->u.meas.offset, frame, - zero_offset); + DEFAULT_OFFSET); if (is_undef(offset)) goto error; inst_meas_hint(obj, offset.n);