simplified assertion
authorceriel <none@none>
Thu, 19 Jan 1989 13:48:09 +0000 (13:48 +0000)
committerceriel <none@none>
Thu, 19 Jan 1989 13:48:09 +0000 (13:48 +0000)
mach/proto/as/comm2.y
mach/proto/as/comm4.c
mach/proto/as/comm6.c
mach/proto/as/comm7.c

index a824978..3dd9675 100644 (file)
@@ -115,16 +115,19 @@ program   :       /* empty */
                                newlabel(fb_shift((int)$2));
                        }
        |       program CODE1
-                       {       emit1((char)$2); LISTLINE(0);}
+                       {       emit1((int)$2); LISTLINE(0);}
        |       program CODE2
-                       {       emit2((short)$2); LISTLINE(0);}
+                       {       emit2((int)$2); LISTLINE(0);}
        |       program CODE4
                        {       emit4((long)$2); LISTLINE(0);}
        |       program operation ';'
        |       program operation '\n'
                        {       lineno++; LISTLINE(1); RELODONE;}
        |       program '#' NUMBER STRING '\n'
-                       {       lineno++; LISTLINE(1); RELODONE;}
+                       {       lineno = $3;
+                               if (modulename) strncpy(modulename, &stringbuf[1], 63);
+                               LISTLINE(1); RELODONE;
+                       }
        |       program error '\n'
                        {       serror("syntax error"); yyerrok;
                                lineno++; LISTLINE(1); RELODONE;
index cc1a68b..e1dac7f 100644 (file)
@@ -433,8 +433,14 @@ pass_23(n)
 newmodule(s)
 char *s;
 {
+       static char nmbuf[64];
+
        switchsect(S_UND);
-       modulename = s;
+       if (s && s != modulename) {
+               strncpy(nmbuf, s, 63);
+               modulename = nmbuf;
+       }
+       else modulename = s;
        lineno = 1;
 #ifdef NEEDED
         /*
index 1990b0e..1ecf20c 100644 (file)
@@ -89,7 +89,7 @@ register item_t *ip;
        if (store(ip, (valu_t) DOTVAL) == 0)
                return;
 #ifdef THREE_PASS
-       assert(pass != PASS_2 || (oldval -= ip->i_valu) == DOTGAIN);
+       assert(pass != PASS_2 || oldval - ip->i_valu == DOTGAIN);
 #endif
 }
 
index 87dfd72..3d0d72a 100644 (file)
@@ -233,7 +233,6 @@ small(fitsmall, gain)
 /* ---------- output ---------- */
 
 emit1(arg)
-char arg;
 {
 #ifdef LISTING
        if (listeoln) {
@@ -268,12 +267,12 @@ char arg;
 }
 
 emit2(arg)
-short arg;
+int arg;
 {
 #ifdef BYTES_REVERSED
-       emit1((char)(arg>>8)); emit1((char)arg);
+       emit1((arg>>8)); emit1(arg);
 #else
-       emit1((char)arg); emit1((char)(arg>>8));
+       emit1(arg); emit1((arg>>8));
 #endif
 }
 
@@ -281,9 +280,9 @@ emit4(arg)
 long arg;
 {
 #ifdef WORDS_REVERSED
-       emit2((short)(arg>>16)); emit2((short)(arg));
+       emit2((arg>>16)); emit2((arg));
 #else
-       emit2((short)(arg)); emit2((short)(arg>>16));
+       emit2((arg)); emit2((arg>>16));
 #endif
 }
 
@@ -293,9 +292,9 @@ int n;
 {
        switch (n) {
        case 1:
-               emit1((char)val); break;
+               emit1((int)val); break;
        case 2:
-               emit2((short)val); break;
+               emit2((int)val); break;
        case 4:
                emit4((long)val); break;
        default: