[haiku-commits] r39380 - in haiku/trunk/src/system/libroot/posix/glibc: ctype iconv

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 9 Nov 2010 22:36:35 +0100 (CET)

Author: zooey
Date: 2010-11-09 22:36:35 +0100 (Tue, 09 Nov 2010)
New Revision: 39380
Changeset: http://dev.haiku-os.org/changeset/39380
Ticket: http://dev.haiku-os.org/ticket/6740

Modified:
   haiku/trunk/src/system/libroot/posix/glibc/ctype/ctype.h
   haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_charset.h
   haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_conf.c
   haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_int.h
Log:
Fix #6740:
* remove declaration of ctype-..._l() functions, as we do not provide
  them and they are not really needed by our hacked glibc
* replace remaining invocations of isspace_l() and isupper_l() in glibc
  with isspace() and isupper() respectively
This allows libroot to be built in DEBUG mode, again.

Modified: haiku/trunk/src/system/libroot/posix/glibc/ctype/ctype.h
===================================================================
--- haiku/trunk/src/system/libroot/posix/glibc/ctype/ctype.h    2010-11-09 
20:34:59 UTC (rev 39379)
+++ haiku/trunk/src/system/libroot/posix/glibc/ctype/ctype.h    2010-11-09 
21:36:35 UTC (rev 39380)
@@ -192,87 +192,6 @@
 
 #endif /* Not __NO_CTYPE.  */
 
-
-#ifdef __USE_GNU
-/* The concept of one static locale per category is not very well
-   thought out.  Many applications will need to process its data using
-   information from several different locales.  Another application is
-   the implementation of the internationalization handling in the
-   upcoming ISO C++ standard library.  To support this another set of
-   the functions using locale data exist which have an additional
-   argument.
-
-   Attention: all these functions are *not* standardized in any form.
-   This is a proof-of-concept implementation.  */
-
-/* Structure for reentrant locale using functions.  This is an
-   (almost) opaque type for the user level programs.  */
-# include <xlocale.h>
-
-/* These definitions are similar to the ones above but all functions
-   take as an argument a handle for the locale which shall be used.  */
-#  define __isctype_l(c, type, locale) \
-  ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
-
-# define __exctype_l(name)     extern int name (int, __locale_t) __THROW
-
-/* The following names are all functions:
-     int isCHARACTERISTIC(int c, locale_t *locale);
-   which return nonzero iff C has CHARACTERISTIC.
-   For the meaning of the characteristic names, see the `enum' above.  */
-__exctype_l (__isalnum_l);
-__exctype_l (__isalpha_l);
-__exctype_l (__iscntrl_l);
-__exctype_l (__isdigit_l);
-__exctype_l (__islower_l);
-__exctype_l (__isgraph_l);
-__exctype_l (__isprint_l);
-__exctype_l (__ispunct_l);
-__exctype_l (__isspace_l);
-__exctype_l (__isupper_l);
-__exctype_l (__isxdigit_l);
-
-__exctype_l (__isblank_l);
-
-
-/* Return the lowercase version of C in locale L.  */
-extern int __tolower_l (int __c, __locale_t __l) __THROW;
-
-/* Return the uppercase version of C in locale L.  */
-extern int __toupper_l (int __c, __locale_t __l) __THROW;
-
-# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
-#  define __tolower_l(c, locale) \
-  __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale))
-#  define __toupper_l(c, locale) \
-  __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale))
-# endif        /* Optimizing gcc */
-
-
-# ifndef __NO_CTYPE
-#  define __isalnum_l(c,l)     __isctype_l((c), _ISalnum, (l))
-#  define __isalpha_l(c,l)     __isctype_l((c), _ISalpha, (l))
-#  define __iscntrl_l(c,l)     __isctype_l((c), _IScntrl, (l))
-#  define __isdigit_l(c,l)     __isctype_l((c), _ISdigit, (l))
-#  define __islower_l(c,l)     __isctype_l((c), _ISlower, (l))
-#  define __isgraph_l(c,l)     __isctype_l((c), _ISgraph, (l))
-#  define __isprint_l(c,l)     __isctype_l((c), _ISprint, (l))
-#  define __ispunct_l(c,l)     __isctype_l((c), _ISpunct, (l))
-#  define __isspace_l(c,l)     __isctype_l((c), _ISspace, (l))
-#  define __isupper_l(c,l)     __isctype_l((c), _ISupper, (l))
-#  define __isxdigit_l(c,l)    __isctype_l((c), _ISxdigit, (l))
-
-#  define __isblank_l(c,l)     __isctype_l((c), _ISblank, (l))
-
-#  if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
-#   define __isascii_l(c,l)    __isascii(c)
-#   define __toascii_l(c,l)    __toascii(c)
-#  endif
-
-# endif /* Not __NO_CTYPE.  */
-
-#endif /* Use GNU.  */
-
 __END_DECLS
 
 #endif /* ctype.h  */

