make error message global var, so routine can be inline expanded
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sat, 13 Nov 1982 10:59:06 +0000 (02:59 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sat, 13 Nov 1982 10:59:06 +0000 (02:59 -0800)
SCCS-vsn: usr.bin/pascal/libpc/ASRT.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/CHR.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/LINO.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/NIL.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/RANG4.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/RSNG4.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/SUBSC.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/SUBSCZ.c 1.4

usr/src/usr.bin/pascal/libpc/ASRT.c
usr/src/usr.bin/pascal/libpc/CHR.c
usr/src/usr.bin/pascal/libpc/LINO.c
usr/src/usr.bin/pascal/libpc/NIL.c
usr/src/usr.bin/pascal/libpc/RANG4.c
usr/src/usr.bin/pascal/libpc/RSNG4.c
usr/src/usr.bin/pascal/libpc/SUBSC.c
usr/src/usr.bin/pascal/libpc/SUBSCZ.c

index 02043a9..16322a1 100644 (file)
@@ -1,21 +1,14 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)ASRT.c 1.2 %G%";
+static char sccsid[] = "@(#)ASRT.c 1.3 %G%";
 
 
-#define NULL 0
-
-ASRT(cond, stmt)
+char EASRT[] = "Assertion failed\n";
 
 
+ASRT(cond)
        short   cond;
        short   cond;
-       char    *stmt;
 {
        if (cond)
                return;
 {
        if (cond)
                return;
-       if (stmt != NULL) {
-               ERROR("Assertion failed: %s\n", stmt);
-               return;
-       } else {
-               ERROR("Assertion failed\n", 0);
-               return;
-       }
+       ERROR(EASRT, 0);
+       return;
 }
 }
index cc7fdd3..8e0c829 100644 (file)
@@ -1,15 +1,15 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)CHR.c 1.3 %G%";
+static char sccsid[] = "@(#)CHR.c 1.4 %G%";
 
 
+char ECHR[] = "Argument to chr of %D is out of range\n";
 
 char
 CHR(value)
 
 char
 CHR(value)
-
-       long    value;
+       unsigned long   value;
 {
 {
-       if (value < 0 || value > 127) {
-               ERROR("Argument to chr of %D is out of range\n", value);
+       if (value > 127) {
+               ERROR(ECHR, value);
                return;
        }
        return (char)value;
                return;
        }
        return (char)value;
index 85858e3..0f01b89 100644 (file)
@@ -1,13 +1,15 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)LINO.c 1.2 %G%";
+static char sccsid[] = "@(#)LINO.c 1.3 %G%";
 
 #include "h00vars.h"
 
 
 #include "h00vars.h"
 
+char ELINO[] = "Statement count limit of %D exceeded\n";
+
 LINO()
 {
        if (++_stcnt >= _stlim) {
 LINO()
 {
        if (++_stcnt >= _stlim) {
-               ERROR("Statement count limit of %D exceeded\n", _stcnt);
+               ERROR(ELINO, _stcnt);
                return;
        }
 }
                return;
        }
 }
index 7c2c584..dfbf6f9 100644 (file)
@@ -1,16 +1,17 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)NIL.c 1.2 %G%";
+static char sccsid[] = "@(#)NIL.c 1.3 %G%";
 
 #include "h00vars.h"
 
 
 #include "h00vars.h"
 
+char ENIL[] = "Pointer value out of legal range\n";
+
 char *
 NIL(ptr)
 char *
 NIL(ptr)
-
        char    *ptr;           /* pointer to struct */
 {
        if (ptr > _maxptr || ptr < _minptr) {
        char    *ptr;           /* pointer to struct */
 {
        if (ptr > _maxptr || ptr < _minptr) {
-               ERROR("Pointer value out of legal range\n", 0);
+               ERROR(ENIL, 0);
                return;
        }
        return ptr;
                return;
        }
        return ptr;
index 1974768..ef08228 100644 (file)
@@ -1,17 +1,17 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)RANG4.c 1.3 %G%";
+static char sccsid[] = "@(#)RANG4.c 1.4 %G%";
 
 
+char ERANG[] = "Value of %D is out of range\n";
 
 long
 RANG4(value, lower, upper)
 
 long
 RANG4(value, lower, upper)
-
        long    value;
        long    lower;
        long    upper;
 {
        if (value < lower || value > upper) {
        long    value;
        long    lower;
        long    upper;
 {
        if (value < lower || value > upper) {
-               ERROR("Value of %D is out of range\n", value);
+               ERROR(ERANG, value);
                return;
        }
        return  value;
                return;
        }
        return  value;
index 270bfec..68be591 100644 (file)
@@ -1,16 +1,16 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)RSNG4.c 1.3 %G%";
+static char sccsid[] = "@(#)RSNG4.c 1.4 %G%";
 
 
+extern char ERANG[];   /* ERANG is defined in RANG4.c */
 
 long
 RSNG4(value, upper)
 
 long
 RSNG4(value, upper)
-
-       long    value;
-       long    upper;
+       long            value;
+       unsigned long   upper;
 {
 {
-       if (value < 0 || value > upper) {
-               ERROR("Value of %D is out of range\n", value);
+       if (value > upper) {
+               ERROR(ERANG, value);
                return;
        }
        return  value;
                return;
        }
        return  value;
index 9f7233e..7ddb7e7 100644 (file)
@@ -1,7 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SUBSC.c 1.3 %G%";
+static char sccsid[] = "@(#)SUBSC.c 1.4 %G%";
 
 
+char ESUBSC[] = "Subscript value of %D is out of range\n";
 
 long
 SUBSC(i, lower, upper)
 
 long
 SUBSC(i, lower, upper)
@@ -9,7 +10,7 @@ SUBSC(i, lower, upper)
        long    i, lower, upper;
 {
        if (i < lower || i > upper) {
        long    i, lower, upper;
 {
        if (i < lower || i > upper) {
-               ERROR("Subscript value of %D is out of range\n", i);
+               ERROR(ESUBSC, i);
                return;
        }
        return i;
                return;
        }
        return i;
index 6fc206b..cb6cb0e 100644 (file)
@@ -1,16 +1,17 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SUBSCZ.c 1.3 %G%";
+static char sccsid[] = "@(#)SUBSCZ.c 1.4 %G%";
 
 
+extern char ESUBSC[];  /* ESUBSC is defined in SUBSCZ.c */
 
 long
 
 long
-SUBSCZ(i, upper)
-
-       long    i, upper;
+SUBSCZ(value, upper)
+       long            value;
+       unsigned long   upper;
 {
 {
-       if (i < 0 || i > upper) {
-               ERROR("Subscript value of %D is out of range\n", i);
+       if (value > upper) {
+               ERROR(ESUBSC, value);
                return;
        }
                return;
        }
-       return i;
+       return value;
 }
 }