/*****************************************************************************/
/* */
-/* error.c */
+/* error.c */
/* */
-/* Error handling for the cc65 C compiler */
+/* Error handling for the cc65 C compiler */
/* */
/* */
/* */
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Count of errors/warnings */
-unsigned ErrorCount = 0;
-unsigned WarningCount = 0;
+unsigned ErrorCount = 0;
+unsigned WarningCount = 0;
/* Warning and error options */
IntStack WarnEnable = INTSTACK(1); /* Enable warnings */
const char* FileName;
unsigned LineNum;
if (CurTok.LI) {
- FileName = GetInputName (CurTok.LI);
- LineNum = GetInputLine (CurTok.LI);
+ FileName = GetInputName (CurTok.LI);
+ LineNum = GetInputLine (CurTok.LI);
} else {
- FileName = GetCurrentFile ();
- LineNum = GetCurrentLine ();
+ FileName = GetCurrentFile ();
+ LineNum = GetCurrentLine ();
}
fprintf (stderr, "%s(%u): Fatal: ", FileName, LineNum);
const char* FileName;
unsigned LineNum;
if (CurTok.LI) {
- FileName = GetInputName (CurTok.LI);
- LineNum = GetInputLine (CurTok.LI);
+ FileName = GetInputName (CurTok.LI);
+ LineNum = GetInputLine (CurTok.LI);
} else {
- FileName = GetCurrentFile ();
- LineNum = GetCurrentLine ();
+ FileName = GetCurrentFile ();
+ LineNum = GetCurrentLine ();
}
fprintf (stderr, "%s(%u): Internal compiler error:\n",
- FileName, LineNum);
+ FileName, LineNum);
va_start (ap, Format);
vfprintf (stderr, Format, ap);
}
++ErrorCount;
if (ErrorCount > 10) {
- Fatal ("Too many errors");
+ Fatal ("Too many errors");
}
}
} else if (IS_Get (&WarnEnable)) {
- fprintf (stderr, "%s(%u): Warning: ", Filename, LineNo);
- vfprintf (stderr, Msg, ap);
- fprintf (stderr, "\n");
+ fprintf (stderr, "%s(%u): Warning: ", Filename, LineNo);
+ vfprintf (stderr, Msg, ap);
+ fprintf (stderr, "\n");
if (Line) {
- Print (stderr, 1, "Input: %.*s\n", (int) SB_GetLen (Line), SB_GetConstBuf (Line));
+ Print (stderr, 1, "Input: %.*s\n", (int) SB_GetLen (Line), SB_GetConstBuf (Line));
}
- ++WarningCount;
+ ++WarningCount;
}
}