]> sourceware.org Git - newlib-cygwin.git/commitdiff
* libc/ctype/local.h (JP_JIS, JP_SJIS, JP_EUCJP): Move definition
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 14 May 2009 20:16:21 +0000 (20:16 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 14 May 2009 20:16:21 +0000 (20:16 +0000)
to jp2uc.c.
(__jp2uc): Remove declaration.
(_jp2uc): Declare.
* libc/ctype/jp2uc.c (JP_JIS, JP_SJIS, JP_EUCJP): Define.
(__jp2uc): Remove Cygwin special case.
(_jp2uc): New function.  On Cygwin, just return c.
* libc/ctype/iswalpha.c (iswalpha): Just call _jp2uc.
* libc/ctype/iswblank.c (iswblank): Ditto.
* libc/ctype/iswcntrl.c (iswcntrl): Ditto.
* libc/ctype/iswprint.c (iswprint): Ditto.
* libc/ctype/iswpunct.c (iswpunt): Ditto.
* libc/ctype/iswspace.c (iswspace): Ditto.
* libc/ctype/towlower.c (towlower): Ditto.
* libc/ctype/towupper.c (towupper): Ditto.

newlib/ChangeLog
newlib/libc/ctype/iswalpha.c
newlib/libc/ctype/iswblank.c
newlib/libc/ctype/iswcntrl.c
newlib/libc/ctype/iswprint.c
newlib/libc/ctype/iswpunct.c
newlib/libc/ctype/iswspace.c
newlib/libc/ctype/jp2uc.c
newlib/libc/ctype/local.h
newlib/libc/ctype/towlower.c
newlib/libc/ctype/towupper.c

index e7b3680d167e5d86e0027c0696a799530674265d..642ecec61fe7024befac6e9240bd93989908632a 100644 (file)
@@ -1,3 +1,21 @@
+2009-05-14  Corinna Vinschen  <corinna@vinschen.de>
+
+       * libc/ctype/local.h (JP_JIS, JP_SJIS, JP_EUCJP): Move definition
+       to jp2uc.c.
+       (__jp2uc): Remove declaration.
+       (_jp2uc): Declare.
+       * libc/ctype/jp2uc.c (JP_JIS, JP_SJIS, JP_EUCJP): Define.
+       (__jp2uc): Remove Cygwin special case.
+       (_jp2uc): New function.  On Cygwin, just return c.
+       * libc/ctype/iswalpha.c (iswalpha): Just call _jp2uc.
+       * libc/ctype/iswblank.c (iswblank): Ditto.
+       * libc/ctype/iswcntrl.c (iswcntrl): Ditto.
+       * libc/ctype/iswprint.c (iswprint): Ditto.
+       * libc/ctype/iswpunct.c (iswpunt): Ditto.
+       * libc/ctype/iswspace.c (iswspace): Ditto.
+       * libc/ctype/towlower.c (towlower): Ditto.
+       * libc/ctype/towupper.c (towupper): Ditto.
+
 2009-05-13  Paul Brook  <paul@codesourcery.com>
 
        * libc/machine/arm/setjmp.S: Don't bother saving IP.  Copy SP to
index 4e2ad6b0db5aa8911c344e33c89f1e7e86585d3f..ab67857fb512d4ca2abf8c9ac6f32c8d27c7d48d 100644 (file)
@@ -76,12 +76,7 @@ _DEFUN(iswalpha,(c), wint_t c)
   int size;
   wint_t x;
 
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
 
   x = (c >> 8);
   /* for some large sections, all characters are alphabetic so handle them here */
index e0601e945f731069d791f2dff5f6ba2ad11e53a0..5cd37016f7ec4b6b8d9083c4b62787f662063407 100644 (file)
@@ -66,12 +66,7 @@ int
 _DEFUN(iswblank,(c), wint_t c)
 {
 #ifdef _MB_CAPABLE
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
   return (c == 0x0009 || c == 0x0020 || c == 0x1680 ||
          (c >= 0x2000 && c <= 0x2006) ||
          (c >= 0x2008 && c <= 0x200b) ||
index 2d8a1ddd6f3962f27f6a42ef437646935b7cf1b1..94439784f63dcca01edbff4d6f352e72a3fa867d 100644 (file)
@@ -66,12 +66,7 @@ int
 _DEFUN(iswcntrl,(c), wint_t c)
 {
 #ifdef _MB_CAPABLE
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
   return ((c >= 0x0000 && c <= 0x001f) || 
          (c >= 0x007f && c <= 0x009f) ||
          c == 0x2028 || c == 0x2029);
index a632aa4053b144bd7e8bd3a8809dfa2647290d43..055855e7890bbd1b91e94488e87c184fe1c9c49f 100644 (file)
@@ -76,12 +76,7 @@ _DEFUN(iswprint,(c), wint_t c)
   int size;
   wint_t x;
   
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
 
   x = (c >> 8);
   /* for some large sections, all characters are printuation so handle them here */
index fc0bd630feed767b2c5c05cfefaf767eee49ba01..4e9dd88d20b2062b02bf2639fd1b6ac20e9d4e73 100644 (file)
@@ -76,12 +76,7 @@ _DEFUN(iswpunct,(c), wint_t c)
   int size;
   wint_t x;
 
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
 
   x = (c >> 8);
   /* for some large sections, all characters are punctuation so handle them here */
index 100e7822a6cd0979bf7396fc7709a5ff912a3992..a1edbdcef8bd99f32c2a9c095da09e18055f0e3b 100644 (file)
@@ -66,12 +66,7 @@ int
 _DEFUN(iswspace,(c), wint_t c)
 {
 #ifdef _MB_CAPABLE
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
+  c = _jp2uc (c);
   return ((c >= 0x0009 && c <= 0x000d) || c == 0x0020 || c == 0x1680 ||
          (c >= 0x2000 && c <= 0x2006) ||
          (c >= 0x2008 && c <= 0x200b) ||
index d1096442e1b830b45b2f8a2ded51a853ef00216c..77443b8ff6d68b08bb90f4381b5f7237c7750550 100644 (file)
 #include "local.h"
 #include "jp2uc.h"
 
+/* Japanese encoding types supported */
+#define JP_JIS         1
+#define JP_SJIS                2
+#define JP_EUCJP       3
+
 wint_t
 _DEFUN (__jp2uc, (c, type), wint_t c _AND int type)
 {
-/* Under Cygwin, the incoming wide character is already given in UTF due
-   to the requirements of the underlying OS. */
-#ifdef  __CYGWIN__
-  return c;
-#else
   int index, adj;
   unsigned char byte1, byte2;
   wint_t ret;
@@ -145,7 +145,22 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type)
     }
 
   return WEOF; 
+}
+
+wint_t
+_DEFUN (_jp2uc, (c), wint_t c)
+{
+/* Under Cygwin, the incoming wide character is already given in UTF due
+   to the requirements of the underlying OS. */
+#ifndef __CYGWIN__
+  if (!strcmp (__locale_charset (), "JIS"))
+    c = __jp2uc (c, JP_JIS);
+  else if (!strcmp (__locale_charset (), "SJIS"))
+    c = __jp2uc (c, JP_SJIS);
+  else if (!strcmp (__locale_charset (), "EUCJP"))
+    c = __jp2uc (c, JP_EUCJP);
 #endif
+  return c;
 }
 
 #endif /* _MB_CAPABLE */
index 9471607cf4b4c29cfaaeeedcc805955960ad5d09..ab1c7db7107973c1fdc9e70cc69eb1f0da0ba601 100644 (file)
 
 extern char *__locale_charset ();
 
-/* Japanese encoding types supported */
-#define JP_JIS         1
-#define JP_SJIS                2
-#define JP_EUCJP       3
-
 /* internal function to translate JP to Unicode */
-wint_t _EXFUN (__jp2uc, (wint_t, int));
+wint_t _EXFUN (_jp2uc, (wint_t));
 
index edda8ca342205cdc7c214cf1ef0d90ba00d5fdfb..f1ce1f5e0add5664652161ed6e1f4d89e1b5e450 100644 (file)
@@ -70,13 +70,7 @@ wint_t
 _DEFUN(towlower,(c), wint_t c)
 {
 #ifdef _MB_CAPABLE
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
-
+  c = _jp2uc (c);
   if (c < 0x100)
     {
       if ((c >= 0x0041 && c <= 0x005a) ||
index dee9468bd7792b2816eee46d7aac2a64e0cfb03d..945266fea1235dd1bb42b367c1d9fd4ee20a3564 100644 (file)
@@ -70,13 +70,7 @@ wint_t
 _DEFUN(towupper,(c), wint_t c)
 {
 #ifdef _MB_CAPABLE
-  if (!strcmp (__locale_charset (), "JIS"))
-    c = __jp2uc (c, JP_JIS);
-  else if (!strcmp (__locale_charset (), "SJIS"))
-    c = __jp2uc (c, JP_SJIS);
-  else if (!strcmp (__locale_charset (), "EUCJP"))
-    c = __jp2uc (c, JP_EUCJP);
-
+  c = _jp2uc (c);
   if (c < 0x100)
     {
       if (c == 0x00b5)
This page took 0.059003 seconds and 5 git commands to generate.