change wint_t to unsigned
authorRich Felker <dalias@aerifal.cx>
Mon, 22 Jul 2013 17:05:41 +0000 (13:05 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 22 Jul 2013 17:05:41 +0000 (13:05 -0400)
aside from the obvious C++ ABI purpose for this change, it also brings
musl into alignment with the compiler's idea of the definition of
wint_t (use in -Wformat), and makes the situation less awkward on ARM,
where wchar_t is unsigned.

internal code using wint_t and WEOF was checked against this change,
and while a few cases of storing WEOF into wchar_t were found, they
all seem to operate properly with the natural conversion from unsigned
to signed.

arch/arm/bits/alltypes.h.in
arch/i386/bits/alltypes.h.in
arch/microblaze/bits/alltypes.h.in
arch/mips/bits/alltypes.h.in
arch/powerpc/bits/alltypes.h.in
arch/x86_64/bits/alltypes.h.in
include/stdint.h
include/wchar.h
include/wctype.h

index c3228b5..764a246 100644 (file)
@@ -7,7 +7,7 @@ TYPEDEF __builtin_va_list __isoc_va_list;
 #ifndef __cplusplus
 TYPEDEF unsigned wchar_t;
 #endif
-TYPEDEF int wint_t;
+TYPEDEF unsigned wint_t;
 
 TYPEDEF float float_t;
 TYPEDEF double double_t;
index ea6471e..04fd1cb 100644 (file)
@@ -16,7 +16,7 @@ TYPEDEF __WCHAR_TYPE__ wchar_t;
 TYPEDEF long wchar_t;
 #endif
 #endif
-TYPEDEF long wint_t;
+TYPEDEF unsigned wint_t;
 
 #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
 TYPEDEF float float_t;
index f0ab35f..eb842aa 100644 (file)
@@ -7,7 +7,7 @@ TYPEDEF __builtin_va_list __isoc_va_list;
 #ifndef __cplusplus
 TYPEDEF int wchar_t;
 #endif
-TYPEDEF int wint_t;
+TYPEDEF unsigned wint_t;
 
 TYPEDEF float float_t;
 TYPEDEF double double_t;
index f0ab35f..eb842aa 100644 (file)
@@ -7,7 +7,7 @@ TYPEDEF __builtin_va_list __isoc_va_list;
 #ifndef __cplusplus
 TYPEDEF int wchar_t;
 #endif
-TYPEDEF int wint_t;
+TYPEDEF unsigned wint_t;
 
 TYPEDEF float float_t;
 TYPEDEF double double_t;
index 928ce70..1c3fe28 100644 (file)
@@ -7,7 +7,7 @@ TYPEDEF __builtin_va_list __isoc_va_list;
 #ifndef __cplusplus
 TYPEDEF long wchar_t;
 #endif
-TYPEDEF int wint_t;
+TYPEDEF unsigned wint_t;
 
 TYPEDEF float float_t;
 TYPEDEF double double_t;
index e931d11..b9bff86 100644 (file)
@@ -7,7 +7,7 @@ TYPEDEF __builtin_va_list __isoc_va_list;
 #ifndef __cplusplus
 TYPEDEF int wchar_t;
 #endif
-TYPEDEF int wint_t;
+TYPEDEF unsigned wint_t;
 
 #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
 TYPEDEF long double float_t;
index a783ad9..ad6aaea 100644 (file)
@@ -78,8 +78,8 @@ typedef uint64_t uint_least64_t;
 #define INTMAX_MAX  INT64_MAX
 #define UINTMAX_MAX UINT64_MAX
 
-#define WINT_MIN INT32_MIN
-#define WINT_MAX INT32_MAX
+#define WINT_MIN 0
+#define WINT_MAX UINT32_MAX
 
 #if L'\0'-1 > 0
 #define WCHAR_MAX (0xffffffffu+L'\0')
index a6742e3..96cd444 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 #define NULL 0L
 
 #undef WEOF
-#define WEOF (-1)
+#define WEOF 0xffffffffU
 
 typedef struct __mbstate_t
 {
index 5640edd..8c544f2 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
 typedef const int * wctrans_t;
 
 #undef WEOF
-#define WEOF (-1)
+#define WEOF 0xffffffffU
 
 #undef iswdigit