[RFC PATCH 9/9] msvcrt: Make _iswctype_l use _pwctype table.

Jeff Smith whydoubt at gmail.com
Thu Jan 9 00:53:49 CST 2020


Signed-off-by: Jeff Smith <whydoubt at gmail.com>
---
 dlls/msvcr120/tests/msvcr120.c | 10 ++++------
 dlls/msvcrt/tests/string.c     | 10 ++++------
 dlls/msvcrt/wcs.c              |  2 +-
 dlls/ucrtbase/tests/misc.c     | 10 ++++------
 dlls/ucrtbase/tests/string.c   | 10 ++++------
 5 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c
index 9d8a5f0321..d6444a07e7 100644
--- a/dlls/msvcr120/tests/msvcr120.c
+++ b/dlls/msvcr120/tests/msvcr120.c
@@ -1102,7 +1102,7 @@ static void test_iswctype(void)
         base_wctype[c] = p_iswctype(c, 0xffff);
         types |= base_wctype[c];
     }
-    todo_wine ok(types == 0x1ff, "Unexpected wctype bits present\n");
+    ok(types == 0x1ff, "Unexpected wctype bits present\n");
 
     for (c = 0x100; c <= 0xffff; c++)
     {
@@ -1113,11 +1113,9 @@ static void test_iswctype(void)
 
     for (i = 0; i < ARRAY_SIZE(iswctype_tests); i++)
     {
-        todo_wine {
-            ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
-                "Unexpected wctype %#x for char %#x\n",
-                base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
-        }
+        ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
+            "Unexpected wctype %#x for char %#x\n",
+            base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
     }
 
     if (!p__iswctype_l || !p_create_locale)
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 3e52d56f00..d3fb2b37de 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -4083,7 +4083,7 @@ static void test_iswctype(void)
         base_wctype[c] = p_iswctype(c, 0xffff);
         types |= base_wctype[c];
     }
-    todo_wine ok(types == 0x1ff, "Unexpected wctype bits present\n");
+    ok(types == 0x1ff, "Unexpected wctype bits present\n");
 
     for (c = 0x100; c <= 0xffff; c++)
     {
@@ -4094,11 +4094,9 @@ static void test_iswctype(void)
 
     for (i = 0; i < ARRAY_SIZE(iswctype_tests); i++)
     {
-        todo_wine {
-            ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
-                "Unexpected wctype %#x for char %#x\n",
-                base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
-        }
+        ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
+            "Unexpected wctype %#x for char %#x\n",
+            base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
     }
 
     if (!p__iswctype_l || !p__create_locale)
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 87e658f509..2eba571726 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -2025,7 +2025,7 @@ int CDECL MSVCRT__iswxdigit_l( MSVCRT_wchar_t wc, MSVCRT__locale_t locale )
  */
 INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale )
 {
-    return (get_char_typeW(wc) & 0xfff) & type;
+    return (wc <= 0xff ? MSVCRT__pwctype[wc] : get_char_typeW(wc) & 0xfff) & type;
 }
 
 /*********************************************************************
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index f637997a0d..c186cca1a4 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -647,17 +647,15 @@ static void test_isblank(void)
     for(c = 0; c <= 0xffff; c++) {
         if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) {
             if(c == '\t')
-                todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
+                ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
             else
                 ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c);
             ok(p_iswblank(c), "%d should be blank\n", c);
             ok(p__iswblank_l(c, NULL), "%d should be blank\n", c);
         } else {
-            todo_wine_if(c == 0xa0) {
-                ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
-                ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
-                ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
-            }
+            ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
+            ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
+            ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
         }
     }
 }
diff --git a/dlls/ucrtbase/tests/string.c b/dlls/ucrtbase/tests/string.c
index 2a77d8882a..3aa6ec9a0b 100644
--- a/dlls/ucrtbase/tests/string.c
+++ b/dlls/ucrtbase/tests/string.c
@@ -434,7 +434,7 @@ static void test_iswctype(void)
         base_wctype[c] = p_iswctype(c, 0xffff);
         types |= base_wctype[c];
     }
-    todo_wine ok(types == 0x1ff, "Unexpected wctype bits present\n");
+    ok(types == 0x1ff, "Unexpected wctype bits present\n");
 
     for (c = 0x100; c <= 0xffff; c++)
     {
@@ -445,11 +445,9 @@ static void test_iswctype(void)
 
     for (i = 0; i < ARRAY_SIZE(iswctype_tests); i++)
     {
-        todo_wine {
-            ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
-                "Unexpected wctype %#x for char %#x\n",
-                base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
-        }
+        ok(base_wctype[iswctype_tests[i].c] == iswctype_tests[i].wctype,
+            "Unexpected wctype %#x for char %#x\n",
+            base_wctype[iswctype_tests[i].c], iswctype_tests[i].c);
     }
 
     for (i = 0; i < ARRAY_SIZE(locales); i++)
-- 
2.23.0




More information about the wine-devel mailing list