Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.26
 
1.27
 
MAIN:ragge:20050514080349
 
cpp.c
_>161161 main(int argc, char **argv)
 162162 {
 163163         struct incs *w, *w2;
<>164 -#ifndef NEWBUF
 165 -        struct symtab *nl, *thisnl;
 166 -        register int c, gotspc, ch;
 167 -        usch *osp, *ss2;
 168 -#else
169164         struct symtab *nl;
 170165         register int ch;
 171166         usch *osp;
<>172 -#endif
173167 
 174168         while ((ch = getopt(argc, argv, "CD:I:S:U:td")) != -1)
 175169                 switch (ch) {
     
 !
231225         argv += optind;
 232226 
 233227         exfail = 0;
<>234 -#ifndef NEWBUF
 235 -        if (argc) {
 236 -                if (freopen(argv[0], "r", stdin) == NULL) {
 237 -                        fprintf(stderr, "Can't open %s", argv[0]);
 238 -                        exit(8);
 239 -                }
 240 -        }
241228 
<>242 -        if (pushfile(argc ? argv[0] : "<stdin>"))
 243 -                error("cannot open %s", argv[0]);
 244 -
 245 -        if (argc == 2) {
 246 -                if ((obuf = fopen(argv[1], "w")) == 0) {
 247 -                        fprintf(stderr, "Can't creat %s\n", argv[1]);
 248 -                        exit(8);
 249 -                }
 250 -        } else
 251 -                obuf = stdout;
 252 -
 253 -        prtline();
 254 -#endif
 255 -
256229         filloc = lookup("__FILE__", ENTER);
 257230         linloc = lookup("__LINE__", ENTER);
 258231         filloc->value = linloc->value = ""; /* Just something */
     
 !
279252                 nl->value = stringbuf-1;
 280253         }
 281254 
<>282 -#ifdef NEWBUF
283255         if (argc == 2) {
 284256                 if ((obuf = fopen(argv[1], "w")) == 0) {
 285257                         fprintf(stderr, "Can't creat %s\n", argv[1]);
     
 !
302274         usch *osp, *ss2;
 303275         int c, gotspc;
 304276 
<>305 -#endif
 306 -
307277         thisnl = NULL;
 308278         while ((c = yylex()) != 0) {
 309279                 switch (c) {
 310280                 case CONTROL:
<> 281+                        slow = 1;
311282                         control();
<> 283+                        slow = 0;
312284                         break;
 313285 
 314286                 case IDENT:
     
 !
318290 if(dflag)printf("IDENT0: %s\n", yystr);
 319291                         nl = lookup(yystr, FIND);
 320292 if(dflag)printf("IDENT: %s\n", yystr);
<> 293+                        slow = 1;
321294                         if (nl == 0 || thisnl == 0)
 322295                                 goto found;
 323296                         if (thisnl == nl) {
     
 !
354327                                 thisnl = nl;
 355328                         }
 356329                         stringbuf = osp; /* clean up heap */
<> 330+                        slow = 0;
357331                         break;
 358332 
 359333                 case EXPAND:
 360334 if(dflag)printf("EXPAND!\n");
 361335                         thisnl = NULL;
 362336                         break;
 363337 
<> 338+                case CHARCON:
  339+                case STRING:
364340                 case NL:
<>365 -                        if (flslvl == 0) {
 366 -                                if (curline() == 1)
 367 -                                        prtline();
 368 -                                else
 369 -                                        putc('\n', obuf);
 370 -                        }
  341+                        error("bad dir %d", c);
371342                         break;
 372343 
<>373 -                case CHARCON:
374344                 case NUMBER:
 375345                 case FPOINT:
<>376 -                case STRING:
377346                 case WSPACE:
<>378 -                default:
379347                         if (flslvl == 0)
 380348                                 fputs(yystr, obuf);
 381349                         break;
<> 350+
  351+                default:
  352+                        if (flslvl == 0) {
  353+                                if (c < 256)
  354+                                        putch(c);
  355+                                else
  356+                                        error("bad dir2 %d", c);
  357+                        }
  358+                        break;
382359                 }
 383360         }
<>384 -#ifndef NEWBUF
 385 -        fclose(obuf);
 386 -        if (trulvl || flslvl)
 387 -                error("unterminated conditional");
 388 -#endif
389361 }
 390362 
 391363 /*
     
 !
631603         return;
 632604 
 633605 bad:    error("bad include");
<>634 -#ifdef NEWBUF
635606         stringbuf = osp;
 636607 ret:    prtline();
<>637 -#else
 638 -ret:    prtline();
 639 -        stringbuf = osp;
 640 -#endif
641608 }
 642609 
 643610 void
     
 !
11001067                         if (c == ')')
 11011068                                 plev--;
 11021069                         savstr(yystr);
<>1103 -                        c = yylex();
  1070+                        while ((c = yylex()) == NL)
  1071+                                c = yylex(), savch('\n');
11041072                 }
 11051073                 while (args[i] < stringbuf &&
 11061074                     (stringbuf[-1] == ' ' || stringbuf[-1] == '\t'))
     
 !
12191187                 cunput(*--d);
 12201188         }
 12211189 }
<_ 1190+
  1191+void
  1192+putch(int ch)
  1193+{
  1194+        putc(ch, obuf);
  1195+}
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-11-01 06:34 +0100