Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Extend ctype classification table to 16bit. Based on patch by
details: https://anonhg.NetBSD.org/src/rev/d8995ef30407
branches: trunk
changeset: 786067:d8995ef30407
user: joerg <joerg%NetBSD.org@localhost>
date: Sat Apr 13 10:21:20 2013 +0000
description:
Extend ctype classification table to 16bit. Based on patch by
Takehiko Nozaki, with changes to compile fail when using the old names
and to exploit __BUILD_LEGACY
diffstat:
external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h | 14 +-
external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h | 4 +-
gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h | 14 +-
gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h | 4 +-
lib/libc/citrus/citrus_lc_ctype.c | 14 +-
lib/libc/gen/ctype_.c | 101 ++++++++-
lib/libc/gen/isctype.c | 24 +-
lib/libc/locale/ctype_local.h | 22 +-
lib/libc/locale/global_locale.c | 14 +-
lib/libc/locale/rune.c | 60 +++++-
lib/libc/locale/runetable.c | 14 +-
lib/libc/locale/runetype_local.h | 11 +-
lib/libc/locale/runetype_misc.h | 82 --------
lib/libc/locale/setlocale_local.h | 9 +-
lib/libc/shlib_version | 5 +-
sys/sys/ctype_bits.h | 26 +-
sys/sys/ctype_inline.h | 34 +--
17 files changed, 263 insertions(+), 189 deletions(-)
diffs (truncated from 807 to 300 lines):
diff -r 417b982c122a -r d8995ef30407 external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
--- a/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr 13 10:16:27 2013 +0000
+++ b/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr 13 10:21:20 2013 +0000
@@ -41,18 +41,18 @@
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
- typedef unsigned char mask;
+ typedef unsigned short mask;
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
- static const mask alpha = _CTYPE_U | _CTYPE_L;
- static const mask digit = _CTYPE_N;
- static const mask xdigit = _CTYPE_N | _CTYPE_X;
+ static const mask alpha = _CTYPE_A;
+ static const mask digit = _CTYPE_D;
+ static const mask xdigit = _CTYPE_X;
static const mask space = _CTYPE_S;
- static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
- static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
+ static const mask print = _CTYPE_R;
+ static const mask graph = _CTYPE_G;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
- static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N;
+ static const mask alnum = _CTYPE_A | _CTYPE_D;
};
_GLIBCXX_END_NAMESPACE
diff -r 417b982c122a -r d8995ef30407 external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
--- a/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h Sat Apr 13 10:16:27 2013 +0000
+++ b/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h Sat Apr 13 10:21:20 2013 +0000
@@ -33,11 +33,11 @@
// Information as gleaned from /usr/include/ctype.h
- extern "C" const u_int8_t _C_ctype_[];
+ extern "C" const unsigned short _C_ctype_tab_[];
const ctype_base::mask*
ctype<char>::classic_table() throw()
- { return _C_ctype_ + 1; }
+ { return _C_ctype_tab_ + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
diff -r 417b982c122a -r d8995ef30407 gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
--- a/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr 13 10:16:27 2013 +0000
+++ b/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr 13 10:21:20 2013 +0000
@@ -43,16 +43,16 @@
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
- typedef unsigned char mask;
+ typedef unsigned short mask;
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
- static const mask alpha = _CTYPE_U | _CTYPE_L;
- static const mask digit = _CTYPE_N;
- static const mask xdigit = _CTYPE_N | _CTYPE_X;
+ static const mask alpha = _CTYPE_A;
+ static const mask digit = _CTYPE_D;
+ static const mask xdigit = _CTYPE_X;
static const mask space = _CTYPE_S;
- static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
- static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
+ static const mask print = _CTYPE_R;
+ static const mask graph = _CTYPE_G;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
- static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N;
+ static const mask alnum = _CTYPE_A | _CTYPE_D;
};
diff -r 417b982c122a -r d8995ef30407 gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
--- a/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h Sat Apr 13 10:16:27 2013 +0000
+++ b/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h Sat Apr 13 10:21:20 2013 +0000
@@ -33,11 +33,11 @@
// Information as gleaned from /usr/include/ctype.h
- extern "C" const u_int8_t _C_ctype_[];
+ extern "C" const unsigned short _C_ctype_tab_[];
const ctype_base::mask*
ctype<char>::classic_table() throw()
- { return _C_ctype_ + 1; }
+ { return _C_ctype_tab_ + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
diff -r 417b982c122a -r d8995ef30407 lib/libc/citrus/citrus_lc_ctype.c
--- a/lib/libc/citrus/citrus_lc_ctype.c Sat Apr 13 10:16:27 2013 +0000
+++ b/lib/libc/citrus/citrus_lc_ctype.c Sat Apr 13 10:21:20 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_ctype.c,v 1.10 2012/03/04 21:14:55 tnozaki Exp $ */
+/* $NetBSD: citrus_lc_ctype.c,v 1.11 2013/04/13 10:21:20 joerg Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.10 2012/03/04 21:14:55 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.11 2013/04/13 10:21:20 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
#include "reentrant.h"
@@ -108,6 +108,10 @@
cache->toupper_tab = data->rl_toupper_tab;
cache->mb_cur_max = _citrus_ctype_get_mb_cur_max(data->rl_citrus_ctype);
cache->items[(size_t)CODESET] = data->rl_codeset;
+
+#ifdef __BUILD_LEGACY
+ cache->compat_bsdctype = data->rl_compat_bsdctype;
+#endif
}
static __inline void
@@ -116,10 +120,14 @@
_DIAGASSERT(data != NULL);
__mb_cur_max = _citrus_ctype_get_mb_cur_max(data->rl_citrus_ctype);
- _ctype_ = data->rl_ctype_tab;
+ _ctype_tab_ = data->rl_ctype_tab;
_tolower_tab_ = data->rl_tolower_tab;
_toupper_tab_ = data->rl_toupper_tab;
_CurrentRuneLocale = data;
+
+#ifdef __BUILD_LEGACY
+ _ctype_ = data->rl_compat_bsdctype;
+#endif
}
/*
diff -r 417b982c122a -r d8995ef30407 lib/libc/gen/ctype_.c
--- a/lib/libc/gen/ctype_.c Sat Apr 13 10:16:27 2013 +0000
+++ b/lib/libc/gen/ctype_.c Sat Apr 13 10:21:20 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ctype_.c,v 1.19 2010/12/14 02:28:57 joerg Exp $ */
+/* $NetBSD: ctype_.c,v 1.20 2013/04/13 10:21:20 joerg Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -39,7 +39,7 @@
#if 0
/*static char *sccsid = "from: @(#)ctype_.c 5.6 (Berkeley) 6/1/90";*/
#else
-__RCSID("$NetBSD: ctype_.c,v 1.19 2010/12/14 02:28:57 joerg Exp $");
+__RCSID("$NetBSD: ctype_.c,v 1.20 2013/04/13 10:21:20 joerg Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -51,16 +51,17 @@
#error "EOF != -1"
#endif
-#define _U _CTYPE_U
-#define _L _CTYPE_L
-#define _N _CTYPE_N
-#define _S _CTYPE_S
-#define _P _CTYPE_P
-#define _C _CTYPE_C
-#define _X _CTYPE_X
-#define _B _CTYPE_B
+#ifdef __BUILD_LEGACY
+#define _C _COMPAT_C
+#define _S _COMPAT_S
+#define _U _COMPAT_U
+#define _X _COMPAT_X
+#define _L _COMPAT_L
+#define _P _COMPAT_P
+#define _B _COMPAT_B
+#define _N _COMPAT_N
-const unsigned char _C_ctype_[1 + _CTYPE_NUM_CHARS] = {
+const unsigned char _C_compat_bsdctype[1 + _CTYPE_NUM_CHARS] = {
0,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
@@ -80,4 +81,80 @@
_L, _L, _L, _P, _P, _P, _P, _C
};
-const unsigned char *_ctype_ = &_C_ctype_[0];
+#undef _C
+#undef _S
+#undef _U
+#undef _X
+#undef _L
+#undef _P
+#undef _B
+#undef _N
+
+#ifdef __weak_alias
+__weak_alias(_C_ctype_, _C_compat_bsdctype)
+#endif
+
+const unsigned char *_ctype_ = &_C_compat_bsdctype[0];
+#endif /* __BUILD_LEGACY */
+
+#define _A _CTYPE_A
+#define _BL _CTYPE_BL
+#define _C _CTYPE_C
+#define _D _CTYPE_D
+#define _G _CTYPE_G
+#define _L _CTYPE_L
+#define _P _CTYPE_P
+#define _R _CTYPE_R
+#define _S _CTYPE_S
+#define _U _CTYPE_U
+#define _X _CTYPE_X
+
+const unsigned short _C_ctype_tab_[1 + _CTYPE_NUM_CHARS] = {
+ 0,
+ _C, _C, _C, _C,
+ _C, _C, _C, _C,
+ _C, _BL|_C|_S, _C|_S, _C|_S,
+ _C|_S, _C|_S, _C, _C,
+ _C, _C, _C, _C,
+ _C, _C, _C, _C,
+ _C, _C, _C, _C,
+ _C, _C, _C, _C,
+ _BL|_R|_S, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _D|_G|_R|_X, _D|_G|_R|_X, _D|_G|_R|_X, _D|_G|_R|_X,
+ _D|_G|_R|_X, _D|_G|_R|_X, _D|_G|_R|_X, _D|_G|_R|_X,
+ _D|_G|_R|_X, _D|_G|_R|_X, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _A|_G|_R|_U|_X, _A|_G|_R|_U|_X, _A|_G|_R|_U|_X,
+ _A|_G|_R|_U|_X, _A|_G|_R|_U|_X, _A|_G|_R|_U|_X, _A|_G|_R|_U,
+ _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U,
+ _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U,
+ _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U,
+ _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U,
+ _A|_G|_R|_U, _A|_G|_R|_U, _A|_G|_R|_U, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _G|_R|_P,
+ _G|_R|_P, _A|_G|_L|_R|_X, _A|_G|_L|_R|_X, _A|_G|_L|_R|_X,
+ _A|_G|_L|_R|_X, _A|_G|_L|_R|_X, _A|_G|_L|_R|_X, _A|_G|_L|_R,
+ _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R,
+ _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R,
+ _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R,
+ _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R,
+ _A|_G|_L|_R, _A|_G|_L|_R, _A|_G|_L|_R, _G|_R|_P,
+ _G|_R|_P, _G|_R|_P, _G|_R|_P, _C,
+};
+
+#undef _A
+#undef _BL
+#undef _C
+#undef _D
+#undef _G
+#undef _L
+#undef _P
+#undef _R
+#undef _S
+#undef _U
+#undef _X
+
+const unsigned short *_ctype_tab_ = &_C_ctype_tab_[0];
diff -r 417b982c122a -r d8995ef30407 lib/libc/gen/isctype.c
--- a/lib/libc/gen/isctype.c Sat Apr 13 10:16:27 2013 +0000
+++ b/lib/libc/gen/isctype.c Sat Apr 13 10:21:20 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isctype.c,v 1.21 2010/12/14 02:28:57 joerg Exp $ */
+/* $NetBSD: isctype.c,v 1.22 2013/04/13 10:21:20 joerg Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: isctype.c,v 1.21 2010/12/14 02:28:57 joerg Exp $");
+__RCSID("$NetBSD: isctype.c,v 1.22 2013/04/13 10:21:20 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -55,24 +55,18 @@
return (int)(_CTYPE_TAB(ctype_tab, c) & (bit)); \
}
-_ISCTYPE_FUNC(alnum, _CTYPE_U|_CTYPE_L|_CTYPE_N )
-_ISCTYPE_FUNC(alpha, _CTYPE_U|_CTYPE_L )
+_ISCTYPE_FUNC(alnum, (_CTYPE_A|_CTYPE_D))
+_ISCTYPE_FUNC(alpha, _CTYPE_A)
+_ISCTYPE_FUNC(blank, _CTYPE_BL)
_ISCTYPE_FUNC(cntrl, _CTYPE_C )
-_ISCTYPE_FUNC(digit, _CTYPE_N )
-_ISCTYPE_FUNC(graph, _CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N )
+_ISCTYPE_FUNC(digit, _CTYPE_D)
+_ISCTYPE_FUNC(graph, _CTYPE_G)
_ISCTYPE_FUNC(lower, _CTYPE_L )
-_ISCTYPE_FUNC(print, _CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)
+_ISCTYPE_FUNC(print, _CTYPE_R)
_ISCTYPE_FUNC(punct, _CTYPE_P )
_ISCTYPE_FUNC(space, _CTYPE_S )
_ISCTYPE_FUNC(upper, _CTYPE_U )
Home |
Main Index |
Thread Index |
Old Index