Ignore:
Timestamp:
Oct 3, 2017, 12:24:58 AM (8 years ago)
Author:
bird
Message:

strcache2.c: fixed HAVE_CASE_INSENSITIVE_FS case (unused)

File:
1 edited

Legend:

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

    r3068 r3084  
    9393
    9494
     95#ifndef STRCACHE2_USE_MASK
    9596/** Finds the closest primary number for power of two value (or something else
    9697 *  useful if not support).   */
     
    124125    }
    125126}
     127#endif
    126128
    127129/* The following is a bit experiment. It produces longer chains, i.e. worse
     
    411413}
    412414
     415#if 0
    413416MY_INLINE int
    414417strcache2_memcmp_inline_short (const char *xs, const char *ys, unsigned int length)
     
    485488  return memcmp (xs, ys, length);
    486489}
     490#endif
    487491
    488492MY_INLINE int
     
    612616}
    613617
     618#if defined(HAVE_CASE_INSENSITIVE_FS)
    614619MY_INLINE int
    615620strcache2_is_iequal (struct strcache2 *cache, struct strcache2_entry const *entry,
     
    623628      return 0;
    624629
    625 #if defined(_MSC_VER) || defined(__OS2__)
     630# if defined(_MSC_VER) || defined(__OS2__)
    626631  return _memicmp (entry + 1, str, length) == 0;
    627 #else
     632# else
    628633  return strncasecmp ((const char *)(entry + 1), str, length) == 0;
    629 #endif
    630 }
     634# endif
     635}
     636#endif /* HAVE_CASE_INSENSITIVE_FS */
    631637
    632638static void
     
    915921  if (!entry)
    916922    return strcache2_enter_string (cache, idx, str, length, hash);
    917   if (strcache2_is_equal (cache, entry, str, length, hash))
     923  if (strcache2_is_iequal (cache, entry, str, length, hash))
    918924    return (const char *)(entry + 1);
    919925  MAKE_STATS (cache->collision_1st_count++);
     
    922928  if (!entry)
    923929    return strcache2_enter_string (cache, idx, str, length, hash);
    924   if (strcache2_is_equal (cache, entry, str, length, hash))
     930  if (strcache2_is_iequal (cache, entry, str, length, hash))
    925931    return (const char *)(entry + 1);
    926932  MAKE_STATS (cache->collision_2nd_count++);
     
    932938      if (!entry)
    933939        return strcache2_enter_string (cache, idx, str, length, hash);
    934       if (strcache2_is_equal (cache, entry, str, length, hash))
     940      if (strcache2_is_iequal (cache, entry, str, length, hash))
    935941        return (const char *)(entry + 1);
    936942      MAKE_STATS (cache->collision_3rd_count++);
     
    964970  if (!entry)
    965971    return strcache2_enter_string (cache, idx, str, length, hash);
    966   if (strcache2_is_equal (cache, entry, str, length, hash))
     972  if (strcache2_is_iequal (cache, entry, str, length, hash))
    967973    return (const char *)(entry + 1);
    968974  MAKE_STATS (cache->collision_1st_count++);
     
    971977  if (!entry)
    972978    return strcache2_enter_string (cache, idx, str, length, hash);
    973   if (strcache2_is_equal (cache, entry, str, length, hash))
     979  if (strcache2_is_iequal (cache, entry, str, length, hash))
    974980    return (const char *)(entry + 1);
    975981  MAKE_STATS (cache->collision_2nd_count++);
     
    981987      if (!entry)
    982988        return strcache2_enter_string (cache, idx, str, length, hash);
    983       if (strcache2_is_equal (cache, entry, str, length, hash))
     989      if (strcache2_is_iequal (cache, entry, str, length, hash))
    984990        return (const char *)(entry + 1);
    985991      MAKE_STATS (cache->collision_3rd_count++);
     
    10071013  if (!entry)
    10081014    return NULL;
    1009   if (strcache2_is_equal (cache, entry, str, length, hash))
     1015  if (strcache2_is_iequal (cache, entry, str, length, hash))
    10101016    return (const char *)(entry + 1);
    10111017  MAKE_STATS (cache->collision_1st_count++);
     
    10141020  if (!entry)
    10151021    return NULL;
    1016   if (strcache2_is_equal (cache, entry, str, length, hash))
     1022  if (strcache2_is_iequal (cache, entry, str, length, hash))
    10171023    return (const char *)(entry + 1);
    10181024  MAKE_STATS (cache->collision_2nd_count++);
     
    10241030      if (!entry)
    10251031        return NULL;
    1026       if (strcache2_is_equal (cache, entry, str, length, hash))
     1032      if (strcache2_is_iequal (cache, entry, str, length, hash))
    10271033        return (const char *)(entry + 1);
    10281034      MAKE_STATS (cache->collision_3rd_count++);
Note: See TracChangeset for help on using the changeset viewer.