Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/locale stop to renaming _CTYPE_* -> _RUNETYPE_*.
details: https://anonhg.NetBSD.org/src/rev/f97dfc389619
branches: trunk
changeset: 755609:f97dfc389619
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Sat Jun 12 05:54:05 2010 +0000
description:
stop to renaming _CTYPE_* -> _RUNETYPE_*.
diffstat:
lib/libc/locale/iswctype_mb.c | 12 +-
lib/libc/locale/rune.c | 30 +-
lib/libc/locale/rune_local.h | 30 +--
lib/libc/locale/runeglue.c | 22 +-
lib/libc/locale/runetable.c | 412 +++++++++++++++++++++---------------------
5 files changed, 239 insertions(+), 267 deletions(-)
diffs (truncated from 653 to 300 lines):
diff -r da06904d833d -r f97dfc389619 lib/libc/locale/iswctype_mb.c
--- a/lib/libc/locale/iswctype_mb.c Sat Jun 12 02:51:34 2010 +0000
+++ b/lib/libc/locale/iswctype_mb.c Sat Jun 12 05:54:05 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $ */
+/* $NetBSD: iswctype_mb.c,v 1.10 2010/06/12 05:54:05 tnozaki Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $");
+__RCSID("$NetBSD: iswctype_mb.c,v 1.10 2010/06/12 05:54:05 tnozaki Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -156,8 +156,8 @@
return 0;
rl = _RUNE_LOCALE();
x = _runetype_priv(rl, wc);
- if (x & _CTYPE_R)
- return ((unsigned)x & _CTYPE_SWM) >> _CTYPE_SWS;
+ if (x & _RUNETYPE_R)
+ return ((unsigned)x & _RUNETYPE_SWM) >> _RUNETYPE_SWS;
return -1;
}
@@ -174,9 +174,9 @@
width = 0;
while (wn > 0 && *ws != L'\0') {
x = _runetype_priv(rl, *ws);
- if ((x & _CTYPE_R) == 0)
+ if ((x & _RUNETYPE_R) == 0)
return -1;
- width += ((unsigned)x & _CTYPE_SWM) >> _CTYPE_SWS;
+ width += ((unsigned)x & _RUNETYPE_SWM) >> _RUNETYPE_SWS;
++ws, --wn;
}
return width;
diff -r da06904d833d -r f97dfc389619 lib/libc/locale/rune.c
--- a/lib/libc/locale/rune.c Sat Jun 12 02:51:34 2010 +0000
+++ b/lib/libc/locale/rune.c Sat Jun 12 05:54:05 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rune.c,v 1.36 2010/06/01 13:52:08 tnozaki Exp $ */
+/* $NetBSD: rune.c,v 1.37 2010/06/12 05:54:05 tnozaki Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: rune.c,v 1.36 2010/06/01 13:52:08 tnozaki Exp $");
+__RCSID("$NetBSD: rune.c,v 1.37 2010/06/12 05:54:05 tnozaki Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -433,37 +433,37 @@
* - isprint() declaration in ctype.h incorrectly uses _B.
* _B means "isprint but !isgraph", not "isblank" with the
* declaration.
- * - _X and _CTYPE_X have negligible difference in meaning.
+ * - _X and _RUNETYPE_X have negligible difference in meaning.
* - we don't set digit value, fearing that it would be
* too much of hardcoding. we may need to revisit it.
*/
if (new_ctype[1 + x] & _U)
- rl->rl_runetype[x] |= _CTYPE_U;
+ rl->rl_runetype[x] |= _RUNETYPE_U;
if (new_ctype[1 + x] & _L)
- rl->rl_runetype[x] |= _CTYPE_L;
+ rl->rl_runetype[x] |= _RUNETYPE_L;
if (new_ctype[1 + x] & _N)
- rl->rl_runetype[x] |= _CTYPE_D;
+ rl->rl_runetype[x] |= _RUNETYPE_D;
if (new_ctype[1 + x] & _S)
- rl->rl_runetype[x] |= _CTYPE_S;
+ rl->rl_runetype[x] |= _RUNETYPE_S;
if (new_ctype[1 + x] & _P)
- rl->rl_runetype[x] |= _CTYPE_P;
+ rl->rl_runetype[x] |= _RUNETYPE_P;
if (new_ctype[1 + x] & _C)
- rl->rl_runetype[x] |= _CTYPE_C;
+ rl->rl_runetype[x] |= _RUNETYPE_C;
/* derived flag bits, duplicate of ctype.h */
if (new_ctype[1 + x] & (_U | _L))
- rl->rl_runetype[x] |= _CTYPE_A;
+ rl->rl_runetype[x] |= _RUNETYPE_A;
if (new_ctype[1 + x] & (_N | _X))
- rl->rl_runetype[x] |= _CTYPE_X;
+ rl->rl_runetype[x] |= _RUNETYPE_X;
if (new_ctype[1 + x] & (_P|_U|_L|_N))
- rl->rl_runetype[x] |= _CTYPE_G;
+ rl->rl_runetype[x] |= _RUNETYPE_G;
/* we don't really trust _B in the file. see above. */
if (new_ctype[1 + x] & _B)
- rl->rl_runetype[x] |= _CTYPE_B;
+ rl->rl_runetype[x] |= _RUNETYPE_B;
if ((new_ctype[1 + x] & (_P|_U|_L|_N|_B)) || x == ' ')
- rl->rl_runetype[x] |= (_CTYPE_R | _CTYPE_SW1);
+ rl->rl_runetype[x] |= (_RUNETYPE_R | _RUNETYPE_SW1);
if (x == ' ' || x == '\t')
- rl->rl_runetype[x] |= _CTYPE_B;
+ rl->rl_runetype[x] |= _RUNETYPE_B;
/* XXX may fail on non-8bit encoding only */
rl->rl_mapupper[x] = ntohs(new_toupper[1 + x]);
diff -r da06904d833d -r f97dfc389619 lib/libc/locale/rune_local.h
--- a/lib/libc/locale/rune_local.h Sat Jun 12 02:51:34 2010 +0000
+++ b/lib/libc/locale/rune_local.h Sat Jun 12 05:54:05 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rune_local.h,v 1.15 2010/06/05 16:37:13 tnozaki Exp $ */
+/* $NetBSD: rune_local.h,v 1.16 2010/06/12 05:54:05 tnozaki Exp $ */
/*-
* Copyright (c) 2000 Citrus Project,
@@ -69,34 +69,6 @@
#include "runetype_local.h"
/*
- * map _RTYPE_x to _CTYPE_x
- *
- * XXX: these should be defined in ctype.h and used in isxxx macros.
- * (note: current isxxx macros use "old" NetBSD masks and
- * _CTYPE_x are not public.)
- */
-#define _CTYPE_A _RUNETYPE_A
-#define _CTYPE_C _RUNETYPE_C
-#define _CTYPE_D _RUNETYPE_D
-#define _CTYPE_G _RUNETYPE_G
-#define _CTYPE_L _RUNETYPE_L
-#define _CTYPE_P _RUNETYPE_P
-#define _CTYPE_S _RUNETYPE_S
-#define _CTYPE_U _RUNETYPE_U
-#define _CTYPE_X _RUNETYPE_X
-#define _CTYPE_B _RUNETYPE_B
-#define _CTYPE_R _RUNETYPE_R
-#define _CTYPE_I _RUNETYPE_I
-#define _CTYPE_T _RUNETYPE_T
-#define _CTYPE_Q _RUNETYPE_Q
-#define _CTYPE_SWM _RUNETYPE_SWM
-#define _CTYPE_SWS _RUNETYPE_SWS
-#define _CTYPE_SW0 _RUNETYPE_SW0
-#define _CTYPE_SW1 _RUNETYPE_SW1
-#define _CTYPE_SW2 _RUNETYPE_SW2
-#define _CTYPE_SW3 _RUNETYPE_SW3
-
-/*
* Other namespace conversion.
*/
#define _RUNE_ISCACHED _NB_RUNE_ISCACHED
diff -r da06904d833d -r f97dfc389619 lib/libc/locale/runeglue.c
--- a/lib/libc/locale/runeglue.c Sat Jun 12 02:51:34 2010 +0000
+++ b/lib/libc/locale/runeglue.c Sat Jun 12 05:54:05 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: runeglue.c,v 1.18 2010/06/01 13:52:08 tnozaki Exp $ */
+/* $NetBSD: runeglue.c,v 1.19 2010/06/12 05:54:05 tnozaki Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: runeglue.c,v 1.18 2010/06/01 13:52:08 tnozaki Exp $");
+__RCSID("$NetBSD: runeglue.c,v 1.19 2010/06/12 05:54:05 tnozaki Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -105,19 +105,19 @@
if (ch == EOF)
continue;
- if (rl->rl_runetype[i] & _CTYPE_U)
+ if (rl->rl_runetype[i] & _RUNETYPE_U)
new_ctype[i + 1] |= _U;
- if (rl->rl_runetype[i] & _CTYPE_L)
+ if (rl->rl_runetype[i] & _RUNETYPE_L)
new_ctype[i + 1] |= _L;
- if (rl->rl_runetype[i] & _CTYPE_D)
+ if (rl->rl_runetype[i] & _RUNETYPE_D)
new_ctype[i + 1] |= _N;
- if (rl->rl_runetype[i] & _CTYPE_S)
+ if (rl->rl_runetype[i] & _RUNETYPE_S)
new_ctype[i + 1] |= _S;
- if (rl->rl_runetype[i] & _CTYPE_P)
+ if (rl->rl_runetype[i] & _RUNETYPE_P)
new_ctype[i + 1] |= _P;
- if (rl->rl_runetype[i] & _CTYPE_C)
+ if (rl->rl_runetype[i] & _RUNETYPE_C)
new_ctype[i + 1] |= _C;
- if (rl->rl_runetype[i] & _CTYPE_X)
+ if (rl->rl_runetype[i] & _RUNETYPE_X)
new_ctype[i + 1] |= _X;
/*
* TWEAK! _B has been used incorrectly (or with older
@@ -127,10 +127,10 @@
* function (i.e. isblank() is inherently locale unfriendly).
*/
#if 1
- if ((rl->rl_runetype[i] & (_CTYPE_R | _CTYPE_G)) == _CTYPE_R)
+ if ((rl->rl_runetype[i] & (_RUNETYPE_R | _RUNETYPE_G)) == _RUNETYPE_R)
new_ctype[i + 1] |= _B;
#else
- if (rl->rl_runetype[i] & _CTYPE_B)
+ if (rl->rl_runetype[i] & _RUNETYPE_B)
new_ctype[i + 1] |= _B;
#endif
new_toupper[i + 1] = (short)rl->rl_mapupper[i];
diff -r da06904d833d -r f97dfc389619 lib/libc/locale/runetable.c
--- a/lib/libc/locale/runetable.c Sat Jun 12 02:51:34 2010 +0000
+++ b/lib/libc/locale/runetable.c Sat Jun 12 05:54:05 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: runetable.c,v 1.24 2010/06/01 13:52:08 tnozaki Exp $ */
+/* $NetBSD: runetable.c,v 1.25 2010/06/12 05:54:05 tnozaki Exp $ */
/*-
* Copyright (c) 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 6/27/93";
#else
-__RCSID("$NetBSD: runetable.c,v 1.24 2010/06/01 13:52:08 tnozaki Exp $");
+__RCSID("$NetBSD: runetable.c,v 1.25 2010/06/12 05:54:05 tnozaki Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -57,199 +57,199 @@
"NONE",
_DEFAULT_INVALID_RUNE,
- { /*00*/ _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- /*08*/ _CTYPE_C,
- _CTYPE_C|_CTYPE_S|_CTYPE_B,
- _CTYPE_C|_CTYPE_S,
- _CTYPE_C|_CTYPE_S,
- _CTYPE_C|_CTYPE_S,
- _CTYPE_C|_CTYPE_S,
- _CTYPE_C,
- _CTYPE_C,
- /*10*/ _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- /*18*/ _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- _CTYPE_C,
- /*20*/ _CTYPE_S|_CTYPE_B|_CTYPE_R|_CTYPE_SW1,
- _CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
- _CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
- _CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
- _CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
- _CTYPE_P|_CTYP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