summaryrefslogtreecommitdiff
path: root/libc/misc/wchar/wchar.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-21 14:12:08 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-21 14:12:08 +0000
commiteebbc87bcc8d5bc6916870b7dd6cc4603f728a94 (patch)
tree60da3db81a886889e26663017d3d88e7bf88d5a4 /libc/misc/wchar/wchar.c
parentd0f22a0224e92514a3c6015b4e7afdb5836c333b (diff)
more of pointer signedness warnings removed
Diffstat (limited to 'libc/misc/wchar/wchar.c')
-rw-r--r--libc/misc/wchar/wchar.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index a28cd8f94..9bdaafe90 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -188,24 +188,24 @@ wint_t btowc(int c)
if (c != EOF) {
*buf = (unsigned char) c;
mbstate.__mask = 0; /* Initialize the mbstate. */
- if (mbrtowc(&wc, buf, 1, &mbstate) <= 1) {
+ if (mbrtowc(&wc, (char*) buf, 1, &mbstate) <= 1) {
return wc;
}
}
return WEOF;
-#else /* __CTYPE_HAS_8_BIT_LOCALES */
+#else /* !__CTYPE_HAS_8_BIT_LOCALES */
#ifdef __UCLIBC_HAS_LOCALE__
assert((ENCODING == __ctype_encoding_7_bit)
|| (ENCODING == __ctype_encoding_utf8));
-#endif /* __UCLIBC_HAS_LOCALE__ */
+#endif
/* If we don't have 8-bit locale support, then this is trivial since
* anything outside of 0-0x7f is illegal in C/POSIX and UTF-8 locales. */
return (((unsigned int)c) < 0x80) ? c : WEOF;
-#endif /* __CTYPE_HAS_8_BIT_LOCALES */
+#endif /* !__CTYPE_HAS_8_BIT_LOCALES */
}
libc_hidden_def(btowc)
@@ -223,7 +223,7 @@ int wctob(wint_t c)
unsigned char buf[MB_LEN_MAX];
- return (wcrtomb(buf, c, NULL) == 1) ? *buf : EOF;
+ return (wcrtomb((char*) buf, c, NULL) == 1) ? *buf : EOF;
#else /* __CTYPE_HAS_8_BIT_LOCALES */
@@ -1290,8 +1290,8 @@ static int find_codeset(const char *name)
const unsigned char *s;
int codeset;
- for (s = __iconv_codesets ; *s ; s += *s) {
- if (!strcasecmp(s+2, name)) {
+ for (s = __iconv_codesets; *s; s += *s) {
+ if (!strcasecmp((char*) (s + 2), name)) {
return s[1];
}
}
@@ -1301,7 +1301,7 @@ static int find_codeset(const char *name)
/* TODO: maybe CODESET_LIST + *s ??? */
/* 7bit is 1, UTF-8 is 2, 8-bit is >= 3 */
codeset = 2;
- s = __LOCALE_DATA_CODESET_LIST;
+ s = (const unsigned char *) __LOCALE_DATA_CODESET_LIST;
do {
++codeset; /* Increment codeset first. */
if (!strcasecmp(__LOCALE_DATA_CODESET_LIST+*s, name)) {
@@ -1590,8 +1590,8 @@ extern const unsigned char __iconv_codesets[];
#define IBUF BUFSIZ
#define OBUF BUFSIZ
-char *progname;
-int hide_errors;
+static char *progname;
+static int hide_errors;
static void error_msg(const char *fmt, ...)
__attribute__ ((noreturn, format (printf, 1, 2)));