1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2025-04-21 12:27:27 +03:00

Cleaned up the disgusting mess that was the list of frames. The changes:

- removed root_frame. "frames" now takes its place.
- removed frame->prev. In those few cases where we need the previous frame (for
  deletion and dumping), we walk the list or recurse.
- the list of frames is now in GUI order, not file order.
- when reading the .fpd file, put the root frame first and leave it there.
- instead of walking the frames list and excluding the root frame by testing
  frame->name, just start at frames->next
- likewise, instead of testing !frame->name just use frame == frames



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5948 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2010-04-28 00:34:32 +00:00
parent ac535d6e03
commit dbace0b2fa
11 changed files with 58 additions and 86 deletions

7
obj.c
View File

@@ -34,7 +34,6 @@
char *pkg_name = NULL;
struct frame *frames = NULL;
struct frame *root_frame = NULL;
struct frame *active_frame = NULL;
void *instantiation_error = NULL;
@@ -255,7 +254,7 @@ static int generate_objs(struct frame *frame, struct coord base, int active)
goto error;
break;
case ot_meas:
assert(frame == root_frame);
assert(frame == frames);
offset = eval_unit_default(obj->u.meas.offset, frame,
DEFAULT_OFFSET);
if (is_undef(offset))
@@ -278,7 +277,7 @@ static int generate_items(struct frame *frame, struct coord base, int active)
char *s;
int ok;
if (!frame->name) {
if (frame == frames) {
s = expand(pkg_name, frame);
inst_select_pkg(s);
free(s);
@@ -471,7 +470,7 @@ int instantiate(void)
reset_found();
found = 0;
search_suspended = 0;
ok = generate_frame(root_frame, zero, NULL, NULL, 1);
ok = generate_frame(frames, zero, NULL, NULL, 1);
if (ok && (find_vec || find_obj) && found)
activate_found();
find_vec = NULL;