VirtualBox

Changeset 1898 in kBuild


Ignore:
Timestamp:
Oct 21, 2008 1:39:22 AM (16 years ago)
Author:
bird
Message:

kmk: strcache_get_len -> strcache2_get_len

Location:
trunk/src/kmk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/commands.c

    r1860 r1898  
    9696        {
    9797          name = file->name;
    98 #ifndef CONFIG_WITH_VALUE_LENGTH
     98#ifndef CONFIG_WITH_STRCACHE2
    9999          len = strlen (name);
    100100#else
    101           len = strcache_get_len (name);
     101          len = strcache2_get_len (&file_strcache, name);
    102102#endif
    103103        }
     
    105105      for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
    106106        {
    107 #ifndef CONFIG_WITH_VALUE_LENGTH
     107#ifndef CONFIG_WITH_STRCACHE2
    108108          unsigned int slen = strlen (dep_name (d));
    109109#else
    110           unsigned int slen = strcache_get_len (dep_name (d));
     110          unsigned int slen = strcache2_get_len (&file_strcache, dep_name (d));
    111111#endif
    112112          if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
     
    164164    for (d = file->deps; d != 0; d = d->next)
    165165      if (! d->ignore_mtime)
    166 #ifndef CONFIG_WITH_VALUE_LENGTH
     166#ifndef CONFIG_WITH_STRCACHE2
    167167        plus_len += strlen (dep_name (d)) + 1;
    168168#else
    169         plus_len += strcache_get_len (dep_name (d)) + 1;
     169        plus_len += strcache2_get_len (&file_strcache, dep_name (d)) + 1;
    170170#endif
    171171    if (plus_len == 0)
     
    190190          else
    191191#endif
    192 #ifndef CONFIG_WITH_VALUE_LENGTH
     192#ifndef CONFIG_WITH_STRCACHE2
    193193            len = strlen (c);
    194194#else
    195             len = strcache_get_len (c);
     195            len = strcache2_get_len (&file_strcache, c);
    196196#endif
    197197
     
    217217    for (d = file->deps; d != 0; d = d->next)
    218218      if (d->ignore_mtime)
    219 #ifndef CONFIG_WITH_VALUE_LENGTH
     219#ifndef CONFIG_WITH_STRCACHE2
    220220        bar_len += strlen (dep_name (d)) + 1;
    221221#else
    222         bar_len += strcache_get_len (dep_name (d)) + 1;
     222        bar_len += strcache2_get_len (&file_strcache, dep_name (d)) + 1;
    223223#endif
    224224    if (bar_len == 0)
     
    249249        else
    250250#endif
    251 #ifndef CONFIG_WITH_VALUE_LENGTH
     251#ifndef CONFIG_WITH_STRCACHE2
    252252          len = strlen (c);
    253253#else
    254           len = strcache_get_len (c);
     254          len = strcache2_get_len (&file_strcache, c);
    255255#endif
    256256
  • trunk/src/kmk/file.c

    r1897 r1898  
    414414   unsigned int len;
    415415   char *tmp_name = allocated_variable_expand_2 (
    416        f->name, strcache_get_len(f->name), &len);
     416       f->name, strcache2_get_len (&file_strcache, f->name), &len);
    417417   const char *name = strcache_add_len (tmp_name, len);
    418418   free (tmp_name);
     
    619619          p = variable_expand ("");
    620620          buffer_offset = p - variable_buffer;
    621 #ifndef CONFIG_WITH_VALUE_LENGTH
     621#ifndef CONFIG_WITH_STRCACHE2
    622622          variable_buffer_output (p, d->name, strlen (d->name) + 1);
    623623#else
    624           len = strcache_get_len (d->name);
     624          len = strcache2_get_len (&file_strcache, d->name);
    625625          variable_buffer_output (p, d->name, len + 1);
    626626#endif
     
    660660          set_file_variables (f);
    661661
    662 #ifndef CONFIG_WITH_VALUE_LENGTH
     662#ifndef CONFIG_WITH_STRCACHE2
    663663          p = variable_expand_for_file (d->name, f);
    664664#else
    665           len = strcache_get_len (d->name);
     665          len = strcache2_get_len (&file_strcache, d->name);
    666666          p = variable_expand_for_file_2 (NULL, d->name, len, f, &len);
    667667#endif
     
    693693              percent = find_percent (nm);
    694694#else  /* KMK - don't make a stack copy unless it's actually required! */
    695               unsigned int nl = strcache_get_len (dp->name);
     695              unsigned int nl = strcache2_get_len (&file_strcache, dp->name);
    696696              char *nm;
    697697              percent = memchr (dp->name, '%', nl);
  • trunk/src/kmk/read.c

    r1867 r1898  
    15401540                    for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next)
    15411541                      {
    1542 #ifndef CONFIG_WITH_VALUE_LENGTH
     1542#ifndef CONFIG_WITH_STRCACHE2
    15431543                        unsigned int l = strlen (dep_name (d2));
    15441544#else
    1545                         unsigned int l = strcache_get_len (dep_name (d2));
     1545                        unsigned int l = strcache2_get_len (&file_strcache, dep_name (d2));
    15461546#endif
    15471547                        if (!strneq (name, dep_name (d2), l))
     
    21542154
    21552155/* Remove duplicate dependencies in CHAIN.  */
    2156 #ifndef CONFIG_WITH_VALUE_LENGTH
     2156#ifndef CONFIG_WITH_STRCACHE2
    21572157
    21582158static unsigned long
     
    21852185}
    21862186
    2187 #else  /* CONFIG_WITH_VALUE_LENGTH */
     2187#else  /* CONFIG_WITH_STRCACHE2 */
    21882188
    21892189/* Exploit the fact that all names are in the string cache. This means equal
     
    21962196{
    21972197  const char *name = dep_name ((struct dep const *) key);
    2198   assert (strcache_iscached (name));
     2198  assert (strcache2_is_cached (&file_strcache, name));
    21992199  return (size_t) name / sizeof(void *);
    22002200}
     
    22042204{
    22052205  const char *name = dep_name ((struct dep const *) key);
    2206   return strcache_get_len (name);
     2206  return strcache2_get_len (&file_strcache, name);
    22072207}
    22082208
     
    22172217
    22182218  /* check preconds: both cached and the cache contains no duplicates. */
    2219   assert (strcache_iscached (dxname));
    2220   assert (strcache_iscached (dyname));
     2219  assert (strcache2_is_cached (&file_strcache, dxname));
     2220  assert (strcache2_is_cached (&file_strcache, dyname));
    22212221  assert (cmp == 0 || strcmp (dxname, dyname) != 0);
    22222222
     
    22312231}
    22322232
    2233 #endif /* CONFIG_WITH_VALUE_LENGTH */
     2233#endif /* CONFIG_WITH_STRCACHE2 */
    22342234
    22352235void
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette