* libc/ctype/ctype_c.c: Move inclusion of ctype_iso.h and
ctype_cp.h out of ALLOW_NEGATIVE_CTYPE_INDEX case. (__ctype_ptr__): Constify in !_MB_CAPABLE case. Otherwise, de-constify in !ALLOW_NEGATIVE_CTYPE_INDEX case, too. Add comment. (__set_ctype): Set __ctype_ptr__ pointer according to definition of ALLOW_NEGATIVE_CTYPE_INDEX. * libc/include/ctype.h (__ctype_ptr__): Constify in !_MB_CAPABLE case.
This commit is contained in:
parent
cd767078de
commit
72c79be10e
|
@ -1,3 +1,13 @@
|
|||
2009-04-02 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* libc/ctype/ctype_c.c: Move inclusion of ctype_iso.h and
|
||||
ctype_cp.h out of ALLOW_NEGATIVE_CTYPE_INDEX case.
|
||||
(__ctype_ptr__): Constify in !_MB_CAPABLE case. Otherwise,
|
||||
de-constify in !ALLOW_NEGATIVE_CTYPE_INDEX case, too. Add comment.
|
||||
(__set_ctype): Set __ctype_ptr__ pointer according to definition
|
||||
of ALLOW_NEGATIVE_CTYPE_INDEX.
|
||||
* libc/include/ctype.h (__ctype_ptr__): Constify in !_MB_CAPABLE case.
|
||||
|
||||
2009-03-31 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* libc/ctype/Makefile.am: Remove _tolower.c and _toupper.c
|
||||
|
|
|
@ -77,6 +77,15 @@ static char sccsid[] = "@(#)ctype_.c 5.6 (Berkeley) 6/1/90";
|
|||
#define ALLOW_NEGATIVE_CTYPE_INDEX
|
||||
#endif
|
||||
|
||||
#if defined(_MB_CAPABLE)
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO)
|
||||
#include "ctype_iso.h"
|
||||
#endif
|
||||
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
#include "ctype_cp.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
/* No static const on Cygwin since it's referenced and potentially overwritten
|
||||
for compatibility with older applications. */
|
||||
|
@ -89,16 +98,10 @@ char _ctype_b[128 + 256] = {
|
|||
_CTYPE_DATA_128_256
|
||||
};
|
||||
|
||||
#if defined(_MB_CAPABLE)
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO)
|
||||
#include "ctype_iso.h"
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
#include "ctype_cp.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
char __EXPORT *__ctype_ptr__ = _ctype_b + 127;
|
||||
char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
|
||||
|
@ -120,7 +123,7 @@ _CONST char _ctype_[1 + 256] = {
|
|||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_DATA_128_256
|
||||
};
|
||||
# endif /* !_HAVE_ARRAY_ALIASING */
|
||||
# endif /* !_HAVE_ARRAY_ALIASING */
|
||||
|
||||
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
|
||||
|
||||
|
@ -130,7 +133,11 @@ _CONST char _ctype_[1 + 256] = {
|
|||
_CTYPE_DATA_128_256
|
||||
};
|
||||
|
||||
_CONST char *__ctype_ptr__ = _ctype_;
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
char *__ctype_ptr__ = (char *) _ctype_;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MB_CAPABLE)
|
||||
|
@ -140,7 +147,9 @@ _CONST char *__ctype_ptr__ = _ctype_;
|
|||
void
|
||||
__set_ctype (const char *charset)
|
||||
{
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO) || defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
int idx;
|
||||
#endif
|
||||
|
||||
switch (*charset)
|
||||
{
|
||||
|
@ -154,7 +163,11 @@ __set_ctype (const char *charset)
|
|||
idx = 0;
|
||||
else
|
||||
++idx;
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
__ctype_ptr__ = (char *) (__ctype_iso[idx] + 127);
|
||||
# else
|
||||
__ctype_ptr__ = (char *) __ctype_iso[idx];
|
||||
# endif
|
||||
return;
|
||||
#endif
|
||||
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
|
@ -162,13 +175,21 @@ __set_ctype (const char *charset)
|
|||
idx = __cp_index (charset + 2);
|
||||
if (idx < 0)
|
||||
break;
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
__ctype_ptr__ = (char *) (__ctype_cp[idx] + 127);
|
||||
# else
|
||||
__ctype_ptr__ = (char *) __ctype_cp[idx];
|
||||
# endif
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
__ctype_ptr__ = (char *) _ctype_b + 127;
|
||||
# else
|
||||
__ctype_ptr__ = (char *) _ctype_;
|
||||
# endif
|
||||
}
|
||||
#endif /* !__CYGWIN__ */
|
||||
#endif /* _MB_CAPABLE */
|
||||
|
|
|
@ -39,6 +39,9 @@ int _EXFUN(toascii, (int __c));
|
|||
#define _X 0100
|
||||
#define _B 0200
|
||||
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
extern __IMPORT char *__ctype_ptr__;
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue