diff --git a/fast/driver/driver.c b/fast/driver/driver.c index 37fce00e7..3f4388909 100644 --- a/fast/driver/driver.c +++ b/fast/driver/driver.c @@ -31,9 +31,13 @@ Something wrong here! Only one of FM2, FPC, or FCC must be defined #include #include -#include #include #include +#if __STDC__ +#include +#else +#include +#endif /* Version producing ACK .o files in one pass. @@ -178,7 +182,11 @@ int v_flag = 0; int O_flag = 0; int ansi_c = 0; +#if __STDC__ +char *mkstr(char *, ...); +#else char *mkstr(); +#endif char *malloc(); char *alloc(); char *extension(); @@ -669,7 +677,32 @@ concat(al1, al2) *p++ = *q++; } } +#if __STDC__ +/*VARARGS*/ +char * +mkstr(char *dst, ...) +{ + va_list ap; + va_start(ap, dst); + { + register char *p; + register char *q; + + q = dst; + p = va_arg(ap, char *); + + while (p) { + while (*q++ = *p++); + q--; + p = va_arg(ap, char *); + } + } + va_end(ap); + + return dst; +} +#else /*VARARGS*/ char * mkstr(va_alist) @@ -696,7 +729,7 @@ mkstr(va_alist) return dst; } - +#endif basename(str, dst) char *str; register char *dst; diff --git a/util/ceg/EM_parser/as_EM_pars/error.c b/util/ceg/EM_parser/as_EM_pars/error.c index 3b6eca4be..e93c79f5b 100644 --- a/util/ceg/EM_parser/as_EM_pars/error.c +++ b/util/ceg/EM_parser/as_EM_pars/error.c @@ -1,8 +1,26 @@ #include +#if __STDC__ +#include +#else #include +#endif extern int nerrors; +#if __STDC__ +/*VARARGS*/ +error(char *fmt, ...) +{ + va_list pvar; + + va_start(pvar, fmt); + fprint( STDERR, "!! ERROR : "); + doprnt( STDERR, fmt, pvar); + fprint( STDERR, " !!\n"); + va_end(pvar); + nerrors++; +} +#else /*VARARGS*/ error(va_alist) va_dcl @@ -18,3 +36,4 @@ va_dcl va_end(pvar); nerrors++; } +#endif diff --git a/util/grind/tree.c b/util/grind/tree.c index 74c0a577d..f01ccc633 100644 --- a/util/grind/tree.c +++ b/util/grind/tree.c @@ -1,10 +1,14 @@ /* $Id$ */ #include -#include #include #include #include +#if __STDC__ +#include +#else +#include +#endif #include "operator.h" #include "position.h" @@ -24,6 +28,20 @@ t_lineno listline; extern char *strrindex(); extern int interrupted; +#if __STDC__ +/*VARARGS1*/ +p_tree +mknode(int op, ...) +{ + va_list ap; + register p_tree p = new_tree(); + + va_start(ap, op); + { + register int i, na; + + p->t_oper = op; +#else /*VARARGS1*/ p_tree mknode(va_alist) @@ -37,6 +55,7 @@ mknode(va_alist) register int i, na; p->t_oper = va_arg(ap, int); +#endif switch(p->t_oper) { case OP_NAME: case OP_HELP: diff --git a/util/grind/tree.hh b/util/grind/tree.hh index 9ddb0c36f..4a74ab4e1 100644 --- a/util/grind/tree.hh +++ b/util/grind/tree.hh @@ -30,4 +30,8 @@ typedef struct tree { /* ALLOCDEF "tree" 100 */ +#if __STDC__ +extern p_tree mknode(int, ...); +#else extern p_tree mknode(); +#endif diff --git a/util/int/io.c b/util/int/io.c index 0a1b68a4d..322971f6c 100644 --- a/util/int/io.c +++ b/util/int/io.c @@ -5,7 +5,12 @@ /* $Id$ */ #include +#if __STDC__ +#include +extern fatal(char *, ...); +#else #include +#endif #include "logging.h" #include "global.h" @@ -105,6 +110,34 @@ init_ofiles(firsttime) #endif /* LOGGING */ } +#if __STDC__ +/*VARARGS0*/ +fatal(char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "%s: ", prog_name); + + va_start(ap, fmt); + { + do_fatal(stderr, fmt, ap); + } + va_end(ap); + + if (mess_fp) { + va_start(ap, fmt); + { + do_fatal(mess_fp, fmt, ap); + } + va_end(ap); + } + + if (running) + core_dump(); + + close_down(1); +} +#else /*VARARGS0*/ fatal(va_alist) va_dcl @@ -134,6 +167,7 @@ fatal(va_alist) close_down(1); } +#endif close_down(rc) int rc; @@ -163,6 +197,23 @@ PRIVATE do_fatal(fp, fmt, ap) fputc('\n', fp); } +#if __STDC__ +/*VARARGS0*/ +message(char *fmt, ...) +{ + va_list ap; + + fprintf(mess_fp, "(Message): "); + + va_start(ap, fmt); + { + vfprintf(mess_fp, fmt, ap); + } + va_end(ap); + + fprintf(mess_fp, " at %s\n", position()); +} +#else /*VARARGS0*/ message(va_alist) va_dcl @@ -180,6 +231,7 @@ message(va_alist) fprintf(mess_fp, " at %s\n", position()); } +#endif char *position() /* transient */ { diff --git a/util/int/log.c b/util/int/log.c index 9941cfb44..517d90a88 100644 --- a/util/int/log.c +++ b/util/int/log.c @@ -5,7 +5,11 @@ /* $Id$ */ #include +#if __STDC__ +#include +#else #include +#endif #include "logging.h" #include "global.h" @@ -239,6 +243,16 @@ int check_log(mark) return ((mark[2] - '0') <= log_level[mark[1]]); } +#if __STDC__ +/*VARARGS*/ +do_log(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + { + +#else /*VARARGS*/ do_log(va_alist) va_dcl @@ -249,6 +263,7 @@ do_log(va_alist) { char *fmt = va_arg(ap, char *); +#endif if (!check_log(fmt)) return;