diff options
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/asiprintf.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/asprintf.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/freopen.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/mktemp.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/vasiprintf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/vasprintf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 10 | ||||
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 7 | ||||
-rw-r--r-- | newlib/libc/stdio/vfwprintf.c | 11 |
9 files changed, 21 insertions, 23 deletions
diff --git a/newlib/libc/stdio/asiprintf.c b/newlib/libc/stdio/asiprintf.c index 97474fd1a..0c363d5ea 100644 --- a/newlib/libc/stdio/asiprintf.c +++ b/newlib/libc/stdio/asiprintf.c @@ -45,7 +45,7 @@ _DEFUN(_asiprintf_r, (ptr, strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return (ret); } @@ -72,7 +72,7 @@ _DEFUN(asiprintf, (strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return (ret); } diff --git a/newlib/libc/stdio/asprintf.c b/newlib/libc/stdio/asprintf.c index 59a08c808..7b26d9f29 100644 --- a/newlib/libc/stdio/asprintf.c +++ b/newlib/libc/stdio/asprintf.c @@ -45,7 +45,7 @@ _DEFUN(_asprintf_r, (ptr, strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return (ret); } @@ -72,7 +72,7 @@ _DEFUN(asprintf, (strp, fmt), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return (ret); } diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index 6483655bf..b33eb1e22 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -208,7 +208,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), if (HASLB (fp)) FREELB (ptr, fp); fp->_lb._size = 0; - fp->_flags & ~__SORD; + fp->_flags &= ~__SORD; fp->_flags2 = 0; memset (&fp->_mbstate, 0, sizeof (_mbstate_t)); diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c index 1c5d76db4..ecbc7afea 100644 --- a/newlib/libc/stdio/mktemp.c +++ b/newlib/libc/stdio/mktemp.c @@ -247,7 +247,7 @@ _DEFUN(_gettemp, (ptr, path, doopen, domkdir, suffixlen, flags), else { /* Safe, since it only encounters 7-bit characters. */ - if (isdigit (*trv)) + if (isdigit ((unsigned char) *trv)) *trv = 'a'; else ++ * trv; diff --git a/newlib/libc/stdio/vasiprintf.c b/newlib/libc/stdio/vasiprintf.c index 15310cce9..f96de0d79 100644 --- a/newlib/libc/stdio/vasiprintf.c +++ b/newlib/libc/stdio/vasiprintf.c @@ -59,7 +59,7 @@ _DEFUN(_vasiprintf_r, (ptr, strp, fmt, ap), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return ret; } diff --git a/newlib/libc/stdio/vasprintf.c b/newlib/libc/stdio/vasprintf.c index b89f4dbd7..fbb54cbe8 100644 --- a/newlib/libc/stdio/vasprintf.c +++ b/newlib/libc/stdio/vasprintf.c @@ -59,7 +59,7 @@ _DEFUN(_vasprintf_r, (ptr, strp, fmt, ap), if (ret >= 0) { *f._p = 0; - *strp = f._bf._base; + *strp = (char *) f._bf._base; } return ret; } diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 559899107..4b165e021 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -567,9 +567,9 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), char sign; /* sign prefix (' ', '+', '-', or \0) */ #ifdef _WANT_IO_C99_FORMATS /* locale specific numeric grouping */ - char *thousands_sep; - size_t thsnd_len; - const char *grouping; + char *thousands_sep = NULL; + size_t thsnd_len = 0; + const char *grouping = NULL; #endif #ifdef FLOATING_POINT char *decimal_point = _localeconv_r (data)->decimal_point; @@ -585,7 +585,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), #if defined (FLOATING_POINT) || defined (_WANT_IO_C99_FORMATS) int ndig = 0; /* actual number of digits returned by cvt */ #endif -#ifdef _WANT_IO_C99_FORMATS +#if defined (FLOATING_POINT) && defined (_WANT_IO_C99_FORMATS) int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif @@ -793,10 +793,10 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), sign = '\0'; #ifdef FLOATING_POINT lead = 0; -#endif #ifdef _WANT_IO_C99_FORMATS nseps = nrepeats = 0; #endif +#endif #ifndef _NO_POS_ARGS N = arg_index; is_pos_arg = 0; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index e05082db7..e967719b7 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -243,10 +243,7 @@ static void * get_arg (int, va_list *, int *, void **); #define CT_INT 3 /* integer, i.e., strtol or strtoul */ #define CT_FLOAT 4 /* floating, i.e., strtod */ -#if 0 #define u_char unsigned char -#endif -#define u_char char #define u_long unsigned long #ifndef _NO_LONGLONG @@ -513,8 +510,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), #ifndef _MB_CAPABLE wc = *fmt; #else - nbytes = __mbtowc (rptr, &wc, fmt, MB_CUR_MAX, __locale_charset (), - &state); + nbytes = __mbtowc (rptr, &wc, (char *) fmt, MB_CUR_MAX, + __locale_charset (), &state); if (nbytes < 0) { wc = 0xFFFD; /* Unicode replacement character */ nbytes = 1; diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index 029f1d08c..7d38ecf82 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -396,10 +396,11 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ #ifdef _WANT_IO_C99_FORMATS /* locale specific numeric grouping */ - wchar_t thousands_sep; - const char *grouping; + wchar_t thousands_sep = L'\0'; + const char *grouping = NULL; #endif -#ifdef _MB_CAPABLE +#if defined (FLOATING_POINT) && defined (_MB_CAPABLE) \ + && !defined (__HAVE_LOCALE_INFO_EXTENDED__) mbstate_t state; /* mbtowc calls from library must not change state */ #endif #ifdef FLOATING_POINT @@ -415,7 +416,7 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), #if defined (FLOATING_POINT) || defined (_WANT_IO_C99_FORMATS) int ndig = 0; /* actual number of digits returned by cvt */ #endif -#ifdef _WANT_IO_C99_FORMATS +#if defined (FLOATING_POINT) && defined (_WANT_IO_C99_FORMATS) int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif @@ -619,10 +620,10 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), sign = L'\0'; #ifdef FLOATING_POINT lead = 0; -#endif #ifdef _WANT_IO_C99_FORMATS nseps = nrepeats = 0; #endif +#endif #ifndef _NO_POS_ARGS N = arg_index; is_pos_arg = 0; |