[BACK]Return to parse.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/parse.c between version 1.36 and 1.37

version 1.36, 2000/01/08 09:45:15 version 1.37, 2000/03/26 16:21:32
Line 434 
Line 434 
 {  {
     GNode          *pgn = (GNode *) pgnp;      GNode          *pgn = (GNode *) pgnp;
     GNode          *cgn = (GNode *) cgnp;      GNode          *cgn = (GNode *) cgnp;
     if (Lst_Member (pgn->children, (ClientData)cgn) == NULL) {      if (Lst_Member(pgn->children, cgn) == NULL) {
         Lst_AtEnd(pgn->children, (ClientData)cgn);          Lst_AtEnd(pgn->children, cgn);
         if (specType == Not) {          if (specType == Not) {
             Lst_AtEnd(cgn->parents, (ClientData)pgn);              Lst_AtEnd(cgn->parents, pgn);
         }          }
         pgn->unmade += 1;          pgn->unmade += 1;
     }      }
Line 502 
Line 502 
          * anything with their local variables, but better safe than           * anything with their local variables, but better safe than
          * sorry.           * sorry.
          */           */
         Lst_ForEach(gn->parents, ParseLinkSrc, (ClientData)cohort);          Lst_ForEach(gn->parents, ParseLinkSrc, cohort);
         cohort->type = OP_DOUBLEDEP|OP_INVISIBLE;          cohort->type = OP_DOUBLEDEP|OP_INVISIBLE;
         Lst_AtEnd(gn->cohorts, (ClientData)cohort);          Lst_AtEnd(gn->cohorts, cohort);
   
         /*          /*
          * Replace the node in the targets list with the new copy           * Replace the node in the targets list with the new copy
          */           */
         ln = Lst_Member(targets, (ClientData)gn);          ln = Lst_Member(targets, gn);
         Lst_Replace(ln, (ClientData)cohort);          Lst_Replace(ln, cohort);
         gn = cohort;          gn = cohort;
     }      }
     /*      /*
Line 552 
Line 552 
          * but checking is tedious, and the debugging output can show the           * but checking is tedious, and the debugging output can show the
          * problem           * problem
          */           */
         Lst_AtEnd(p->successors, (ClientData)s);          Lst_AtEnd(p->successors, s);
         Lst_AtEnd(s->preds, (ClientData)p);          Lst_AtEnd(s->preds, p);
         return 0;          return 0;
     }      }
     else      else
