From 94d839041dd1704e405a4a987d670cb0cb94468d Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 9 Jan 1996 03:01:45 +0000 Subject: clean up si_dprintf a bit so that it uses vararg argument parsing that does not cause warnings, and uses printf() to do a vprintf()-like output. --- sys/dev/si/si.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'sys/dev/si/si.c') diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index 48d8e11..d38db1e 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -69,6 +69,7 @@ static char si_copyright1[] = "@(#) (C) Specialix International, 1990,1992", #include #include +#include #include "si.h" @@ -129,10 +130,13 @@ static struct cdevsw si_cdevsw = #ifdef SI_DEBUG /* use: ``options "SI_DEBUG"'' in your config file */ -/* XXX: should be varargs, I know.. but where's vprintf()? */ -static void si_dprintf __P((/* struct si_port *pp, int flags, char *str, int a1, int a2, int a3, int a4, int a5, int a6 */)); + +static void si_dprintf __P((struct si_port *pp, int flags, const char *fmt, + ...)); static char *si_mctl2str __P((enum si_mctl cmd)); + #define DPRINT(x) si_dprintf x + #else #define DPRINT(x) /* void */ #endif @@ -2327,20 +2331,27 @@ si_disc_optim(tp, t, pp) #ifdef SI_DEBUG + static void -si_dprintf(pp, flags, str, a1, a2, a3, a4, a5, a6) +#ifdef __STDC__ +si_dprintf(struct si_port *pp, int flags, const char *fmt, ...) +#else +si_dprintf(pp, flags, fmt, va_alist) struct si_port *pp; int flags; - char *str; - int a1, a2, a3, a4, a5, a6; + char *fmt; +#endif { + va_list ap; if ((pp == NULL && (si_debug&flags)) || (pp != NULL && ((pp->sp_debug&flags) || (si_debug&flags)))) { + va_start(ap, fmt); if (pp != NULL) printf("%ci%d(%d): ", 's', (int)SI_CARD(pp->sp_tty->t_dev), (int)SI_PORT(pp->sp_tty->t_dev)); - printf(str, a1, a2, a3, a4, a5, a6); + printf("%r", fmt, ap); + va_end(ap); } } -- cgit v1.1