]> pd.if.org Git - pdclib.old/blobdiff - functions/wctype/towupper.c
Compress the Unicode data into runs. This results in a significant size reduction.
[pdclib.old] / functions / wctype / towupper.c
index faac657501cac24ec24b262673befcdb97f5713f..e9f99a54380791176a7a47dba0db075e6af1409a 100644 (file)
@@ -8,15 +8,20 @@
 #ifndef REGTEST\r
 #include <_PDCLIB_locale.h>\r
 \r
-wint_t towupper( wint_t wc )\r
+wint_t _PDCLIB_towupper_l( wint_t wc, locale_t l )\r
 {\r
     wint_t uwc = _PDCLIB_unpackwint( wc );\r
-    _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( uwc );\r
-    if( info && info->upper != uwc \r
+    _PDCLIB_wcinfo_t *info = _PDCLIB_wcgetinfo( l, uwc );\r
+    if( info ) \r
     {\r
-        wc = info->upper;\r
+        uwc += info->upper_delta;\r
     }\r
-    return wc;\r
+    return uwc;\r
+}\r
+\r
+wint_t towupper( wint_t wc )\r
+{\r
+    return _PDCLIB_towupper_l( wc, _PDCLIB_threadlocale() );\r
 }\r
 \r
 #endif\r