Line 592 
Line 592 
         if (keywd != -1) {          if (keywd != -1) {
             int op = parseKeywords[keywd].op;              int op = parseKeywords[keywd].op;
             if (op != 0) {              if (op != 0) {
                 Lst_ForEach (targets, ParseDoOp, (ClientData)&op);                  Lst_ForEach (targets, ParseDoOp, &op);
                 return;                  return;
             }              }
             if (parseKeywords[keywd].spec == Wait) {              if (parseKeywords[keywd].spec == Wait) {
Line 612 
Line 612 
          * invoked if the user didn't specify a target on the command           * invoked if the user didn't specify a target on the command
          * line. This is to allow #ifmake's to succeed, or something...           * line. This is to allow #ifmake's to succeed, or something...
          */           */
         Lst_AtEnd(create, (ClientData)estrdup(src));          Lst_AtEnd(create, estrdup(src));
         /*          /*
          * Add the name to the .TARGETS variable as well, so the user cna           * Add the name to the .TARGETS variable as well, so the user cna
          * employ that, if desired.           * employ that, if desired.
Line 627 
Line 627 
          */           */
         gn = Targ_FindNode(src, TARG_CREATE);          gn = Targ_FindNode(src, TARG_CREATE);
         if (predecessor != NULL) {          if (predecessor != NULL) {
             Lst_AtEnd(predecessor->successors, (ClientData)gn);              Lst_AtEnd(predecessor->successors, gn);
             Lst_AtEnd(gn->preds, (ClientData)predecessor);              Lst_AtEnd(gn->preds, predecessor);
         }          }
         /*          /*
          * The current source now becomes the predecessor for the next one.           * The current source now becomes the predecessor for the next one.
Line 652 
Line 652 
         if (tOp) {          if (tOp) {
             gn->type |= tOp;              gn->type |= tOp;
         } else {          } else {
             Lst_ForEach (targets, ParseLinkSrc, (ClientData)gn);              Lst_ForEach(targets, ParseLinkSrc, gn);
         }          }
         if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) {          if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) {
             register GNode      *cohort;              register GNode      *cohort;
Line 663 
Line 663 
                 if (tOp) {                  if (tOp) {
                     cohort->type |= tOp;                      cohort->type |= tOp;
                 } else {                  } else {
                     Lst_ForEach(targets, ParseLinkSrc, (ClientData)cohort);                      Lst_ForEach(targets, ParseLinkSrc, cohort);
                 }                  }
             }              }
         }          }
Line 671 
Line 671 
     }      }
   
     gn->order = waiting;      gn->order = waiting;
     Lst_AtEnd(allsrc, (ClientData)gn);      Lst_AtEnd(allsrc, gn);
     if (waiting) {      if (waiting) {
         Lst_ForEach(allsrc, ParseAddDep, (ClientData)gn);          Lst_ForEach(allsrc, ParseAddDep, gn);
     }      }
 }  }
   
Line 944 
Line 944 
                         if (paths == NULL) {                          if (paths == NULL) {
                             paths = Lst_Init();                              paths = Lst_Init();
                         }                          }
                         Lst_AtEnd(paths, (ClientData)dirSearchPath);                          Lst_AtEnd(paths, dirSearchPath);
                         break;                          break;
                     case Main:                      case Main:
                         if (!Lst_IsEmpty(create)) {                          if (!Lst_IsEmpty(create)) {
Line 956 
Line 956 
                     case Interrupt:                      case Interrupt:
                         gn = Targ_FindNode(line, TARG_CREATE);                          gn = Targ_FindNode(line, TARG_CREATE);
                         gn->type |= OP_NOTMAIN;                          gn->type |= OP_NOTMAIN;
                         Lst_AtEnd(targets, (ClientData)gn);                          Lst_AtEnd(targets, gn);
                         break;                          break;
                     case Default:                      case Default:
                         gn = Targ_NewGN(".DEFAULT");                          gn = Targ_NewGN(".DEFAULT");
                         gn->type |= (OP_NOTMAIN|OP_TRANSFORM);                          gn->type |= (OP_NOTMAIN|OP_TRANSFORM);
                         Lst_AtEnd(targets, (ClientData)gn);                          Lst_AtEnd(targets, gn);
                         DEFAULT = gn;                          DEFAULT = gn;
                         break;                          break;
                     case NotParallel:                      case NotParallel:
Line 999 
Line 999 
                     if (paths == NULL) {                      if (paths == NULL) {
                         paths = Lst_Init();                          paths = Lst_Init();
                     }                      }
                     Lst_AtEnd(paths, (ClientData)path);                      Lst_AtEnd(paths, path);
                 }                  }
             }              }
         }          }
Line 1028 
Line 1028 
                  * No wildcards, but we want to avoid code duplication,                   * No wildcards, but we want to avoid code duplication,
                  * so create a list with the word on it.                   * so create a list with the word on it.
                  */                   */
                 Lst_AtEnd(curTargs, (ClientData)line);                  Lst_AtEnd(curTargs, line);
             }              }
   
             while((targName = (char *)Lst_DeQueue(curTargs)) != NULL) {              while((targName = (char *)Lst_DeQueue(curTargs)) != NULL) {
Line 1039 
Line 1039 
                 }                  }
   
                 if (gn != NULL)                  if (gn != NULL)
                     Lst_AtEnd(targets, (ClientData)gn);                      Lst_AtEnd(targets, gn);
             }              }
         } else if (specType == ExPath && *line != '.' && *line != '\0') {          } else if (specType == ExPath && *line != '.' && *line != '\0') {
             Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);              Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);
