Skip to content

Commit

Permalink
Report filenames in error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 12, 2009
1 parent 4018cf4 commit 3af56d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion assemble.c
Expand Up @@ -30,7 +30,8 @@ static int assemble(const char *buf, int len, const char *outfile)
int i;
for (i = 0; i < pd->error_count; i++)
{
printf("ERROR: (line %d) %s\n",
printf("%s:%d: ERROR: %s\n",
pd->errors[i].filename ? pd->errors[i].filename : "???",
pd->errors[i].error_position,
pd->errors[i].error);
} // for
Expand Down
5 changes: 4 additions & 1 deletion finderrors.c
Expand Up @@ -88,7 +88,10 @@ static int do_file(const char *profile, const char *dname, const char *fn, int *

if (a->error_count > 0)
{
report("FAIL: %s (line %d) %s\n", fname, a->errors[0].error_position, a->errors[0].error);
report("FAIL: %s (line %d) %s\n",
a->errors[0].filename ? a->errors[0].filename : "???",
a->errors[0].error_position,
a->errors[0].error);
return 1;
} // if

Expand Down
3 changes: 2 additions & 1 deletion preprocess.c
Expand Up @@ -31,7 +31,8 @@ static int preprocess(const char *buf, int len, const char *outfile)
int i;
for (i = 0; i < pd->error_count; i++)
{
printf("ERROR: (line %d) %s\n",
printf("%s:%d: ERROR: %s\n",
pd->errors[i].filename ? pd->errors[i].filename : "???",
pd->errors[i].error_position,
pd->errors[i].error);
} // for
Expand Down
3 changes: 2 additions & 1 deletion testoutput.c
Expand Up @@ -22,7 +22,8 @@ static int do_parse(const unsigned char *buf, const int len, const char *prof)
int i;
for (i = 0; i < pd->error_count; i++)
{
printf("ERROR: (line %d) %s\n",
printf("%s:%d: ERROR: %s\n",
pd->errors[i].filename ? pd->errors[i].filename : "???",
pd->errors[i].error_position,
pd->errors[i].error);
} // for
Expand Down
3 changes: 2 additions & 1 deletion testparse.c
Expand Up @@ -66,7 +66,8 @@ static int do_parse(const unsigned char *buf, const int len, const char *prof)
int i;
for (i = 0; i < pd->error_count; i++)
{
printf("ERROR: (position %d) %s\n",
printf("%s:%d: ERROR: %s\n",
pd->errors[i].filename ? pd->errors[i].filename : "???",
pd->errors[i].error_position,
pd->errors[i].error);
} // for
Expand Down

0 comments on commit 3af56d1

Please sign in to comment.