Fix lint_off/lint_on pairs on same line as warning

This commit is contained in:
Wilson Snyder
2010-01-09 12:33:01 -05:00
parent 0d12fe43a0
commit c1fc629c54
6 changed files with 43 additions and 9 deletions
+3 -2
View File
@@ -122,11 +122,12 @@ void FileLine::warnLintOff(bool flag) {
}
FileLine* FileLine::copyOrSameFileLine() {
// When a fileline is "used" to produce a node, calls this function.
// Return this, or a copy of this
// There are often more than one token per line, thus we use the
// same pointer as long as we're on the same line.
// same pointer as long as we're on the same line, file & warn state.
static FileLine* lastNewp = NULL;
if (lastNewp && *lastNewp == *this) {
if (lastNewp && *lastNewp == *this) { // Compares lineno, filename, etc
return lastNewp;
}
FileLine* newp = new FileLine(this);