mirror of
https://github.com/Museum-of-Art-and-Digital-Entertainment/macross.git
synced 2024-09-29 08:58:01 +00:00
Use varargs for errors in Slinky
This commit is contained in:
parent
4c56782718
commit
4ab0baafe6
@ -30,15 +30,10 @@
|
|||||||
#include "slinkyTypes.h"
|
#include "slinkyTypes.h"
|
||||||
#include "slinkyGlobals.h"
|
#include "slinkyGlobals.h"
|
||||||
|
|
||||||
void
|
#include <stdarg.h>
|
||||||
error(theError, arg1, arg2, arg3, arg4, arg5, arg6)
|
|
||||||
errorType theError;
|
static void
|
||||||
anyOldThing *arg1;
|
verror(errorType theError, va_list ap)
|
||||||
anyOldThing *arg2;
|
|
||||||
anyOldThing *arg3;
|
|
||||||
anyOldThing *arg4;
|
|
||||||
anyOldThing *arg5;
|
|
||||||
anyOldThing *arg6;
|
|
||||||
{
|
{
|
||||||
/* This table MUST be maintained congruently with the definition of the
|
/* This table MUST be maintained congruently with the definition of the
|
||||||
enumerated type 'errorType'. */
|
enumerated type 'errorType'. */
|
||||||
@ -79,8 +74,16 @@ error(theError, arg1, arg2, arg3, arg4, arg5, arg6)
|
|||||||
};
|
};
|
||||||
|
|
||||||
printf("\"%s\": ", currentFileName);
|
printf("\"%s\": ", currentFileName);
|
||||||
printf(errorMessageStrings[(int)theError], arg1, arg2, arg3, arg4,
|
vprintf(errorMessageStrings[(int)theError], ap);
|
||||||
arg5, arg6);
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
errorFlag = TRUE;
|
errorFlag = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
error(errorType theError, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, theError);
|
||||||
|
verror(theError, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user