X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=error.c;h=fa4ceb54a7ee8c64346f70ffaa53660eb2090df3;hp=c73cec52b0869af16b2c350c5e393727ea3c0434;hb=26bc03271bede4256ab52496d52de67018e33a01;hpb=d09274f3e3d4dca122c308a621ea8edc100b7d99 diff --git a/error.c b/error.c index c73cec5..fa4ceb5 100644 --- a/error.c +++ b/error.c @@ -47,7 +47,9 @@ void err_setup(void) { char fnbuf[FNSIZ]; - setfnum(cfileno); +// This seems like it's unnecessary, as token.c seems to take care of this all by itself. +// Can restore if it's really needed. If not, into the bit bucket it goes. :-) +// setfnum(cfileno); if (err_fname != NULL) { @@ -69,7 +71,7 @@ void err_setup(void) // // Display Error Message // -int error(char * s) +int error(const char * s) { char buf[EBUFSIZ]; unsigned int length; @@ -79,7 +81,7 @@ int error(char * s) if (listing > 0) ship_ln(s); - sprintf(buf, "%s%d: Error: %s%s", curfname, curlineno, s, nl); + sprintf(buf, "%s %d: Error: %s%s", curfname, curlineno, s, nl); length = strlen(buf); if (err_flag) @@ -88,11 +90,12 @@ int error(char * s) printf("%s", buf); taglist('E'); - ++errcnt; + errcnt++; return ERROR; } + int errors(char * s, char * s1) { char buf[EBUFSIZ]; @@ -104,7 +107,7 @@ int errors(char * s, char * s1) if (listing > 0) ship_ln(buf); - sprintf(buf1, "%s%d: Error: %s%s", curfname, curlineno, buf, nl); + sprintf(buf1, "%s %d: Error: %s%s", curfname, curlineno, buf, nl); if (err_flag) write(err_fd, buf1, (LONG)strlen(buf1)); @@ -117,6 +120,7 @@ int errors(char * s, char * s1) return ERROR; } + int warn(char * s) { char buf[EBUFSIZ]; @@ -126,7 +130,7 @@ int warn(char * s) if (listing > 0) ship_ln(s); - sprintf(buf, "%s%d: Warning: %s%s", curfname, curlineno, s, nl); + sprintf(buf, "%s %d: Warning: %s%s", curfname, curlineno, s, nl); if (err_flag) write(err_fd, buf, (LONG)strlen(buf)); @@ -138,6 +142,7 @@ int warn(char * s) return OK; } + int warns(char * s, char * s1) { char buf[EBUFSIZ]; @@ -149,7 +154,7 @@ int warns(char * s, char * s1) if (listing > 0) ship_ln(s); - sprintf(buf1, "%s%d: Warning: %s%s", curfname, curlineno, buf, nl); + sprintf(buf1, "%s %d: Warning: %s%s", curfname, curlineno, buf, nl); if (err_flag) write(err_fd, buf1, (LONG)strlen(buf1)); @@ -161,6 +166,7 @@ int warns(char * s, char * s1) return OK; } + int warni(char * s, unsigned i) { char buf[EBUFSIZ]; @@ -172,7 +178,7 @@ int warni(char * s, unsigned i) if (listing > 0) ship_ln(buf); - sprintf(buf1, "%s%d: Warning: %s%s", curfname, curlineno, buf, nl); + sprintf(buf1, "%s %d: Warning: %s%s", curfname, curlineno, buf, nl); if (err_flag) write(err_fd, buf1, (LONG)strlen(buf1)); @@ -184,6 +190,7 @@ int warni(char * s, unsigned i) return OK; } + int fatal(char * s) { char buf[EBUFSIZ]; @@ -193,7 +200,7 @@ int fatal(char * s) if (listing > 0) ship_ln(s); - sprintf(buf, "%s%d: Fatal: %s%s", curfname, curlineno, s, nl); + sprintf(buf, "%s %d: Fatal: %s%s", curfname, curlineno, s, nl); if (err_flag) write(err_fd, buf, (LONG)strlen(buf)); @@ -203,12 +210,13 @@ int fatal(char * s) exit(1); } + int interror(int n) { char buf[EBUFSIZ]; err_setup(); - sprintf(buf, "%s%d: Internal Error Number %d%s", curfname, curlineno, n, nl); + sprintf(buf, "%s %d: Internal Error Number %d%s", curfname, curlineno, n, nl); if (listing > 0) ship_ln(buf);