summaryrefslogtreecommitdiff
path: root/libc/misc/wchar
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-01-21 02:52:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-01-21 02:52:59 +0000
commit3f1adc3da04a7809171c3990770d72f28c5d80e4 (patch)
tree0953b7f1ad2a4a72a3843ab34cc6b292e6d74ea5 /libc/misc/wchar
parent71486075e0ab506b80609416a3126a666b88e415 (diff)
*: remove __UCLIBC_CURLOCALE_DATA, __UCLIBC_CURLOCALE_DATA.x
is always equivalent to __UCLIBC_CURLOCALE->x. remove typedef __uclibc_locale_t, it used only in a few places, it is lees confusing to use struct __uclibc_locale_struct everywhere. xlocale.h: hide __global_locale back under _LIBC, bug 53 is wrong in claiming it should be exported. Also hide under _LIBC: extern __locale_t __curlocale_var; extern __locale_t __curlocale(void); extern __locale_t __curlocale_set(__locale_t newloc); # define __UCLIBC_CURLOCALE # define __XL_NPP(N) # define __LOCALE_PARAM # define __LOCALE_ARG # define __LOCALE_PTR
Diffstat (limited to 'libc/misc/wchar')
-rw-r--r--libc/misc/wchar/wchar.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 9bdaafe90..d921e4363 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -119,7 +119,7 @@
#endif
#endif /* __UCLIBC_MJN3_ONLY__ */
-#define ENCODING ((__UCLIBC_CURLOCALE_DATA).encoding)
+#define ENCODING (__UCLIBC_CURLOCALE->encoding)
#define Cc2wc_IDX_SHIFT __LOCALE_DATA_Cc2wc_IDX_SHIFT
#define Cc2wc_ROW_LEN __LOCALE_DATA_Cc2wc_ROW_LEN
@@ -752,8 +752,8 @@ size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
while (count) {
if ((wc = ((unsigned char)(*s))) >= 0x80) { /* Non-ASCII... */
wc -= 0x80;
- wc = __UCLIBC_CURLOCALE_DATA.tbl8c2wc[
- (__UCLIBC_CURLOCALE_DATA.idx8c2wc[wc >> Cc2wc_IDX_SHIFT]
+ wc = __UCLIBC_CURLOCALE->tbl8c2wc[
+ (__UCLIBC_CURLOCALE->idx8c2wc[wc >> Cc2wc_IDX_SHIFT]
<< Cc2wc_IDX_SHIFT) + (wc & (Cc2wc_ROW_LEN - 1))];
if (!wc) {
goto BAD;
@@ -863,12 +863,12 @@ size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
} else {
u = 0;
if (wc <= Cwc2c_DOMAIN_MAX) {
- u = __UCLIBC_CURLOCALE_DATA.idx8wc2c[wc >> (Cwc2c_TI_SHIFT
+ u = __UCLIBC_CURLOCALE->idx8wc2c[wc >> (Cwc2c_TI_SHIFT
+ Cwc2c_TT_SHIFT)];
- u = __UCLIBC_CURLOCALE_DATA.tbl8wc2c[(u << Cwc2c_TI_SHIFT)
+ u = __UCLIBC_CURLOCALE->tbl8wc2c[(u << Cwc2c_TI_SHIFT)
+ ((wc >> Cwc2c_TT_SHIFT)
& ((1 << Cwc2c_TI_SHIFT)-1))];
- u = __UCLIBC_CURLOCALE_DATA.tbl8wc2c[Cwc2c_TI_LEN
+ u = __UCLIBC_CURLOCALE->tbl8wc2c[Cwc2c_TI_LEN
+ (u << Cwc2c_TT_SHIFT)
+ (wc & ((1 << Cwc2c_TT_SHIFT)-1))];
}
@@ -1468,7 +1468,7 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
const __codeset_8_bit_t *c8b
= __locale_mmap->codeset_8_bit + px->fromcodeset - 3;
wc -= 0x80;
- wc = __UCLIBC_CURLOCALE_DATA.tbl8c2wc[
+ wc = __UCLIBC_CURLOCALE->tbl8c2wc[
(c8b->idx8c2wc[wc >> Cc2wc_IDX_SHIFT]
<< Cc2wc_IDX_SHIFT) + (wc & (Cc2wc_ROW_LEN - 1))];
if (!wc) {
@@ -1553,10 +1553,10 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
= __locale_mmap->codeset_8_bit + px->tocodeset - 3;
__uwchar_t u;
u = c8b->idx8wc2c[wc >> (Cwc2c_TI_SHIFT + Cwc2c_TT_SHIFT)];
- u = __UCLIBC_CURLOCALE_DATA.tbl8wc2c[(u << Cwc2c_TI_SHIFT)
+ u = __UCLIBC_CURLOCALE->tbl8wc2c[(u << Cwc2c_TI_SHIFT)
+ ((wc >> Cwc2c_TT_SHIFT)
& ((1 << Cwc2c_TI_SHIFT)-1))];
- wc = __UCLIBC_CURLOCALE_DATA.tbl8wc2c[Cwc2c_TI_LEN
+ wc = __UCLIBC_CURLOCALE->tbl8wc2c[Cwc2c_TI_LEN
+ (u << Cwc2c_TT_SHIFT)
+ (wc & ((1 << Cwc2c_TT_SHIFT)-1))];
if (wc) {