]> Shamusworld >> Repos - rmac/blobdiff - error.c
Added optimization flags to makefile (how long was THAT missing?)
[rmac] / error.c
diff --git a/error.c b/error.c
index c831d73667ba3760c61e0dc009eeb711f15255e0..fa4ceb54a7ee8c64346f70ffaa53660eb2090df3 100644 (file)
--- 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);
+       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));
@@ -114,9 +117,10 @@ int errors(char * s, char * s1)
        taglist('E');
        ++errcnt;
 
-       return(ERROR);
+       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));
@@ -135,9 +139,10 @@ int warn(char * s)
 
        taglist('W');
 
-       return(OK);
+       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));
@@ -158,9 +163,10 @@ int warns(char * s, char * s1)
 
        taglist('W');
 
-       return(OK);
+       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));
@@ -181,9 +187,10 @@ int warni(char * s, unsigned i)
 
        taglist('W');
 
-       return(OK);
+       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);