Просмотр исходного кода

Removed __PHYSFS_stricmpASCII functions.

Nothing was using them, except one OS/2 thing that could live with stricmp.
Ryan C. Gordon 8 лет назад
Родитель
Сommit
b082bc3432
3 измененных файлов с 2 добавлено и 55 удалено
  1. 0 12
      src/physfs_internal.h
  2. 2 2
      src/physfs_platform_os2.c
  3. 0 41
      src/physfs_unicode.c

+ 0 - 12
src/physfs_internal.h

@@ -290,18 +290,6 @@ void __PHYSFS_sort(void *entries, size_t max,
     ((s) < (__PHYSFS_UI64(0xFFFFFFFFFFFFFFFF) >> (64-(sizeof(size_t)*8)))) \
     ((s) < (__PHYSFS_UI64(0xFFFFFFFFFFFFFFFF) >> (64-(sizeof(size_t)*8)))) \
 )
 )
 
 
-/*
- * stricmp() that guarantees to only work with low ASCII. The C runtime
- *  stricmp() might try to apply a locale/codepage/etc, which we don't want.
- */
-int __PHYSFS_stricmpASCII(const char *s1, const char *s2);
-
-/*
- * strnicmp() that guarantees to only work with low ASCII. The C runtime
- *  strnicmp() might try to apply a locale/codepage/etc, which we don't want.
- */
-int __PHYSFS_strnicmpASCII(const char *s1, const char *s2, PHYSFS_uint32 l);
-
 /*
 /*
  * Like strdup(), but uses the current PhysicsFS allocator.
  * Like strdup(), but uses the current PhysicsFS allocator.
  */
  */

+ 2 - 2
src/physfs_platform_os2.c

@@ -202,8 +202,8 @@ static char *cvtPathToCorrectCase(char *buf)
             {
             {
                 int cmp;
                 int cmp;
                 char *utf8 = cvtCodepageToUtf8(fb.achName);
                 char *utf8 = cvtCodepageToUtf8(fb.achName);
-                if (!utf8) /* ugh, maybe we'll get lucky and it's ASCII */
-                    cmp = __PHYSFS_stricmpASCII(utf8, fname);
+                if (!utf8) /* ugh, maybe we'll get lucky with the C runtime. */
+                    cmp = stricmp(utf8, fname);
                 else
                 else
                 {
                 {
                     cmp = PHYSFS_utf8stricmp(utf8, fname);
                     cmp = PHYSFS_utf8stricmp(utf8, fname);

+ 0 - 41
src/physfs_unicode.c

@@ -533,46 +533,5 @@ int PHYSFS_utf8stricmp(const char *str1, const char *str2)
     return 0;
     return 0;
 } /* PHYSFS_utf8stricmp */
 } /* PHYSFS_utf8stricmp */
 
 
-
-int __PHYSFS_stricmpASCII(const char *str1, const char *str2)
-{
-    while (1)
-    {
-        const char ch1 = *(str1++);
-        const char ch2 = *(str2++);
-        const char cp1 = ((ch1 >= 'A') && (ch1 <= 'Z')) ? (ch1+32) : ch1;
-        const char cp2 = ((ch2 >= 'A') && (ch2 <= 'Z')) ? (ch2+32) : ch2;
-        if (cp1 < cp2)
-            return -1;
-        else if (cp1 > cp2)
-            return 1;
-        else if (cp1 == 0)  /* they're both null chars? */
-            break;
-    } /* while */
-
-    return 0;
-} /* __PHYSFS_stricmpASCII */
-
-
-int __PHYSFS_strnicmpASCII(const char *str1, const char *str2, PHYSFS_uint32 n)
-{
-    while (n-- > 0)
-    {
-        const char ch1 = *(str1++);
-        const char ch2 = *(str2++);
-        const char cp1 = ((ch1 >= 'A') && (ch1 <= 'Z')) ? (ch1+32) : ch1;
-        const char cp2 = ((ch2 >= 'A') && (ch2 <= 'Z')) ? (ch2+32) : ch2;
-        if (cp1 < cp2)
-            return -1;
-        else if (cp1 > cp2)
-            return 1;
-        else if (cp1 == 0)  /* they're both null chars? */
-            return 0;
-    } /* while */
-
-    return 0;
-} /* __PHYSFS_strnicmpASCII */
-
-
 /* end of physfs_unicode.c ... */
 /* end of physfs_unicode.c ... */