mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-23 02:29:21 +00:00
Replaced fprintf & exterr with ERROR macro invocation
This commit is contained in:
parent
90c9162971
commit
2126642205
@ -211,8 +211,7 @@ void prcopr(void) {
|
||||
asmlin("EOR", term);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unrecognized operator '%c'\n", oper);
|
||||
exterr(EXIT_FAILURE);
|
||||
ERROR("Unrecognized operator '%c'\n", oper, EXIT_FAILURE)
|
||||
}
|
||||
oper = 0;
|
||||
}
|
||||
|
@ -93,10 +93,8 @@ void pascii(void) {
|
||||
invasc = TRUE;
|
||||
if (wordis("HIGH"))
|
||||
mskasc = TRUE;
|
||||
else {
|
||||
fprintf(stderr, "Unrecognized option '%s'\n", word);
|
||||
exterr(EXIT_FAILURE);
|
||||
}
|
||||
else
|
||||
ERROR("Unrecognized option '%s'\n", word, EXIT_FAILURE)
|
||||
}
|
||||
|
||||
/* Parse Origin Subdirective */
|
||||
@ -145,19 +143,15 @@ void pincdr(void) {
|
||||
pdefin();
|
||||
else if (wordis("PRAGMA"))
|
||||
pprgma();
|
||||
else {
|
||||
fprintf(stderr, "Unrecognized directive '%s'\n", word);
|
||||
exterr(EXIT_FAILURE);
|
||||
}
|
||||
else
|
||||
ERROR("Unrecognized directive '%s'\n", word, EXIT_FAILURE)
|
||||
}
|
||||
|
||||
/* Parse Header Word */
|
||||
void phdwrd(void) {
|
||||
getwrd();
|
||||
if (!ptype(MTNONE)) {
|
||||
fprintf(stderr, "Unexpected word '%s' in header\n", word);
|
||||
exterr(EXIT_FAILURE);
|
||||
}
|
||||
if (!ptype(MTNONE))
|
||||
ERROR("Unexpected word '%s' in header\n", word, EXIT_FAILURE)
|
||||
}
|
||||
|
||||
/* Save Source File Information */
|
||||
@ -217,8 +211,7 @@ void inchdr(void) {
|
||||
else if (isalph())
|
||||
phdwrd();
|
||||
else {
|
||||
fprintf(stderr, "Unexpected character '%c'\n", nxtchr);
|
||||
exterr(EXIT_FAILURE);
|
||||
ERROR("Unexpected character '%c'\n", nxtchr, EXIT_FAILURE)
|
||||
}
|
||||
}
|
||||
clsinc();
|
||||
@ -242,8 +235,7 @@ void pincfl(void) {
|
||||
DEBUG("Processing include file '%s'\n", incnam)
|
||||
char *dot = strrchr(incnam, '.'); //find extension
|
||||
if (dot == NULL) {
|
||||
fprintf(stderr, "Invalid include file name '%sn", incnam);
|
||||
exterr(EXIT_FAILURE);
|
||||
ERROR("Invalid include file name '%sn", incnam, EXIT_FAILURE)
|
||||
}
|
||||
if (strcmp(dot, ".a02") == 0)
|
||||
incasm();
|
||||
@ -255,8 +247,7 @@ void pincfl(void) {
|
||||
incasm(); //Process Assembly File with Same Name
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Unrecognized include file extension '%s'\n'", dot);
|
||||
exterr(EXIT_FAILURE);
|
||||
ERROR("Unrecognized include file extension '%s'\n'", dot, EXIT_FAILURE)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,10 +91,7 @@ int look(char c) {
|
||||
void expect(char c) {
|
||||
if (c == 0) return;
|
||||
if (look(c)) return;
|
||||
else {
|
||||
fprintf(stderr, "Expected Character '%c', but found '%c'\n", c, nxtchr);
|
||||
exterr(EXIT_FAILURE);
|
||||
}
|
||||
else ERROR("Expected Character '%c'\n", c, EXIT_FAILURE)
|
||||
}
|
||||
|
||||
/* Advance Input File to next printable character */
|
||||
@ -425,8 +422,7 @@ void prcpst(char* name, char *index) {
|
||||
asmlin("LSR", name);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unrecognized post operator '%c'\n", oper);
|
||||
exterr(EXIT_FAILURE);
|
||||
ERROR("Unrecognized post operator '%c'\n", oper, EXIT_FAILURE)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,8 @@
|
||||
* Returns: TRUE if found, otherwise FALSE */
|
||||
int fndvar(char *name) {
|
||||
DEBUG("Looking up variable '%s'\n", word)
|
||||
for (varidx=0; varidx<varcnt; varidx++) {
|
||||
if (strcmp(varnam[varidx], name) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
for (varidx=0; varidx<varcnt; varidx++)
|
||||
if (strcmp(varnam[varidx], name) == 0) return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user