Module Name: src Committed By: joerg Date: Sat Apr 13 10:16:27 UTC 2013
Modified Files: src/lib/libc/gen: tolower_.c toupper_.c Log Message: Use more consistent naming for tolower/toupper translation table for the C locale. From Takehiko Nozaki with changes to use __BUILD_LEGACY. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/tolower_.c \ src/lib/libc/gen/toupper_.c 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/gen/tolower_.c diff -u src/lib/libc/gen/tolower_.c:1.13 src/lib/libc/gen/tolower_.c:1.14 --- src/lib/libc/gen/tolower_.c:1.13 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/gen/tolower_.c Sat Apr 13 10:16:27 2013 @@ -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 <j...@netbsd.org>. @@ -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 @@ __RCSID("$NetBSD: tolower_.c,v 1.13 2010 #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 @@ const short _C_tolower_[1 + _CTYPE_NUM_C 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]; Index: src/lib/libc/gen/toupper_.c diff -u src/lib/libc/gen/toupper_.c:1.13 src/lib/libc/gen/toupper_.c:1.14 --- src/lib/libc/gen/toupper_.c:1.13 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/gen/toupper_.c Sat Apr 13 10:16:27 2013 @@ -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 <j...@netbsd.org>. @@ -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 @@ __RCSID("$NetBSD: toupper_.c,v 1.13 2010 #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 @@ const short _C_toupper_[1 + _CTYPE_NUM_C 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];