summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/misc/wchar/wchar.c20
-rw-r--r--libc/misc/wctype/_wctype.c7
-rw-r--r--libc/stdio/fgetwc.c8
3 files changed, 17 insertions, 18 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)));
diff --git a/libc/misc/wctype/_wctype.c b/libc/misc/wctype/_wctype.c
index 16bc5237a..9887808b6 100644
--- a/libc/misc/wctype/_wctype.c
+++ b/libc/misc/wctype/_wctype.c
@@ -502,7 +502,6 @@ libc_hidden_def(towupper)
#ifdef L_wctype
static const unsigned char typestring[] = __CTYPE_TYPESTRING;
-/* extern const unsigned char typestring[]; */
/* libc_hidden_proto(wctype) */
wctype_t wctype(const char *property)
@@ -513,7 +512,7 @@ wctype_t wctype(const char *property)
p = typestring;
i = 1;
do {
- if (!strcmp(property, ++p)) {
+ if (!strcmp(property, (const char *) ++p)) {
return i;
}
++i;
@@ -913,10 +912,10 @@ wctrans_t wctrans(const char *property)
const unsigned char *p;
int i;
- p = transstring;
+ p = (const unsigned char *) transstring;
i = 1;
do {
- if (!strcmp(property, ++p)) {
+ if (!strcmp(property, (const char*) ++p)) {
return i;
}
++i;
diff --git a/libc/stdio/fgetwc.c b/libc/stdio/fgetwc.c
index 34327434c..18a6b5bb5 100644
--- a/libc/stdio/fgetwc.c
+++ b/libc/stdio/fgetwc.c
@@ -58,12 +58,12 @@ wint_t fgetwc_unlocked(register FILE *stream)
stream->__ungot_width[0] = 0; /* then reset the width. */
}
- LOOP:
+ LOOP:
if ((n = __STDIO_STREAM_BUFFER_RAVAIL(stream)) == 0) {
goto FILL_BUFFER;
}
- r = mbrtowc(wc, stream->__bufpos, n, &stream->__state);
+ r = mbrtowc(wc, (const char*) stream->__bufpos, n, &stream->__state);
if (((ssize_t) r) >= 0) { /* Success... */
if (r == 0) { /* Nul wide char... means 0 byte for us so */
++r; /* increment r and handle below as single. */
@@ -78,7 +78,7 @@ wint_t fgetwc_unlocked(register FILE *stream)
/* Potentially valid but incomplete and no more buffered. */
stream->__bufpos += n; /* Update bufpos for stream. */
stream->__ungot_width[0] += n;
- FILL_BUFFER:
+ FILL_BUFFER:
if(__STDIO_FILL_READ_BUFFER(stream)) { /* Refill succeeded? */
goto LOOP;
}
@@ -98,7 +98,7 @@ wint_t fgetwc_unlocked(register FILE *stream)
* error indicator is set. */
stream->__modeflags |= __FLAG_ERROR;
- DONE:
+ DONE:
if (stream->__bufstart == sbuf) { /* Need to un-munge the stream. */
munge_stream(stream, NULL);
}