[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.55 and 1.56

version 1.55, 2006/09/17 19:03:15 version 1.56, 2006/09/24 09:04:05
Line 159 
Line 159 
 } LstSrc;  } LstSrc;
   
 static Suff         *suffNull;  /* The NULL suffix for this run */  static Suff         *suffNull;  /* The NULL suffix for this run */
   static Suff         *emptySuff; /* The empty suffix required for POSIX
                                    * single-suffix transformation rules */
   
   
 static char *SuffStrIsPrefix(const char *, const char *);  static char *SuffStrIsPrefix(const char *, const char *);
Line 189 
Line 191 
 static void SuffPrintName(void *);  static void SuffPrintName(void *);
 static void SuffPrintSuff(void *);  static void SuffPrintSuff(void *);
 static void SuffPrintTrans(void *);  static void SuffPrintTrans(void *);
 static Suff *emptySuff(void);  
   
 static LstNode suff_find_by_name(const char *);  static LstNode suff_find_by_name(const char *);
 static LstNode transform_find_by_name(const char *);  static LstNode transform_find_by_name(const char *);
Line 339 
Line 340 
     if (s == suffNull)      if (s == suffNull)
         suffNull = NULL;          suffNull = NULL;
   
       if (s == emptySuff)
           emptySuff = NULL;
   
     Lst_Destroy(&s->ref, NOFREE);      Lst_Destroy(&s->ref, NOFREE);
     Lst_Destroy(&s->children, NOFREE);      Lst_Destroy(&s->children, NOFREE);
     Lst_Destroy(&s->parents, NOFREE);      Lst_Destroy(&s->parents, NOFREE);
Line 414 
Line 418 
 #endif  #endif
     Lst_Init(&sufflist);      Lst_Init(&sufflist);
     sNum = 0;      sNum = 0;
     suffNull = emptySuff();      suffNull = emptySuff;
 }  }
   
 /*-  /*-
Line 470 
Line 474 
                  * find a double rule over a singleton, hence we leave this                   * find a double rule over a singleton, hence we leave this
                  * check until the end.                   * check until the end.
                  *                   *
                    * XXX: Use emptySuff over suffNull?
                  */                   */
                 *srcPtr = single;                  *srcPtr = single;
                 *targPtr = suffNull;                  *targPtr = suffNull;
Line 1958 
Line 1963 
      * actually go on the suffix list or everyone will think that's its       * actually go on the suffix list or everyone will think that's its
      * suffix.       * suffix.
      */       */
       emptySuff = suffNull = emalloc(sizeof(Suff));
   
     suffNull = emptySuff();      suffNull->name =        estrdup("");
       suffNull->nameLen =     0;
       Lst_Init(&suffNull->searchPath);
       Dir_Concat(&suffNull->searchPath, dirSearchPath);
       Lst_Init(&suffNull->children);
       Lst_Init(&suffNull->parents);
       Lst_Init(&suffNull->ref);
       suffNull->sNum =        sNum++;
       suffNull->flags =       SUFF_NULL;
   
 }  }
   
 Suff *  
 emptySuff()  
 {  
     Suff *s;  
     s = emalloc(sizeof(Suff));  
   
     s->name =       estrdup("");  
     s->nameLen =     0;  
     Lst_Init(&s->searchPath);  
     Dir_Concat(&s->searchPath, dirSearchPath);  
     Lst_Init(&s->children);  
     Lst_Init(&s->parents);  
     Lst_Init(&s->ref);  
     s->sNum =       sNum++;  
     s->flags =      SUFF_NULL;  
     return s;  
 }  
   
 /*-  /*-
  *----------------------------------------------------------------------   *----------------------------------------------------------------------

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56