Line 1116 
Line 1116 
   
     cp++;                       /* Advance beyond operator */      cp++;                       /* Advance beyond operator */
   
     Lst_ForEach (targets, ParseDoOp, (ClientData)&op);      Lst_ForEach (targets, ParseDoOp, &op);
   
     /*      /*
      * Get to the first source       * Get to the first source
Line 1150 
Line 1150 
                 beSilent = TRUE;                  beSilent = TRUE;
                 break;                  break;
             case ExPath:              case ExPath:
                 Lst_ForEach(paths, ParseClearPath, (ClientData)NULL);                  Lst_ForEach(paths, ParseClearPath, NULL);
                 break;                  break;
             default:              default:
                 break;                  break;
Line 1216 
Line 1216 
                     Suff_AddSuffix (line);                      Suff_AddSuffix (line);
                     break;                      break;
                 case ExPath:                  case ExPath:
                     Lst_ForEach(paths, ParseAddDir, (ClientData)line);                      Lst_ForEach(paths, ParseAddDir, line);
                     break;                      break;
                 case Includes:                  case Includes:
                     Suff_AddInclude (line);                      Suff_AddInclude (line);
Line 1299 
Line 1299 
          * the first dependency line that is actually a real target           * the first dependency line that is actually a real target
          * (i.e. isn't a .USE or .EXEC rule) to be made.           * (i.e. isn't a .USE or .EXEC rule) to be made.
          */           */
         Lst_ForEach (targets, ParseFindMain, (ClientData)0);          Lst_ForEach(targets, ParseFindMain, NULL);
     }      }
   
     /*      /*
Line 1799 
Line 1799 
     oldFile->p = curPTR;      oldFile->p = curPTR;
     oldFile->lineno = lineno;      oldFile->lineno = lineno;
   
     Lst_AtFront(includes, (ClientData)oldFile);      Lst_AtFront(includes, oldFile);
   
     /*      /*
      * Once the previous state has been saved, we can get down to reading       * Once the previous state has been saved, we can get down to reading
Line 1851 
Line 1851 
     oldFile->F = curFILE;      oldFile->F = curFILE;
     oldFile->p = curPTR;      oldFile->p = curPTR;
   
     Lst_AtFront(includes, (ClientData)oldFile);      Lst_AtFront(includes, oldFile);
   
     curFILE = NULL;      curFILE = NULL;
     curPTR = (PTR *) emalloc (sizeof (PTR));      curPTR = (PTR *) emalloc (sizeof (PTR));
Line 1982 
Line 1982 
     oldFile->p = curPTR;      oldFile->p = curPTR;
     oldFile->lineno = lineno;      oldFile->lineno = lineno;
   
     Lst_AtFront(includes, (ClientData)oldFile);      Lst_AtFront(includes, oldFile);
   
     /*      /*
      * Once the previous state has been saved, we can get down to reading       * Once the previous state has been saved, we can get down to reading
Line 2423 
Line 2423 
 ParseFinishLine()  ParseFinishLine()
 {  {
     if (inLine) {      if (inLine) {
         Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL);          Lst_ForEach(targets, Suff_EndTransform, NULL);
         Lst_Destroy (targets, ParseHasCommands);          Lst_Destroy (targets, ParseHasCommands);
         targets = NULL;          targets = NULL;
         inLine = FALSE;          inLine = FALSE;
Line 2515 
Line 2515 
                          */                           */
                         Lst_ForEach (targets, ParseAddCmd, cp);                          Lst_ForEach (targets, ParseAddCmd, cp);
 #ifdef CLEANUP  #ifdef CLEANUP
                         Lst_AtEnd(targCmds, (ClientData) line);                          Lst_AtEnd(targCmds, line);
 #endif  #endif
                         continue;                          continue;
                     } else {                      } else {
Line 2683 
Line 2683 
         Punt ("no target to make.");          Punt ("no target to make.");
         /*NOTREACHED*/          /*NOTREACHED*/
     } else if (mainNode->type & OP_DOUBLEDEP) {      } else if (mainNode->type & OP_DOUBLEDEP) {
         Lst_AtEnd(listmain, (ClientData)mainNode);          Lst_AtEnd(listmain, mainNode);
         Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW);          Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW);
     }      }
     else      else
         Lst_AtEnd(listmain, (ClientData)mainNode);          Lst_AtEnd(listmain, mainNode);
     return (listmain);      return (listmain);
 }  }
   

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37