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

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/make/suff.c between version 1.258 and 1.259

version 1.258, 2020/11/21 12:01:16 version 1.259, 2020/11/21 13:11:13
Line 203  static Suff *emptySuff;
Line 203  static Suff *emptySuff;
 static void SuffFindDeps(GNode *, SrcList *);  static void SuffFindDeps(GNode *, SrcList *);
 static void SuffExpandWildcards(GNodeListNode *, GNode *);  static void SuffExpandWildcards(GNodeListNode *, GNode *);
   
   /* Change the value of a Suff variable, adjusting the reference counts. */
   static void
   SuffReassign(Suff **var, Suff *suff)
   {
       if (*var != NULL)
           (*var)->refCount--;
       *var = suff;
       suff->refCount++;
   }
   
   /* Set a Suff variable to NULL, adjusting the reference count. */
   static void
   SuffUnassign(Suff **var)
   {
       if (*var != NULL)
           (*var)->refCount--;
       *var = NULL;
   }
   
 /*  /*
  * See if pref is a prefix of str.   * See if pref is a prefix of str.
  * Return NULL if it ain't, pointer to character in str after prefix if so.   * Return NULL if it ain't, pointer to character in str after prefix if so.
Line 1612  SuffFindNormalDepsPath(GNode *gn, Src *t
Line 1631  SuffFindNormalDepsPath(GNode *gn, Src *t
         char savec;          char savec;
         char *ptr;          char *ptr;
   
         if (gn->suffix)          SuffReassign(&gn->suffix, targ->suff);
             gn->suffix->refCount--;  
         gn->suffix = targ->suff;  
         gn->suffix->refCount++;  
   
         savec = gn->path[savep];          savec = gn->path[savep];
         gn->path[savep] = '\0';          gn->path[savep] = '\0';
Line 1632  SuffFindNormalDepsPath(GNode *gn, Src *t
Line 1648  SuffFindNormalDepsPath(GNode *gn, Src *t
         char *ptr;          char *ptr;
   
         /* The .PREFIX gets the full path if the target has no known suffix. */          /* The .PREFIX gets the full path if the target has no known suffix. */
         if (gn->suffix)          SuffUnassign(&gn->suffix);
             gn->suffix->refCount--;  
         gn->suffix = NULL;  
   
         if ((ptr = strrchr(gn->path, '/')) != NULL)          if ((ptr = strrchr(gn->path, '/')) != NULL)
             ptr++;              ptr++;
Line 1804  sfnd_abort:
Line 1818  sfnd_abort:
     for (src = bottom; src->parent != NULL; src = src->parent) {      for (src = bottom; src->parent != NULL; src = src->parent) {
         targ = src->parent;          targ = src->parent;
   
         if (src->node->suffix)          SuffReassign(&src->node->suffix, src->suff);
             src->node->suffix->refCount--;  
         src->node->suffix = src->suff;  
         src->node->suffix->refCount++;  
   
         if (targ->node == NULL)          if (targ->node == NULL)
             targ->node = Targ_GetNode(targ->file);              targ->node = Targ_GetNode(targ->file);
Line 1830  sfnd_abort:
Line 1841  sfnd_abort:
         }          }
     }      }
   
     if (gn->suffix != NULL)      SuffReassign(&gn->suffix, src->suff);
         gn->suffix->refCount--;  
     gn->suffix = src->suff;  
     gn->suffix->refCount++;  
   
     /*      /*
      * Nuke the transformation path and the Src structures left over in the       * Nuke the transformation path and the Src structures left over in the
Line 1901  SuffFindDeps(GNode *gn, SrcList *slst)
Line 1909  SuffFindDeps(GNode *gn, SrcList *slst)
          * value).           * value).
          */           */
         Suff *suff = FindSuffByName(LIBSUFF);          Suff *suff = FindSuffByName(LIBSUFF);
         if (gn->suffix)  
             gn->suffix->refCount--;  
         if (suff != NULL) {          if (suff != NULL) {
             gn->suffix = suff;              SuffReassign(&gn->suffix, suff);
             gn->suffix->refCount++;  
             Arch_FindLib(gn, suff->searchPath);              Arch_FindLib(gn, suff->searchPath);
         } else {          } else {
             gn->suffix = NULL;              SuffUnassign(&gn->suffix);
             Var_Set(TARGET, gn->name, gn);              Var_Set(TARGET, gn->name, gn);
         }          }
         /*          /*

Legend:
Removed from v.1.258  
changed lines
  Added in v.1.259

CVSweb <webmaster@jp.NetBSD.org>