Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen Use more consistent naming for tolower/toupper ...



details:   https://anonhg.NetBSD.org/src/rev/417b982c122a
branches:  trunk
changeset: 786066:417b982c122a
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Apr 13 10:16:27 2013 +0000

description:
Use more consistent naming for tolower/toupper translation table for the
C locale. From Takehiko Nozaki with changes to use __BUILD_LEGACY.

diffstat:

 lib/libc/gen/tolower_.c |  14 ++++++++++----
 lib/libc/gen/toupper_.c |  14 ++++++++++----
 2 files changed, 20 insertions(+), 8 deletions(-)

diffs (78 lines):

diff -r 3a7d29373c39 -r 417b982c122a lib/libc/gen/tolower_.c
--- a/lib/libc/gen/tolower_.c   Sat Apr 13 02:08:59 2013 +0000
+++ b/lib/libc/gen/tolower_.c   Sat Apr 13 10:16:27 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $    */
+/*     $NetBSD: tolower_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $      */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_RCS) && !defined(lint)
-__RCSID("$NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $");
+__RCSID("$NetBSD: tolower_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $");
 #endif /* LIBC_RCS and not lint */
 
 #include <sys/ctype_bits.h>
@@ -18,7 +18,7 @@
 #error "EOF != -1"
 #endif
 
-const short _C_tolower_[1 + _CTYPE_NUM_CHARS] = {
+const short _C_tolower_tab_[1 + _CTYPE_NUM_CHARS] = {
        EOF,
        0x00,   0x01,   0x02,   0x03,   0x04,   0x05,   0x06,   0x07,
        0x08,   0x09,   0x0a,   0x0b,   0x0c,   0x0d,   0x0e,   0x0f,
@@ -54,4 +54,10 @@
        0xf8,   0xf9,   0xfa,   0xfb,   0xfc,   0xfd,   0xfe,   0xff
 };
 
-const short *_tolower_tab_ = &_C_tolower_[0];
+#ifdef __BUILD_LEGACY
+#ifdef __weak_alias
+__weak_alias(_C_tolower_, _C_tolower_tab_)
+#endif
+#endif
+
+const short *_tolower_tab_ = &_C_tolower_tab_[0];
diff -r 3a7d29373c39 -r 417b982c122a lib/libc/gen/toupper_.c
--- a/lib/libc/gen/toupper_.c   Sat Apr 13 02:08:59 2013 +0000
+++ b/lib/libc/gen/toupper_.c   Sat Apr 13 10:16:27 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $    */
+/*     $NetBSD: toupper_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $      */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_RCS) && !defined(lint)
-__RCSID("$NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $");
+__RCSID("$NetBSD: toupper_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $");
 #endif /* LIBC_RCS and not lint */
 
 #include <sys/ctype_bits.h>
@@ -18,7 +18,7 @@
 #error "EOF != -1"
 #endif
 
-const short _C_toupper_[1 + _CTYPE_NUM_CHARS] = {
+const short _C_toupper_tab_[1 + _CTYPE_NUM_CHARS] = {
        EOF,
        0x00,   0x01,   0x02,   0x03,   0x04,   0x05,   0x06,   0x07,
        0x08,   0x09,   0x0a,   0x0b,   0x0c,   0x0d,   0x0e,   0x0f,
@@ -54,4 +54,10 @@
        0xf8,   0xf9,   0xfa,   0xfb,   0xfc,   0xfd,   0xfe,   0xff
 };
 
-const short *_toupper_tab_ = &_C_toupper_[0];
+#ifdef __BUILD_LEGACY
+#ifdef __weak_alias
+__weak_alias(_C_toupper_, _C_toupper_tab_)
+#endif
+#endif
+
+const short *_toupper_tab_ = &_C_toupper_tab_[0];



Home | Main Index | Thread Index | Old Index