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

Diff for /src/usr.bin/make/suff.c between version 1.93 and 1.94

version 1.93, 2018/10/06 14:00:30 version 1.94, 2018/10/08 19:52:53
Line 180 
Line 180 
   
 static void SuffInsert(Lst, Suff *);  static void SuffInsert(Lst, Suff *);
 static void SuffAddSrc(void *, void *);  static void SuffAddSrc(void *, void *);
 static bool SuffRemoveSrc(Lst);  static int SuffRemoveSrc(Lst);
 static void SuffAddLevel(Lst, Src *);  static void SuffAddLevel(Lst, Src *);
 static Src *SuffFindThem(Lst, Lst);  static Src *SuffFindThem(Lst, Lst);
 static Src *SuffFindCmds(Src *, Lst);  static Src *SuffFindCmds(Src *, Lst);
Line 730 
Line 730 
 /*-  /*-
  *----------------------------------------------------------------------   *----------------------------------------------------------------------
  * SuffRemoveSrc --   * SuffRemoveSrc --
  *      Free Src structure with a zero reference count in a list   *      Free all src structures in list that don't have a reference count
  *   *
  *      returns true if a src was removed   * Results:
    *      Ture if an src was removed
    *
    * Side Effects:
    *      The memory is free'd.
  *----------------------------------------------------------------------   *----------------------------------------------------------------------
  */   */
 static bool  static int
 SuffRemoveSrc(Lst l)  SuffRemoveSrc(Lst l)
 {  {
         LstNode ln;          LstNode ln;
         Src *s;          Src *s;
           int t = 0;
   
 #ifdef DEBUG_SRC  #ifdef DEBUG_SRC
         printf("cleaning %lx: ", (unsigned long)l);          printf("cleaning %lx: ", (unsigned long)l);
Line 768 
Line 773 
 #endif  #endif
                         Lst_Remove(l, ln);                          Lst_Remove(l, ln);
                         free(s);                          free(s);
                           t |= 1;
                         return true;                          return true;
                 }                  }
 #ifdef DEBUG_SRC  #ifdef DEBUG_SRC
Line 779 
Line 785 
 #endif  #endif
         }          }
   
         return false;          return t;
 }  }
   
 /*-  /*-
Line 1379 
Line 1385 
         Src *src;       /* General Src pointer */          Src *src;       /* General Src pointer */
         char *prefix;   /* Prefix to use */          char *prefix;   /* Prefix to use */
         Src *targ;      /* General Src target pointer */          Src *targ;      /* General Src target pointer */
         bool phony;  
   
         phony = (gn->type & OP_PHONY) == OP_PHONY;  
   
         Lst_Init(&srcs);          Lst_Init(&srcs);
         Lst_Init(&targs);          Lst_Init(&targs);
Line 1404 
Line 1408 
          * Should we find one, we discard the one we found before.      */           * Should we find one, we discard the one we found before.      */
   
   
         if (!phony)          record_possible_suffixes(gn, &srcs, &targs);
                 record_possible_suffixes(gn, &srcs, &targs);  
         /* Handle target of unknown suffix...  */          /* Handle target of unknown suffix...  */
         if (!phony && Lst_IsEmpty(&srcs)) {          if (Lst_IsEmpty(&srcs)) {
                 if (DEBUG(SUFF))                  if (DEBUG(SUFF))
                         printf("\tNo known suffix on %s. Using empty suffix\n",                          printf("\tNo known suffix on %s. Using empty suffix\n",
                             gn->name);                              gn->name);
Line 1425 
Line 1428 
   
                 /* Only use the default suffix rules if we don't have commands                  /* Only use the default suffix rules if we don't have commands
                  * or dependencies defined for this gnode.  */                   * or dependencies defined for this gnode.  */
                 if (Lst_IsEmpty(&gn->commands))                  if (Lst_IsEmpty(&gn->commands) && Lst_IsEmpty(&gn->children))
                         SuffAddLevel(&srcs, targ);                          SuffAddLevel(&srcs, targ);
                 else {                  else {
                         if (DEBUG(SUFF))                          if (DEBUG(SUFF))

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94