Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.25
 
1.26
 
MAIN:ragge:20050511193259
 
cpp.c
_>161161 main(int argc, char **argv)
 162162 {
 163163         struct incs *w, *w2;
<> 164+#ifndef NEWBUF
164165         struct symtab *nl, *thisnl;
 165166         register int c, gotspc, ch;
 166167         usch *osp, *ss2;
<> 168+#else
  169+        struct symtab *nl;
  170+        register int ch;
  171+        usch *osp;
  172+#endif
167173 
 168174         while ((ch = getopt(argc, argv, "CD:I:S:U:td")) != -1)
 169175                 switch (ch) {
     
 !
225231         argv += optind;
 226232 
 227233         exfail = 0;
<> 234+#ifndef NEWBUF
228235         if (argc) {
<>229 -/* XXX - fix this for NEWBUF */
230236                 if (freopen(argv[0], "r", stdin) == NULL) {
 231237                         fprintf(stderr, "Can't open %s", argv[0]);
 232238                         exit(8);
     
 !
245251                 obuf = stdout;
 246252 
 247253         prtline();
<> 254+#endif
248255 
 249256         filloc = lookup("__FILE__", ENTER);
 250257         linloc = lookup("__LINE__", ENTER);
     
 !
272279                 nl->value = stringbuf-1;
 273280         }
 274281 
<> 282+#ifdef NEWBUF
  283+        if (argc == 2) {
  284+                if ((obuf = fopen(argv[1], "w")) == 0) {
  285+                        fprintf(stderr, "Can't creat %s\n", argv[1]);
  286+                        exit(8);
  287+                }
  288+        } else
  289+                obuf = stdout;
  290+
  291+        if (pushfile(argc ? argv[0] : NULL))
  292+                error("cannot open %s", argv[0]);
  293+
  294+        fclose(obuf);
  295+        return exfail;
  296+}
  297+
  298+void
  299+mainscan()
  300+{
  301+        struct symtab *nl, *thisnl;
  302+        usch *osp, *ss2;
  303+        int c, gotspc;
  304+
  305+#endif
  306+
275307         thisnl = NULL;
 276308         while ((c = yylex()) != 0) {
 277309                 switch (c) {
     
 !
314346 found:                  if (nl == 0 || subst(yystr, nl, NULL) == 0) {
 315347                                 fputs(yystr, obuf);
 316348                         } else if (osp != stringbuf) {
<>317 -if(dflag)printf("IDENT1: unput\n");
  349+if(dflag)printf("IDENT1: unput osp %p stringbuf %p\n", osp, stringbuf);
318350                                 ss2 = stringbuf;
 319351                                 cunput(EXPAND);
 320352                                 while (ss2 > osp)
     
 !
330362                         break;
 331363 
 332364                 case NL:
<>333 -                        if (flslvl == 0)
 334 -                                putc('\n', obuf);
  365+                        if (flslvl == 0) {
  366+                                if (curline() == 1)
  367+                                        prtline();
  368+                                else
  369+                                        putc('\n', obuf);
  370+                        }
335371                         break;
 336372 
 337373                 case CHARCON:
     
 !
345381                         break;
 346382                 }
 347383         }
<> 384+#ifndef NEWBUF
348385         fclose(obuf);
 349386         if (trulvl || flslvl)
 350387                 error("unterminated conditional");
<>351 -        return exfail;
  388+#endif
352389 }
 353390 
 354391 /*
     
 !
594631         return;
 595632 
 596633 bad:    error("bad include");
<> 634+#ifdef NEWBUF
  635+        stringbuf = osp;
597636 ret:    prtline();
<> 637+#else
  638+ret:    prtline();
598639         stringbuf = osp;
<> 640+#endif
<_599641 }
 600642 
 601643 void
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-21 22:09 +0200