Module Name: src Committed By: tnozaki Date: Wed Jun 2 15:47:25 UTC 2010
Modified Files: src/lib/libc/locale: _wctrans.c _wctrans_local.h _wctype.c _wctype_local.h iswctype_mb.c Log Message: remove duplicated towctrans internal function. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/_wctrans_local.h \ src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/_wctype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/locale/_wctrans.c diff -u src/lib/libc/locale/_wctrans.c:1.15 src/lib/libc/locale/_wctrans.c:1.16 --- src/lib/libc/locale/_wctrans.c:1.15 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/_wctrans.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctrans.c,v 1.15 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: _wctrans.c,v 1.16 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -60,7 +60,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _wctrans.c,v 1.15 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: _wctrans.c,v 1.16 2010/06/02 15:47:25 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -77,7 +77,7 @@ * translate a character (extended part) */ wint_t -_towctrans_ext(wint_t c, struct _WCTransEntry *te) +_towctrans_ext(wint_t c, struct _WCTransEntry const *te) { __nbrune_t c0; uint32_t x; Index: src/lib/libc/locale/_wctrans_local.h diff -u src/lib/libc/locale/_wctrans_local.h:1.8 src/lib/libc/locale/_wctrans_local.h:1.9 --- src/lib/libc/locale/_wctrans_local.h:1.8 Thu Feb 12 05:00:46 2009 +++ src/lib/libc/locale/_wctrans_local.h Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctrans_local.h,v 1.8 2009/02/12 05:00:46 lukem Exp $ */ +/* $NetBSD: _wctrans_local.h,v 1.9 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -30,11 +30,11 @@ #define _WCTRANS_LOCAL_H_ __BEGIN_DECLS -wint_t _towctrans_ext(wint_t, _WCTransEntry *); +wint_t _towctrans_ext(wint_t, _WCTransEntry const *); __END_DECLS static __inline wint_t -_towctrans(wint_t c, _WCTransEntry *te) +_towctrans_priv(wint_t c, _WCTransEntry const *te) { return (_RUNE_ISCACHED(c) ? (wint_t)te->te_cached[(size_t)c] Index: src/lib/libc/locale/iswctype_mb.c diff -u src/lib/libc/locale/iswctype_mb.c:1.8 src/lib/libc/locale/iswctype_mb.c:1.9 --- src/lib/libc/locale/iswctype_mb.c:1.8 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/iswctype_mb.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: iswctype_mb.c,v 1.8 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 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.8 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -82,7 +82,7 @@ \ rl = _RUNE_LOCALE(); \ te = &rl->rl_wctrans[index]; \ - return _towctrans_priv(rl, wc, te); \ + return _towctrans_priv(wc, te); \ } _TOWCTRANS_FUNC(upper, _WCTRANS_INDEX_UPPER) _TOWCTRANS_FUNC(lower, _WCTRANS_INDEX_LOWER) @@ -134,16 +134,14 @@ wint_t towctrans(wint_t wc, wctrans_t charmap) { - _RuneLocale const *rl; _WCTransEntry const *te; if (charmap == NULL) { errno = EINVAL; return wc; } - rl = _RUNE_LOCALE(); te = (_WCTransEntry const *)(void *)charmap; - return _towctrans_priv(rl, wc, te); + return _towctrans_priv(wc, te); } __weak_alias(wcwidth,_wcwidth) Index: src/lib/libc/locale/_wctype.c diff -u src/lib/libc/locale/_wctype.c:1.7 src/lib/libc/locale/_wctype.c:1.8 --- src/lib/libc/locale/_wctype.c:1.7 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/_wctype.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctype.c,v 1.7 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: _wctype.c,v 1.8 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -60,7 +60,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: _wctype.c,v 1.7 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: _wctype.c,v 1.8 2010/06/02 15:47:25 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -110,37 +110,3 @@ { return !!(_runetype_priv(rl, wc) & te->te_mask); } - -wint_t -/*ARGSUSED*/ -_towctrans_priv(_RuneLocale const *rl, - wint_t wc, _WCTransEntry const *te) -{ - __nbrune_t wc0; - _RuneRange *rr; - _RuneEntry *base, *re; - uint32_t x; - - _DIAGASSERT(rl != NULL); - _DIAGASSERT(te != NULL); - - if (wc == WEOF) - return wc; - _DIAGASSERT(te->te_name != NULL); - if (_RUNE_ISCACHED(wc)) - return te->te_cached[(size_t)wc]; - wc0 = (__nbrune_t)wc; - rr = te->te_extmap; - _DIAGASSERT(rr != NULL); - base = rr->rr_rune_ranges; - for (x = rr->rr_nranges; x != (uint32_t)0; x >>= 1) { - re = base + (x >> 1); - if (re->re_min <= wc0 && re->re_max >= wc0) { - return re->re_map + wc0 - re->re_min; - } else if (wc0 >= re->re_max) { - base = re + 1; - --x; - } - } - return wc; -} Index: src/lib/libc/locale/_wctype_local.h diff -u src/lib/libc/locale/_wctype_local.h:1.2 src/lib/libc/locale/_wctype_local.h:1.3 --- src/lib/libc/locale/_wctype_local.h:1.2 Sun Jan 11 02:46:28 2009 +++ src/lib/libc/locale/_wctype_local.h Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctype_local.h,v 1.2 2009/01/11 02:46:28 christos Exp $ */ +/* $NetBSD: _wctype_local.h,v 1.3 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c) 2008 Citrus Project, @@ -32,7 +32,6 @@ __BEGIN_DECLS _RuneType _runetype_priv(_RuneLocale const *, wint_t); int _iswctype_priv(_RuneLocale const *, wint_t, _WCTypeEntry const *); -wint_t _towctrans_priv(_RuneLocale const *, wint_t, _WCTransEntry const *); __END_DECLS #endif /*_WCTYPE_LOCAL_H_*/