Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.123
 
1.124
 
MAIN:ragge:20110221080042
 
cpp.c
_>896896         exit(1);
 897897 }
 898898 
<> 899+static void
  900+sss(void)
  901+{
  902+        savch(EBLOCK);
  903+        savch(cinput());
  904+        savch(cinput());
  905+}
  906+
899907 static int
 900908 addmac(struct symtab *sp)
 901909 {
     
 !
906914         for (i = 1; i < norepptr; i++)
 907915                 if (norep[i] == sp)
 908916                         return i;
<>909 -        if ((c = norepptr) == RECMAX)
  917+        if (norepptr >= RECMAX)
910918                 error("too many macros");
<> 919+        /* check norepptr */
  920+        if ((norepptr & 255) == 0)
  921+                norepptr++;
  922+        if (((norepptr >> 8) & 255) == 0)
  923+                norepptr += 256;
  924+        c = norepptr;
911925         norep[norepptr++] = sp;
 912926         return c;
 913927 }
     
 !
933947         if (bidx == RECMAX)
 934948                 error("too deep macro recursion");
 935949         n = cinput();
<> 950+        n = MKB(n, cinput());
936951         for (i = 0; i < bidx; i++)
 937952                 if (bptr[i] == n)
 938953                         return n; /* already blocked */
     
 !
10261041         IMP("IB");
 10271042         while ((c = sloscan()) != WARN) {
 10281043                 if (c == EBLOCK) {
<>1029 -                        savch(EBLOCK), savch(cinput());
  1044+                        sss();
10301045                         continue;
 10311046                 }
 10321047                 if (c == IDENT) {
<>1033 -                        savch(EBLOCK), savch(bnr);
  1048+                        savch(EBLOCK), savch(bnr & 255), savch(bnr >> 8);
10341049                         for (i = 0; i < bidx; i++)
<>1035 -                                savch(EBLOCK), savch(bptr[i]);
  1050+                                savch(EBLOCK), savch(bptr[i] & 255),
  1051+                                    savch(bptr[i] >> 8);
10361052                 }
 10371053                 savstr((const usch *)yytext);
 10381054                 if (c == '\n')
     
 !
10551071         IMP("DELWARN");
 10561072         while ((c = sloscan()) != WARN) {
 10571073                 if (c == EBLOCK) {
<>1058 -                        savch(EBLOCK), savch(cinput());
  1074+                        sss();
10591075                 } else
 10601076                         savstr(yytext);
 10611077         }
     
 !
11081124                                 /* Remove embedded directives */
 11091125                                 for (cbp = (usch *)yytext; *cbp; cbp++) {
 11101126                                         if (*cbp == EBLOCK)
<>1111 -                                                cbp++;
  1127+                                                cbp+=2;
11121128                                         else if (*cbp != CONC)
 11131129                                                 savch(*cbp);
 11141130                                 }
     
 !
13291345                                 putch(cinput());
 13301346                 for (;;) {
 13311347                         while (c == EBLOCK) {
<>1332 -                                savch(c);
 1333 -                                savch(cinput());
  1348+                                sss();
13341349                                 c = sloscan();
 13351350                         }
 13361351                         if (c == WARN) {
     
 !
13561371                                 error("eof in macro");
 13571372                 }
 13581373                 while (args[i] < stringbuf &&
<>1359 -                    iswsnl(stringbuf[-1]) && stringbuf[-2] != EBLOCK)
  1374+                    iswsnl(stringbuf[-1]) && stringbuf[-3] != EBLOCK)
13601375                         stringbuf--;
 13611376                 savch('\0');
 13621377                 if (dflag) {
     
 !
13821397                                 plev++;
 13831398                         if (c == ')')
 13841399                                 plev--;
<>1385 -                        savstr((usch *)yytext);
  1400+                        if (c == EBLOCK) {
  1401+                                sss();
  1402+                        } else
  1403+                                savstr((usch *)yytext);
13861404                         while ((c = sloscan()) == '\n') {
 13871405                                 cinput();
 13881406                                 savch(' ');
     
 !
15591577                                 /* yep, are concatenating; forget blocks */
 15601578                                 do {
 15611579                                         (void)cinput();
<> 1580+                                        (void)cinput();
15621581                                 } while ((c = sloscan()) == EBLOCK);
 15631582                                 bidx = 0;
 15641583                                 goto sav;
     
 !
15781597                                 /* must restore blocks */
 15791598                                 stringbuf = och;
 15801599                                 for (i = 0; i < bidx; i++)
<>1581 -                                        savch(EBLOCK), savch(bptr[i]);
  1600+                                        savch(EBLOCK), savch(bptr[i] & 255),
  1601+                                            savch(bptr[i] >> 8);
15821602                                 savstr(yytext);
 15831603                         }
 15841604                         bidx = 0;
     
 !
16261646                 case WARN: printf("<ARG(%d)>", *--s); break;
 16271647                 case CONC: printf("<CONC>"); break;
 16281648                 case SNUFF: printf("<SNUFF>"); break;
<>1629 -                case EBLOCK: printf("<E(%d)>",*--s); break;
  1649+                case EBLOCK: printf("<E(%d)>",s[-1] + s[-2] * 256); s-=2; break;
16301650                 default: printf("%c", *s); break;
 16311651                 }
 16321652                 s--;
     
 !
16411661                 case WARN: printf("<WARN>"); break;
 16421662                 case CONC: printf("<CONC>"); break;
 16431663                 case SNUFF: printf("<SNUFF>"); break;
<>1644 -                case EBLOCK: printf("<E(%d)>",*++s); break;
  1664+                case EBLOCK: printf("<E(%d)>",s[1] + s[2] * 256); s+=2; break;
16451665                 case '\n': printf("<NL>"); break;
 16461666                 default: printf("%c", *s); break;
 16471667                 }
     
 !
16761696                 printf("'\n");
 16771697         }
 16781698 #endif
<>1679 -        while (*d)
  1699+        while (*d) {
  1700+                if (*d == EBLOCK)
  1701+                        d += 2;
16801702                 d++;
<> 1703+        }
<_16811704         while (d > c) {
 16821705                 cunput(*--d);
 16831706         }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-28 11:05 +0200