Modified: haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_charset.h
===================================================================
--- haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_charset.h    
2010-11-09 20:34:59 UTC (rev 39379)
+++ haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_charset.h    
2010-11-09 21:36:35 UTC (rev 39380)
@@ -29,9 +29,9 @@
 
   while (*s != '\0')
     {
-      if (__isalnum_l (*s, &_nl_C_locobj)
+      if (isalnum(*s)
          || *s == '_' || *s == '-' || *s == '.')
-       *wp++ = __toupper_l (*s, &_nl_C_locobj);
+       *wp++ = toupper(*s);
       else if (*s == '/')
        {
          if (++slash_count == 3)
@@ -52,7 +52,7 @@
 upstr (char *dst, const char *str)
 {
   char *cp = dst;
-  while ((*cp++ = __toupper_l (*str++, &_nl_C_locobj)) != '\0')
+  while ((*cp++ = toupper(*str++)) != '\0')
     /* nothing */;
   return dst;
 }

Modified: haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_conf.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_conf.c       
2010-11-09 20:34:59 UTC (rev 39379)
+++ haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_conf.c       
2010-11-09 21:36:35 UTC (rev 39380)
@@ -132,20 +132,20 @@
   struct gconv_alias *new_alias;
   char *from, *to, *wp;
 
-  while (__isspace_l (*rp, &_nl_C_locobj))
+  while (isspace(*rp))
     ++rp;
   from = wp = rp;
-  while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
-    *wp++ = __toupper_l (*rp++, &_nl_C_locobj);
+  while (*rp != '\0' && !isspace(*rp))
+    *wp++ = toupper (*rp++);
   if (*rp == '\0')
     /* There is no `to' string on the line.  Ignore it.  */
     return;
   *wp++ = '\0';
   to = ++rp;
-  while (__isspace_l (*rp, &_nl_C_locobj))
+  while (isspace(*rp))
     ++rp;
-  while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
-    *wp++ = __toupper_l (*rp++, &_nl_C_locobj);
+  while (*rp != '\0' && !isspace(*rp))
+    *wp++ = toupper (*rp++);
   if (to == wp)
     /* No `to' string, ignore the line.  */
     return;
@@ -253,30 +253,30 @@
   int need_ext;
   int cost_hi;
 
-  while (__isspace_l (*rp, &_nl_C_locobj))
+  while (isspace(*rp))
     ++rp;
   from = rp;
-  while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
+  while (*rp != '\0' && !isspace(*rp))
     {
-      *rp = __toupper_l (*rp, &_nl_C_locobj);
+      *rp = toupper(*rp);
       ++rp;
     }
   if (*rp == '\0')
     return;
   *rp++ = '\0';
   to = wp = rp;
-  while (__isspace_l (*rp, &_nl_C_locobj))
+  while (isspace(*rp))
     ++rp;
-  while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
-    *wp++ = __toupper_l (*rp++, &_nl_C_locobj);
+  while (*rp != '\0' && !isspace(*rp))
+    *wp++ = toupper(*rp++);
   if (*rp == '\0')
     return;
   *wp++ = '\0';
   do
     ++rp;
-  while (__isspace_l (*rp, &_nl_C_locobj));
+  while (isspace(*rp));
   module = wp;
-  while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
+  while (*rp != '\0' && !isspace(*rp))
     *wp++ = *rp++;
   if (*rp == '\0')
     {
@@ -389,7 +389,7 @@
        if (rp[n - 1] == '\n')
          rp[n - 1] = '\0';
 
-      while (__isspace_l (*rp, &_nl_C_locobj))
+      while (isspace(*rp))
        ++rp;
 
       /* If this is an empty line go on with the next one.  */
@@ -397,7 +397,7 @@
        continue;
 
       word = rp;
-      while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj))
+      while (*rp != '\0' && !isspace(*rp))
        ++rp;
 
       if (rp - word == sizeof ("alias") - 1

Modified: haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_int.h
===================================================================
--- haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_int.h        
2010-11-09 20:34:59 UTC (rev 39379)
+++ haiku/trunk/src/system/libroot/posix/glibc/iconv/gconv_int.h        
2010-11-09 21:36:35 UTC (rev 39380)
@@ -142,7 +142,7 @@
     tmp = result = __alloca (cp - (str) + 3 + suffix_len);                   \
     cp = (str);                                                                
      \
     while (*cp != '\0')                                                        
      \
-      *tmp++ = __toupper_l (*cp++, &_nl_C_locobj);                           \
+      *tmp++ = toupper(*cp++);                       \
     if (cnt < 2)                                                             \
       {                                                                        
      \
        *tmp++ = '/';                                                         \


Other related posts:

  • » [haiku-commits] r39380 - in haiku/trunk/src/system/libroot/posix/glibc: ctype iconv - zooey