Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.44
 
1.45
 
MAIN:ragge:20110129134848
 
token.c
_>136136         *ifiles->curptr = (usch)c;
 137137 }
 138138 
<> 139+static int
  140+eatcmnt(void)
  141+{
  142+        int ch;
  143+
  144+        if (Cflag) { PUTCH('/'); PUTCH('*'); }
  145+        for (;;) {
  146+                ch = inch();
  147+                if (ch == '\n') {
  148+                        ifiles->lineno++;
  149+                        PUTCH('\n');
  150+                }
  151+                if (ch == -1)
  152+                        return -1;
  153+                if (ch == '*') {
  154+                        ch = inch();
  155+                        if (ch == '/') {
  156+                                if (Cflag) {
  157+                                        PUTCH('*');
  158+                                        PUTCH('/');
  159+                                } else
  160+                                        PUTCH(' ');
  161+                                break;
  162+                        }
  163+                        unch(ch);
  164+                        ch = '*';
  165+                }
  166+                if (Cflag) PUTCH(ch);
  167+        }
  168+        return 0;
  169+}
  170+
139171 /*
 140172  * Scan quickly the input file searching for:
 141173  *      - '#' directives
     
 !
172204 
 173205                 case '/': /* Comments */
 174206                         if ((ch = inch()) == '/') {
<>175 -                                if (Cflag) { PUTCH(ch); } else { PUTCH(' '); }
  207+cppcmt:                         if (Cflag) { PUTCH(ch); } else { PUTCH(' '); }
176208                                 do {
 177209                                         if (Cflag) PUTCH(ch);
 178210                                         ch = inch();
 179211                                 } while (ch != -1 && ch != '\n');
 180212                                 goto xloop;
 181213                         } else if (ch == '*') {
<>182 -                                if (Cflag) { PUTCH('/'); PUTCH('*'); }
 183 -                                for (;;) {
 184 -                                        ch = inch();
 185 -                                        if (ch == '\n') {
 186 -                                                ifiles->lineno++;
 187 -                                                PUTCH('\n');
 188 -                                        }
 189 -                                        if (ch == -1)
 190 -                                                return;
 191 -                                        if (ch == '*') {
 192 -                                                ch = inch();
 193 -                                                if (ch == '/') {
 194 -                                                        if (Cflag) {
 195 -                                                                PUTCH('*');
 196 -                                                                PUTCH('/');
 197 -                                                        } else
 198 -                                                                PUTCH(' ');
 199 -                                                        break;
 200 -                                                }
 201 -                                                unch(ch);
 202 -                                                ch = '*';
 203 -                                        }
 204 -                                        if (Cflag) PUTCH(ch);
 205 -                                }
  214+                                if (eatcmnt())
  215+                                        return;
206216                         } else {
 207217                                 PUTCH('/');
 208218                                 goto xloop;
     
 !
229239                         do {
 230240                                 PUTCH(ch);
 231241 run:                            ch = NXTCH();
<> 242+                                if (ch == '/') {
  243+                                        ch = NXTCH();
  244+                                        if (ch == '/')
  245+                                                goto cppcmt;
  246+                                        if (ch == '*') {
  247+                                                if (eatcmnt())
  248+                                                        return;
  249+                                                goto run;
  250+                                        }
  251+                                        unch(ch);
  252+                                        ch = '/';
  253+                                }
<_232254                         } while (ch == ' ' || ch == '\t');
 233255                         if (ch == '#') {
 234256                                 ppdir();
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-07-10 20:19 +0200