diff --git a/arch/arm/bits/alltypes.h.sh b/arch/arm/bits/alltypes.h.sh index 274de0df7d9dcece1ea2a192519f8dc59b3536b2..a531ee0f480be4bff07eeca4592d457a00b8beab 100755 --- a/arch/arm/bits/alltypes.h.sh +++ b/arch/arm/bits/alltypes.h.sh @@ -26,8 +26,8 @@ TYPEDEF __builtin_va_list va_list; TYPEDEF unsigned wchar_t; #endif TYPEDEF int wint_t; -TYPEDEF long wctrans_t; -TYPEDEF long wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/arch/i386/bits/alltypes.h.sh b/arch/i386/bits/alltypes.h.sh index 10fcf6a3c46a852d86e287e3ce7918fb2226737a..13def835b6c04ec45cc11e17899b9280276dc171 100755 --- a/arch/i386/bits/alltypes.h.sh +++ b/arch/i386/bits/alltypes.h.sh @@ -34,8 +34,8 @@ TYPEDEF long wchar_t; #endif #endif TYPEDEF long wint_t; -TYPEDEF long wctrans_t; -TYPEDEF long wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/arch/microblaze/bits/alltypes.h.sh b/arch/microblaze/bits/alltypes.h.sh index c909bc37dfb31a8168aeff701ffa70e0a3aa7ef5..2397c6cdc95dc1c612b8b30b4181960aa5513e36 100755 --- a/arch/microblaze/bits/alltypes.h.sh +++ b/arch/microblaze/bits/alltypes.h.sh @@ -26,8 +26,8 @@ TYPEDEF __builtin_va_list va_list; TYPEDEF int wchar_t; #endif TYPEDEF int wint_t; -TYPEDEF long wctrans_t; -TYPEDEF long wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/arch/mips/bits/alltypes.h.sh b/arch/mips/bits/alltypes.h.sh index c909bc37dfb31a8168aeff701ffa70e0a3aa7ef5..2397c6cdc95dc1c612b8b30b4181960aa5513e36 100755 --- a/arch/mips/bits/alltypes.h.sh +++ b/arch/mips/bits/alltypes.h.sh @@ -26,8 +26,8 @@ TYPEDEF __builtin_va_list va_list; TYPEDEF int wchar_t; #endif TYPEDEF int wint_t; -TYPEDEF long wctrans_t; -TYPEDEF long wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/arch/powerpc/bits/alltypes.h.sh b/arch/powerpc/bits/alltypes.h.sh index befad081733bc4283aa3dfcf8742f043f38c2633..f3dac12a69574c36d601eebfb3dc7cad213abfd7 100755 --- a/arch/powerpc/bits/alltypes.h.sh +++ b/arch/powerpc/bits/alltypes.h.sh @@ -26,8 +26,8 @@ TYPEDEF __builtin_va_list va_list; TYPEDEF long wchar_t; #endif TYPEDEF int wint_t; -TYPEDEF long wctrans_t; -TYPEDEF long wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/arch/x86_64/bits/alltypes.h.sh b/arch/x86_64/bits/alltypes.h.sh index 083ea2300c033ac87b5ddc1f0cb66cc7f0b914d3..bc9a3cc0139c809f8e24165ffd846cbd436eaa03 100755 --- a/arch/x86_64/bits/alltypes.h.sh +++ b/arch/x86_64/bits/alltypes.h.sh @@ -25,8 +25,8 @@ TYPEDEF __builtin_va_list va_list; TYPEDEF int wchar_t; #endif TYPEDEF int wint_t; -TYPEDEF int wctrans_t; -TYPEDEF int wctype_t; +TYPEDEF const int * wctrans_t; +TYPEDEF unsigned long wctype_t; TYPEDEF signed char int8_t; TYPEDEF short int16_t; diff --git a/src/ctype/wctrans.c b/src/ctype/wctrans.c index 03e9fd6ab6b291b197ff0a2faaba5434007e7511..739869d059e4aec9b2f805cdc95d5c703dd711ca 100644 --- a/src/ctype/wctrans.c +++ b/src/ctype/wctrans.c @@ -3,14 +3,14 @@ wctrans_t wctrans(const char *class) { - if (!strcmp(class, "toupper")) return 1; - if (!strcmp(class, "tolower")) return 2; + if (!strcmp(class, "toupper")) return (wctrans_t)1; + if (!strcmp(class, "tolower")) return (wctrans_t)2; return 0; } wint_t towctrans(wint_t wc, wctrans_t trans) { - if (trans == 1) return towupper(wc); - if (trans == 2) return towlower(wc); + if (trans == (wctrans_t)1) return towupper(wc); + if (trans == (wctrans_t)2) return towlower(wc); return wc; }