OSDN Git Service

Hide my personal #warning reminders. Add __wcschrnul, rename strchrnul
authorManuel Novoa III <mjn3@codepoet.org>
Thu, 19 Sep 2002 17:30:05 +0000 (17:30 -0000)
committerManuel Novoa III <mjn3@codepoet.org>
Thu, 19 Sep 2002 17:30:05 +0000 (17:30 -0000)
to __strchrnul, and add weak aliases for them.

include/string.h
libc/misc/locale/locale.c
libc/misc/wchar/wchar.c
libc/misc/wctype/wctype.c
libc/stdlib/stdlib.c
libc/string/Makefile
libc/string/wstring.c

index edcdf19..872ccca 100644 (file)
@@ -62,8 +62,7 @@ extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
 extern void *memchr (__const void *__s, int __c, size_t __n)
       __THROW __attribute_pure__;
 
-/*#ifdef __USE_GNU*/
-#if 0
+#ifdef __USE_GNU
 /* Search in S for C.  This is similar to `memchr' but there is no
    length limit.  */
 extern void *rawmemchr (__const void *__s, int __c) __THROW __attribute_pure__;
@@ -158,8 +157,7 @@ extern char *strchr (__const char *__s, int __c) __THROW __attribute_pure__;
 /* Find the last occurrence of C in S.  */
 extern char *strrchr (__const char *__s, int __c) __THROW __attribute_pure__;
 
-#if 0
-/*#ifdef __USE_GNU*/
+#ifdef __USE_GNU
 /* This funciton is similar to `strchr'.  But it returns a pointer to
    the closing NUL byte in case C is not found in S.  */
 extern char *strchrnul (__const char *__s, int __c) __THROW __attribute_pure__;
index 689257b..f3c23f9 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifdef __LOCALE_C_ONLY
 
-link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales");
+link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales")
 
 static const char C_string[] = "C";
 
@@ -272,8 +272,7 @@ char *setlocale(int category, const char *locale)
 
 #ifdef __LOCALE_C_ONLY
 
-#warning localeconv is hardwired for C/POSIX locale only
-link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only");
+link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only")
 
 static struct lconv the_lconv;
 
@@ -431,7 +430,9 @@ void _locale_set(const unsigned char *p)
                                        r = CODESET_LIST;
                                        __global_locale.codeset = r + r[c -= 3];
                                        __global_locale.encoding = __ctype_encoding_8_bit;
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning REMINDER: update 8 bit mb_cur_max when trasnlit implemented!
+#endif
                                        /* TODO - update when translit implemented! */
                                        __global_locale.mb_cur_max = 1;
                                        c8b = __locale_mmap->codeset_8_bit + c;
index 4506f4f..cb24f06 100644 (file)
@@ -76,7 +76,9 @@
 
 #ifdef __UCLIBC_HAS_LOCALE__
 #define ENCODING (__global_locale.encoding)
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning implement __CTYPE_HAS_UTF_8_LOCALES!
+#endif
 #define __CTYPE_HAS_UTF_8_LOCALES
 #else
 #undef __CTYPE_HAS_8_BIT_LOCALES
@@ -363,7 +365,9 @@ size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
                --n;
                if ((wc = ((unsigned char) *s++)) >= 0x80) { /* Not ASCII... */
                        mask = 0x40;
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning fix range for 16 bit wides
+#endif
                        if ( ((unsigned char)(s[-1] - 0xc0)) < (0xfe - 0xc0) ) {
                                goto START;
                        }
index 802e979..68b9e45 100644 (file)
@@ -295,11 +295,15 @@ wctype_t wctype(const char *property)
 /**********************************************************************/
 #ifdef L_iswctype
 
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning duh... replace the range-based classification with table lookup!
+#endif
 
 #ifdef __WCTYPE_WITH_LOCALE
 
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning TODO: need to fix locale ctype table lookup stuff
+#endif
 #if 0
 extern const char ctype_range[];
 #else
@@ -308,7 +312,9 @@ static const char ctype_range[] = {
 };
 #endif
 
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning TODO: need to handle combining class!
+#endif
 
 #define WCctype_TI_MASK                ((1 << WCctype_TI_SHIFT) - 1)
 #define WCctype_II_MASK                ((1 << WCctype_II_SHIFT) - 1)
index 3d53089..cc465e7 100644 (file)
@@ -640,7 +640,9 @@ void ssort (void  *base,
 
 #ifdef __UCLIBC_HAS_LOCALE__
 #define ENCODING (__global_locale.encoding)
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning implement __CTYPE_HAS_UTF_8_LOCALES!
+#endif
 #define __CTYPE_HAS_UTF_8_LOCALES
 #else
 #define ENCODING (__ctype_encoding_7_bit)
@@ -661,8 +663,10 @@ size_t _stdlib_mb_cur_max(void)
        return __global_locale.mb_cur_max;
 #else
 #ifdef __CTYPE_HAS_8_BIT_LOCALES
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning need to change this when/if transliteration is implemented
 #endif
+#endif
        return 1;
 #endif
 }
index 6c29bb9..811ec0b 100644 (file)
@@ -38,7 +38,8 @@ MOBJW=  basename.o bcopy.o bzero.o dirname.o ffs.o memccpy.o memchr.o memcmp.o \
 MOBJW2= wcscasecmp.o wcscat.o wcschrnul.o wcschr.o wcscmp.o wcscpy.o wcscspn.o \
        wcsdup.o wcslen.o wcsncasecmp.o wcsncat.o wcsncmp.o wcsncpy.o \
        wcsnlen.o wcspbrk.o wcsrchr.o wcsspn.o wcsstr.o wcstok.o wmemchr.o \
-       wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o
+       wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o \
+       wcschrnul.o
 
 # wcscoll wcsxfrm
 
index 8a82063..ab6bd41 100644 (file)
@@ -366,7 +366,7 @@ const char *const sys_errlist[] = {
 #endif
 
 #if EWOULDBLOCK != EAGAIN
-#warning EWOULDBLOCK does not equal EAGAIN
+#error EWOULDBLOCK does not equal EAGAIN
 #endif
 
        /* For now, ignore the other arch-specific errors.  glibc only maps EPROCLIM. */
@@ -628,7 +628,9 @@ int Wmemcmp(const Wvoid *s1, const Wvoid *s2, size_t n)
 #ifdef L_strcmp
 
 #ifndef L_wcscmp
+#ifdef __UCLIBC_MJN3_ONLY__
 #warning implement strcoll and remove weak alias (or enable for C locale only)
+#endif
 weak_alias(strcmp,strcoll);
 #endif
 
@@ -1750,14 +1752,19 @@ char *strsep(char ** __restrict s1, const char * __restrict s2)
 /**********************************************************************/
 #ifdef L_wcschrnul
 #define L_strchrnul
+#define __Wstrchrnul __wcschrnul
 #define Wstrchrnul wcschrnul
 #else
+#define __Wstrchrnul __strchrnul
 #define Wstrchrnul strchrnul
 #endif
 
 #ifdef L_strchrnul
 
-Wchar *Wstrchrnul(register const Wchar *s, Wint c)
+extern Wchar *__Wstrchrnul(register const Wchar *s, Wint c);
+weak_alias(__Wstrchrnul, Wstrchrnul);
+
+Wchar *__Wstrchrnul(register const Wchar *s, Wint c)
 {
        --s;
        while (*++s && (*s != ((Wchar)c)));