Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.91
 
1.92
 
MAIN:ragge:20080816152727
 
cpp.c
_>160160 #define SNUFF   3       /* ETX, not legal char */
 161161 #define NOEXP   4       /* EOT, not legal char */
 162162 #define EXPAND  5       /* ENQ, not legal char */
<> 163+#define PRAGS   6       /* start of converted pragma */
  164+#define PRAGE   14      /* end of converted pragma */
163165 
 164166 /* args for lookup() */
 165167 #define FIND    0
     
 !
173175 void flbuf(void);
 174176 void usage(void);
 175177 usch *xstrdup(char *str);
<> 178+usch *prtprag(usch *opb);
176179 
 177180 
 178181 int
     
 !
914917         usch *opb;
 915918         int t, plev;
 916919 
<>917 -        slow = 1;
 918 -        putstr((usch *)"\n#pragma ");
  920+        slow++;
919921         if ((t = yylex()) == WSPACE)
 920922                 t = yylex();
 921923         if (t != '(')
     
 !
941943         cunput('\n');
 942944         while (stringbuf > opb)
 943945                 cunput(*--stringbuf);
<> 946+        savch(PRAGS);
944947         while ((t = yylex()) != '\n') {
 945948                 if (t == WSPACE)
 946949                         continue;
 947950                 if (t != STRING)
 948951                         goto bad;
<>949 -                opb = (usch *)yytext;
 950 -                if (*opb++ == 'L')
 951 -                        opb++;
 952 -                while ((t = *opb++) != '\"') {
 953 -                        if (t == '\\' && (*opb == '\"' || *opb == '\\'))
 954 -                                t = *opb++;
 955 -                        putch(t);
 956 -                }
  952+                savstr((usch *)yytext);
957953         }
 958954 
<>959 -        putch('\n');
 960 -        prtline();
  955+        savch(PRAGE);
  956+        while (stringbuf > opb)
  957+                cunput(*--stringbuf);
  958+        slow--;
961959         return;
 962960 bad:    error("bad pragma operator");
 963961 }
     
 !
14611459 putstr(usch *s)
 14621460 {
 14631461         for (; *s; s++) {
<> 1462+                if (*s == PRAGS) {
  1463+                        s = prtprag(s);
  1464+                        continue;
  1465+                }
14641466                 outbuf[obufp++] = *s;
 14651467                 if (obufp == CPPBUF || (istty && *s == '\n'))
 14661468                         flbuf();
     
 !
16971699         strlcpy((char *)rv, str, len);
 16981700         return rv;
 16991701 }
<_ 1702+
  1703+usch *
  1704+prtprag(usch *s)
  1705+{
  1706+        int ch;
  1707+
  1708+        s++;
  1709+        putstr((usch *)"\n#pragma ");
  1710+        while (*s != PRAGE) {
  1711+                if (*s == 'L')
  1712+                        s++;
  1713+                if (*s == '\"') {
  1714+                        s++;
  1715+                        while ((ch = *s++) != '\"') {
  1716+                                if (ch == '\\' && (*s == '\"' || *s == '\\'))
  1717+                                        ch = *s++;
  1718+                                putch(ch);
  1719+                        }
  1720+                } else {
  1721+                        s++;
  1722+                        putch(*s);
  1723+                }
  1724+        }
  1725+        putstr((usch *)"\n");
  1726+        prtline();
  1727+        return ++s;
  1728+}
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-22 02:13 +0200