Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.93
 
1.94
 
MAIN:plunky:20121029174801
 
token.c
_>300300                                                 nnl++;
 301301                                                 goto nxt;
 302302                                         }
 303303                                         unch(ch);
 304304                                         ch = '\\';
 305305                                 }
<> 306+                                if (ch == -1)
  307+                                        return;
306308                                 if (spechr[ch] & C_EP) {
 307309                                         PUTCH(ch);
 308310                                         ch = NXTCH();
 309311                                         if (ch == '-' || ch == '+')
 310312                                                 continue;
<> 313+                                        if (ch == -1)
  314+                                                return;
311315                                 }
 312316                         } while ((spechr[ch] & C_ID) || (ch == '.'));
 313317                         goto xloop;
 314318 
 315319                 case '\'': /* character literal */
 316320 con:                    PUTCH(ch);
     
 !
348352                         ch = 'L';
 349353                         /* FALLTHROUGH */
 350354                 default:
 351355                         if ((spechr[ch] & C_ID) == 0)
 352356                                 error("fastscan");
 353357                         if (flslvl) {
<>354 -                                while (spechr[ch] & C_ID)
  358+                                while (ch != -1 && spechr[ch] & C_ID)
355359                                         ch = NXTCH();
 356360                                 goto xloop;
 357361                         }
 358362                         i = 0;
 359363                         do {
 360364                                 yytext[i++] = (usch)ch;
     
 !
402406         switch (ch) {
 403407         case -1:
 404408                 return 0;
 405409         case '\n':
 406410                 /* sloscan() never passes \n, that's up to fastscan() */
 407411                 unch(ch);
<>408 -                goto yyret;
  412+                yytext[yyp] = 0;
  413+                return ch;
409414 
 410415         case '\r': /* Ignore CR's */
 411416                 yyp = 0;
 412417                 break;
 413418 
 414419         case '0': case '1': case '2': case '3': case '4': case '5':
 415420         case '6': case '7': case '8': case '9':
 416421                 /* readin a "pp-number" */
 417422 ppnum:          for (;;) {
 418423                         ch = inch();
<> 424+                        if (ch == -1)
  425+                                break;
419426                         if (spechr[ch] & C_EP) {
 420427                                 yytext[yyp++] = (usch)ch;
 421428                                 ch = inch();
 422429                                 if (ch == '-' || ch == '+') {
 423430                                         yytext[yyp++] = (usch)ch;
 424431                                 } else
     
 !
440447 chlit:          
 441448                 for (;;) {
 442449                         if ((ch = inch()) == '\\') {
 443450                                 yytext[yyp++] = (usch)ch;
 444451                                 yytext[yyp++] = (usch)inch();
 445452                                 continue;
<>446 -                        } else if (ch == '\n') {
  453+                        } else if (ch == -1 || ch == '\n') {
447454                                 /* not a constant */
 448455                                 while (yyp > 1)
 449456                                         unch(yytext[--yyp]);
 450457                                 ch = '\'';
 451458                                 goto any;
 452459                         } else
     
 !
468475 
 469476         case '/':
 470477                 if ((ch = inch()) == '/') {
 471478                         do {
 472479                                 yytext[yyp++] = (usch)ch;
 473480                                 ch = inch();
<>474 -                        } while (ch && ch != '\n');
  481+                        } while (ch != -1 && ch != '\n');
475482                         yytext[yyp] = 0;
 476483                         unch(ch);
 477484                         goto zagain;
 478485                 } else if (ch == '*') {
 479486                         int c, wrn;
 480487                         extern int readmac;
     
 !
483490                                 unch(ch);
 484491                                 yytext[yyp] = 0;
 485492                                 return CMNT;
 486493                         }
 487494 
 488495                         wrn = 0;
<>489 -                more:   while ((c = inch()) && c != '*') {
  496+                more:   while ((c = inch()) != '*') {
  497+                                if (c == -1)
  498+                                        return 0;       
490499                                 if (c == '\n')
 491500                                         putch(c), ifiles->lineno++;
 492501                                 else if (c == EBLOCK) {
 493502                                         (void)inch();
 494503                                         (void)inch();
 495504                                 } else if (c == 1) /* WARN */
 496505                                         wrn = 1;
 497506                         }
<>498 -                        if (c == 0)
  507+                        if ((c = inch()) == -1)
499508                                 return 0;
<>500 -                        if ((c = inch()) && c != '/') {
  509+                        if (c != '/') {
501510                                 unch(c);
 502511                                 goto more;
 503512                         }
<>504 -                        if (c == 0)
 505 -                                return 0;
506513                         if (!tflag && !Cflag && !flslvl)
 507514                                 unch(' ');
 508515                         if (wrn)
 509516                                 unch(1);
 510517                         goto zagain;
 511518                 }
 512519                 unch(ch);
 513520                 ch = '/';
 514521                 goto any;
 515522 
 516523         case '.':
<>517 -                ch = inch();
  524+                if ((ch = inch()) == -1)
  525+                        return 0;
518526                 if (isdigit(ch)) {
 519527                         yytext[yyp++] = (usch)ch;
 520528                         goto ppnum;
 521529                 } else {
 522530                         unch(ch);
 523531                         ch = '.';
     
 !
530538         strng:
 531539                 for (;;) {
 532540                         if ((ch = inch()) == '\\') {
 533541                                 yytext[yyp++] = (usch)ch;
 534542                                 yytext[yyp++] = (usch)inch();
 535543                                 continue;
<> 544+                        } else if (ch == -1) {
  545+                                break;
536546                         } else
 537547                                 yytext[yyp++] = (usch)ch;
 538548                         if (ch == '\"')
 539549                                 break;
 540550                 }
 541551                 yytext[yyp] = 0;
     
 !
564574         case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
 565575         case 'Y': case 'Z':
 566576         case '_': /* {L}({L}|{D})* */
 567577 
 568578                 /* Special hacks */
 569579                 for (;;) { /* get chars */
<>570 -                        ch = inch();
  580+                        if ((ch = inch()) == -1)
  581+                                break;
571582                         if (isalpha(ch) || isdigit(ch) || ch == '_') {
 572583                                 yytext[yyp++] = (usch)ch;
 573584                         } else {
<>574 -                                if (ch != -1)
 575 -                                        unch(ch);
  585+                                unch(ch);
576586                                 break;
 577587                         }
 578588                 }
 579589                 yytext[yyp] = 0; /* need already string */
 580590                 /* end special hacks */
 581591 
     
 !
584594         any:
 585595                 yytext[yyp] = 0;
 586596                 return yytext[0];
 587597 
 588598         } /* endcase */
 589599         goto zagain;
<>590 -
 591 -yyret:
 592 -        yytext[yyp] = 0;
 593 -        return ch;
594600 }
 595601 
 596602 int
 597603 yylex(void)
 598604 {
 599605         static int ifdef, noex;
     
 !
973979 {
 974980         int t;
 975981 
 976982         while ((t = sloscan()) == WSPACE)
 977983                 ;
 978984         if (t != '\n') {
<>979 -                if (t && t != (usch)-1) {
  985+                if (t) {
980986                         if (ignore) {
 981987                                 warning("newline expected, got \"%s\"", yytext);
 982988                                 /* ignore rest of line */
 983989                                 while ((t = sloscan()) && t != '\n')
 984990                                         ;
 985991                         }
     
 !
10171023         chknl(1);
 10181024 }
 10191025 
 10201026 static void
 10211027 skpln(void)
 10221028 {
<> 1029+        int ch;
  1030+
10231031         /* just ignore the rest of the line */
<>1024 -        while (inch() != '\n')
 1025 -                ;
 1026 -        unch('\n');
  1032+        while ((ch = inch()) != -1) {
  1033+                if (ch == '\n') {
  1034+                        unch('\n');
  1035+                        break;
  1036+                }
  1037+        }
10271038         flslvl++;
 10281039 }
 10291040 
 10301041 static void
 10311042 ifdefstmt(void)         
 10321043 {
     
 !
11331144 static usch *
 11341145 savln(void)
 11351146 {
 11361147         int c;
 11371148         usch *cp = stringbuf;
 11381149 
<>1139 -        while ((c = inch()) != 0) {
  1150+        while ((c = inch()) != -1) {
<_11401151                 if (c == '\n') {
 11411152                         unch(c);
 11421153                         break;
 11431154                 }
 11441155                 savch(c);
 11451156         }
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-09-19 03:49 +0200