diff options
| author | Hartmut Brandt <harti@FreeBSD.org> | 2004-12-08 16:22:01 +0000 |
|---|---|---|
| committer | Hartmut Brandt <harti@FreeBSD.org> | 2004-12-08 16:22:01 +0000 |
| commit | c76d7d5047d90b7777133dd0769abbfb5d58ddbf (patch) | |
| tree | 033640eae93833ae9810ed9247ac98509312f27b /usr.bin/make/make.c | |
| parent | bb87c3794781abee9042b91c98c27ed8bdcfd369 (diff) | |
Notes
Diffstat (limited to 'usr.bin/make/make.c')
| -rw-r--r-- | usr.bin/make/make.c | 80 |
1 files changed, 36 insertions, 44 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 93411f8b93ec..f06434872b08 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -310,17 +310,14 @@ Make_HandleUse(GNode *cgn, GNode *pgn) Lst_Concat(pgn->commands, cgn->commands, LST_CONCNEW); } - if (Lst_Open(cgn->children) == SUCCESS) { - while ((ln = Lst_Next(cgn->children)) != NULL) { - gn = Lst_Datum(ln); + for (ln = Lst_First(cgn->children); ln != NULL; ln = Lst_Succ(ln)) { + gn = Lst_Datum(ln); - if (Lst_Member(pgn->children, gn) == NULL) { - Lst_AtEnd(pgn->children, gn); - Lst_AtEnd(gn->parents, pgn); - pgn->unmade += 1; - } + if (Lst_Member(pgn->children, gn) == NULL) { + Lst_AtEnd(pgn->children, gn); + Lst_AtEnd(gn->parents, pgn); + pgn->unmade += 1; } - Lst_Close(cgn->children); } pgn->type |= cgn->type & ~(OP_OPMASK | OP_USE | OP_TRANSFORM); @@ -378,6 +375,8 @@ Make_Update(GNode *cgn) char *cname; /* the child's name */ LstNode *ln; /* Element in parents and iParents lists */ char *p1; + char *ptr; + char *cpref; cname = Var_Value(TARGET, cgn, &p1); free(p1); @@ -447,35 +446,33 @@ Make_Update(GNode *cgn) #endif } - if (Lst_Open(cgn->parents) == SUCCESS) { - while ((ln = Lst_Next(cgn->parents)) != NULL) { - pgn = Lst_Datum(ln); - if (pgn->make) { - pgn->unmade -= 1; + for (ln = Lst_First(cgn->parents); ln != NULL; ln = Lst_Succ(ln)) { + pgn = Lst_Datum(ln); + if (pgn->make) { + pgn->unmade -= 1; - if (!(cgn->type & (OP_EXEC | OP_USE))) { - if (cgn->made == MADE) { - pgn->childMade = TRUE; - if (pgn->cmtime < cgn->mtime) { - pgn->cmtime = cgn->mtime; - } - } else { - Make_TimeStamp(pgn, cgn); + if (!(cgn->type & (OP_EXEC | OP_USE))) { + if (cgn->made == MADE) { + pgn->childMade = TRUE; + if (pgn->cmtime < cgn->mtime) { + pgn->cmtime = cgn->mtime; } + } else { + Make_TimeStamp(pgn, cgn); } - if (pgn->unmade == 0) { - /* - * Queue the node up -- any unmade predecessors will - * be dealt with in MakeStartJobs. - */ - Lst_EnQueue(toBeMade, pgn); - } else if (pgn->unmade < 0) { - Error("Graph cycles through %s", pgn->name); - } + } + if (pgn->unmade == 0) { + /* + * Queue the node up -- any unmade predecessors will + * be dealt with in MakeStartJobs. + */ + Lst_EnQueue(toBeMade, pgn); + } else if (pgn->unmade < 0) { + Error("Graph cycles through %s", pgn->name); } } - Lst_Close(cgn->parents); } + /* * Deal with successor nodes. If any is marked for making and has an unmade * count of 0, has not been made and isn't in the examination queue, @@ -496,20 +493,15 @@ Make_Update(GNode *cgn) * Set the .PREFIX and .IMPSRC variables for all the implied parents * of this node. */ - if (Lst_Open(cgn->iParents) == SUCCESS) { - char *ptr; - char *cpref = Var_Value(PREFIX, cgn, &ptr); - - while ((ln = Lst_Next(cgn->iParents)) != NULL) { - pgn = Lst_Datum (ln); - if (pgn->make) { - Var_Set(IMPSRC, cname, pgn); - Var_Set(PREFIX, cpref, pgn); - } + cpref = Var_Value(PREFIX, cgn, &ptr); + for (ln = Lst_First(cgn->iParents); ln != NULL; ln = Lst_Succ(ln)) { + pgn = Lst_Datum (ln); + if (pgn->make) { + Var_Set(IMPSRC, cname, pgn); + Var_Set(PREFIX, cpref, pgn); } - free(ptr); - Lst_Close(cgn->iParents); } + free(ptr); } /*- |
