OSDN Git Service

patch from Hans-Christian Egtvedt to silence some spurious signed warnings
authorMike Frysinger <vapier@gentoo.org>
Sat, 5 Jan 2008 09:27:37 +0000 (09:27 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 5 Jan 2008 09:27:37 +0000 (09:27 -0000)
libc/stdio/_scanf.c
libc/stdio/_vfprintf.c
libc/stdio/vsnprintf.c

index bc95d02..9bc8def 100644 (file)
@@ -731,7 +731,7 @@ void attribute_hidden __init_scan_cookie(register struct scan_cookie *sc,
        sc->decpt = __UCLIBC_CURLOCALE_DATA.decimal_point;
        sc->decpt_len = __UCLIBC_CURLOCALE_DATA.decimal_point_len;
 #else  /* __UCLIBC_HAS_LOCALE__ */
-       sc->fake_decpt = sc->decpt = decpt_str;
+       sc->fake_decpt = sc->decpt = (unsigned char *) decpt_str;
        sc->decpt_len = 1;
 #endif /* __UCLIBC_HAS_LOCALE__ */
 #ifdef __UCLIBC_HAS_WCHAR__
@@ -2087,7 +2087,7 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
                        }
                        ++psfs->cnt;
                        _store_inttype(psfs->cur_ptr, psfs->dataargtype,
-                                                  (uintmax_t) STRTOUIM(buf, NULL, base, 1-usflag));
+                                                  (uintmax_t) STRTOUIM((char *) buf, NULL, base, 1-usflag));
                }
                return 0;
        }
@@ -2101,7 +2101,7 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
        p = sc->fake_decpt;
        do {
                if (!*p) {
-                       strcpy(b, sc->decpt);
+                       strcpy((char *) b, (char *) sc->decpt);
                        b += sc->decpt_len;
                        break;
                }
@@ -2236,7 +2236,7 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
        {
                __fpmax_t x;
                char *e;
-               x = __strtofpmax(buf, &e, exp_adjust);
+               x = __strtofpmax((char *) buf, &e, exp_adjust);
                assert(!*e);
                if (psfs->store) {
                        if (psfs->dataargtype & PA_FLAG_LONG_LONG) {
index 571b99c..30ce7ca 100644 (file)
@@ -1427,7 +1427,7 @@ static size_t _charpad(FILE * __restrict stream, int padchar, size_t numpad)
        FMT_TYPE pad[1];
 
        *pad = padchar;
-       while (todo && (OUTNSTR(stream, pad, 1) == 1)) {
+       while (todo && (OUTNSTR(stream, (const unsigned char *) pad, 1) == 1)) {
                --todo;
        }
 
@@ -1831,7 +1831,7 @@ static int _do_one_spec(FILE * __restrict stream,
                        }
                }
 #else  /* __UCLIBC_HAS_WCHAR__ */
-               if (_outnstr(stream, s, slen) != slen) {
+               if (_outnstr(stream, (const unsigned char *) s, slen) != slen) {
                        return -1;
                }
 #endif /* __UCLIBC_HAS_WCHAR__ */
@@ -1886,7 +1886,7 @@ int VFPRINTF (FILE * __restrict stream,
        {
                count = -1;
        } else if (_PPFS_init(&ppfs, format) < 0) {     /* Bad format string. */
-               OUTNSTR(stream, (const FMT_TYPE *) ppfs.fmtpos,
+               OUTNSTR(stream, (const unsigned char *) ppfs.fmtpos,
                                STRLEN((const FMT_TYPE *)(ppfs.fmtpos)));
 #if defined(L_vfprintf) && !defined(NDEBUG)
                fprintf(stderr,"\nIMbS: \"%s\"\n\n", format);
@@ -1901,7 +1901,7 @@ int VFPRINTF (FILE * __restrict stream,
                        }
 
                        if (format-s) {         /* output any literal text in format string */
-                               if ( (r = OUTNSTR(stream, s, format-s)) != (format-s)) {
+                               if ( (r = OUTNSTR(stream, (const unsigned char *) s, format-s)) != (format-s)) {
                                        count = -1;
                                        break;
                                }
index 84215eb..51aaf43 100644 (file)
@@ -55,8 +55,8 @@ int vsnprintf(char *__restrict buf, size_t size,
 
        /* Set these last since __bufputc initialization depends on
         * __user_locking and only gets set if user locking is on. */
-       f.__bufstart = buf;
-       f.__bufend = buf + size;
+       f.__bufstart = (unsigned char *) buf;
+       f.__bufend = (unsigned char *) buf + size;
        __STDIO_STREAM_INIT_BUFREAD_BUFPOS(&f);
        __STDIO_STREAM_DISABLE_GETC(&f);
        __STDIO_STREAM_ENABLE_PUTC(&f);