Switch error() and fatal() in mach/proto/ncg to stdarg.
This is like David Given's change to util/ncgg in d89f172
. I need
this change in mach/proto/ncg to see fatal messages, because a 64-bit
pointer doesn't fit in an int.
This commit is contained in:
parent
a20b87ca01
commit
aa47f52166
2 changed files with 13 additions and 8 deletions
|
@ -54,4 +54,6 @@ extern int *rvnumbers[]; /* lists of numbers */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern FILE *codefile;
|
extern FILE *codefile;
|
||||||
extern FILE *freopen();
|
|
||||||
|
extern void error(const char *s, ...);
|
||||||
|
extern void fatal(const char *s, ...);
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
static char rcsid[] = "$Id$";
|
static char rcsid[] = "$Id$";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "param.h"
|
#include "param.h"
|
||||||
#include "tables.h"
|
#include "tables.h"
|
||||||
|
@ -657,11 +658,12 @@ itokcost() {
|
||||||
tdp->t_cost.ct_space = costcalc(tdp->t_cost);
|
tdp->t_cost.ct_space = costcalc(tdp->t_cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*VARARGS1*/
|
void error(const char *s, ...) {
|
||||||
error(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap,s);
|
||||||
fprintf(stderr,"Error: ");
|
fprintf(stderr,"Error: ");
|
||||||
fprintf(stderr,s,a1,a2,a3,a4,a5,a6,a7,a8);
|
vfprintf(stderr,s,ap);
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
#ifdef TABLEDEBUG
|
#ifdef TABLEDEBUG
|
||||||
ruletrace();
|
ruletrace();
|
||||||
|
@ -670,11 +672,12 @@ error(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*VARARGS1*/
|
void fatal(const char *s, ...) {
|
||||||
fatal(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap,s);
|
||||||
fprintf(stderr,"Fatal: ");
|
fprintf(stderr,"Fatal: ");
|
||||||
fprintf(stderr,s,a1,a2,a3,a4,a5,a6,a7,a8);
|
vfprintf(stderr,s,ap);
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
#ifdef TABLEDEBUG
|
#ifdef TABLEDEBUG
|
||||||
ruletrace();
|
ruletrace();
|
||||||
|
|
Loading…
Reference in a new issue