From 47bc7c51b7a11137c7706c0f12f0ce2f2f9eb21f Mon Sep 17 00:00:00 2001 From: explorer Date: Sat, 6 Feb 1999 11:57:35 +0000 Subject: [PATCH] rewrite usage of tailp slightly, to convince gcc that it really isn't used initialized. --- sys/kern/subr_prf.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index b7a22392efde..f4a45dbccb40 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_prf.c,v 1.59 1999/02/03 01:16:20 msaitoh Exp $ */ +/* $NetBSD: subr_prf.c,v 1.60 1999/02/06 11:57:35 explorer Exp $ */ /*- * Copyright (c) 1986, 1988, 1991, 1993 @@ -901,16 +901,16 @@ out: flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \ (u_long)va_arg(ap, u_int)) -#define KPRINTF_PUTCHAR(C) { \ - if (oflags == TOBUFONLY) { \ - if ((vp != NULL) && (sbuf == tailp)) { \ - ret += 1; /* indicate error */ \ - goto overflow; \ - } \ - *sbuf++ = (C); \ - } else { \ - putchar((C), oflags, (struct tty *)vp); \ - } \ +#define KPRINTF_PUTCHAR(C) { \ + if (oflags == TOBUFONLY) { \ + if ((vp != NULL) && (sbuf == tailp)) { \ + ret += 1; /* indicate error */ \ + goto overflow; \ + } \ + *sbuf++ = (C); \ + } else { \ + putchar((C), oflags, (struct tty *)vp); \ + } \ } /* @@ -943,8 +943,9 @@ kprintf(fmt0, oflags, vp, sbuf, ap) char buf[KPRINTF_BUFSIZE]; /* space for %c, %[diouxX] */ char *tailp = NULL; /* tail pointer for snprintf */ - if (oflags == TOBUFONLY) - tailp = (vp != NULL) ? *(char **)vp : NULL; + tailp = NULL; + if (oflags == TOBUFONLY && (vp != NULL)) + tailp = *(char **)vp; cp = NULL; /* XXX: shutup gcc */ size = 0; /* XXX: shutup gcc */