Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison output.c @ 78:4cc1c575951f
No need to warn about nested comments twice.
author | David A. Holland |
---|---|
date | Mon, 10 Jun 2013 20:17:23 -0400 |
parents | 337110e7240a |
children | 27c9aafcaca1 |
comparison
equal
deleted
inserted
replaced
77:123168887da8 | 78:4cc1c575951f |
---|---|
97 static | 97 static |
98 void | 98 void |
99 filter_output(const struct place *p, const char *buf, size_t len) | 99 filter_output(const struct place *p, const char *buf, size_t len) |
100 { | 100 { |
101 size_t pos, start; | 101 size_t pos, start; |
102 struct place p2; | |
103 | 102 |
104 start = 0; | 103 start = 0; |
105 for (pos = 0; pos < len - 1; pos++) { | 104 for (pos = 0; pos < len - 1; pos++) { |
106 if (buf[pos] == '/' && buf[pos+1] == '*') { | 105 if (buf[pos] == '/' && buf[pos+1] == '*') { |
107 if (incomment && warns.nestcomment) { | 106 if (!incomment) { |
108 p2 = *p; | |
109 p2.column += pos; | |
110 complain(p, "Warning: %c%c within comment", | |
111 '/', '*'); | |
112 if (mode.werror) { | |
113 complain_failed(); | |
114 } | |
115 } else if (!incomment) { | |
116 if (pos > start) { | 107 if (pos > start) { |
117 dowrite(buf + start, pos - start); | 108 dowrite(buf + start, pos - start); |
118 } | 109 } |
119 start = pos; | 110 start = pos; |
120 pos += 2; | 111 pos += 2; |