From 2d98c32cb2ed06aef17504340ada065c9f3e84ee Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 9 Sep 1988 11:32:59 +0000 Subject: [PATCH] use varargs --- util/ceg/EM_parser/as_EM_pars/error.c | 15 +++++++++++---- util/ceg/EM_parser/common/help.c | 17 +++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/util/ceg/EM_parser/as_EM_pars/error.c b/util/ceg/EM_parser/as_EM_pars/error.c index e0ade1c5b..3b6eca4be 100644 --- a/util/ceg/EM_parser/as_EM_pars/error.c +++ b/util/ceg/EM_parser/as_EM_pars/error.c @@ -1,13 +1,20 @@ #include +#include extern int nerrors; -error( fmt, argv) -char *fmt; -int argv; +/*VARARGS*/ +error(va_alist) +va_dcl { + char *fmt; + va_list pvar; + + va_start(pvar); + fmt = va_arg(pvar, char *); fprint( STDERR, "!! ERROR : "); - doprnt( STDERR, fmt, &argv); + doprnt( STDERR, fmt, pvar); fprint( STDERR, " !!\n"); + va_end(pvar); nerrors++; } diff --git a/util/ceg/EM_parser/common/help.c b/util/ceg/EM_parser/common/help.c index 1ebeffcb8..a66edc9e8 100644 --- a/util/ceg/EM_parser/common/help.c +++ b/util/ceg/EM_parser/common/help.c @@ -1,5 +1,6 @@ #include #include +#include #define CODE_EXPANDER #include "em.h" @@ -98,15 +99,19 @@ int seg; } } - -out( fmt, argv) -char *fmt; -int argv; +/*VARARGS*/ +out(va_alist) +va_dcl { - doprnt( outfile, fmt, &argv); + va_list pvar; + char *fmt; + + va_start(pvar); + fmt = va_arg(pvar, char *); + doprnt( outfile, fmt, pvar); + va_end(pvar); } - char *suffix( str, suf) char *str, *suf; {