Fix compiler warning.
authorGarrett Wollman <wollman@FreeBSD.org>
Sun, 6 Feb 1994 07:35:24 +0000 (07:35 +0000)
committerGarrett Wollman <wollman@FreeBSD.org>
Sun, 6 Feb 1994 07:35:24 +0000 (07:35 +0000)
lib/libc/stdio/vfprintf.c
lib/libc/stdlib/exit.c
lib/libc/stdlib/strtol.c
lib/libc/stdlib/strtoq.c
lib/libc/stdlib/strtoul.c
lib/libc/stdlib/strtouq.c

index 606102c..f813591 100644 (file)
@@ -36,7 +36,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)vfprintf.c  5.50 (Berkeley) 12/16/92";*/
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)vfprintf.c  5.50 (Berkeley) 12/16/92";*/
-static char *rcsid = "$Id: vfprintf.c,v 1.9 1993/11/04 02:26:10 jtc Exp $";
+static char *rcsid = "$Id: vfprintf.c,v 1.4 1993/11/04 19:38:22 jtc Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 /*
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -475,7 +475,12 @@ reswitch:  switch (ch) {
                         *      -- ANSI X3J11
                         */
                        /* NOSTRICT */
                         *      -- ANSI X3J11
                         */
                        /* NOSTRICT */
+                       /* no easy way to tell in cpp how big a type is */
+#if defined(__i386)
+                       _uquad = (u_quad_t)(u_long)va_arg(ap, void *);
+#else
                        _uquad = (u_quad_t)va_arg(ap, void *);
                        _uquad = (u_quad_t)va_arg(ap, void *);
+#endif
                        base = HEX;
                        xdigs = "0123456789abcdef";
                        flags |= HEXPREFIX;
                        base = HEX;
                        xdigs = "0123456789abcdef";
                        flags |= HEXPREFIX;
index 0d3c725..50c872a 100644 (file)
@@ -57,4 +57,6 @@ exit(status)
        if (__cleanup)
                (*__cleanup)();
        _exit(status);
        if (__cleanup)
                (*__cleanup)();
        _exit(status);
+       /* We'll never get here; this just surpresses a warning. */
+       while(1) { ; }
 }
 }
index 000d876..1c1d5c9 100644 (file)
@@ -124,6 +124,6 @@ strtol(nptr, endptr, base)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
-               *endptr = any ? s - 1 : (char *)nptr;
+               *endptr = any ? (char *)s - 1 : (char *)nptr;
        return (acc);
 }
        return (acc);
 }
index 621d2a0..af02765 100644 (file)
@@ -131,6 +131,6 @@ strtoq(nptr, endptr, base)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
-               *endptr = any ? s - 1 : (char *)nptr;
+               *endptr = any ? (char *)s - 1 : (char *)nptr;
        return (acc);
 }
        return (acc);
 }
index ed8c108..284c182 100644 (file)
@@ -102,6 +102,6 @@ strtoul(nptr, endptr, base)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
-               *endptr = any ? s - 1 : (char *)nptr;
+               *endptr = any ? (char *)s - 1 : (char *)nptr;
        return (acc);
 }
        return (acc);
 }
index 67fa68b..14e37e0 100644 (file)
@@ -109,6 +109,6 @@ strtouq(nptr, endptr, base)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
        } else if (neg)
                acc = -acc;
        if (endptr != 0)
-               *endptr = any ? s - 1 : (char *)nptr;
+               *endptr = any ? (char *)s - 1 : (char *)nptr;
        return (acc);
 }
        return (acc);
 }