aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-01-10 14:43:29 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-01-10 14:43:29 +0000
commitf09b22e60074349d4a8e0cbdb35cac2a13c35b18 (patch)
treeecf88eeb82979229bd20df31902e8db3f95785ed /tools
parent03c7b7093eb4dfc63fe3afa5784bccea39c4af50 (diff)
Revert 35447 and 35364: remove comments and strings in one regex (so it doesn't get confused by things like /* inside a string). And don't remove comments+strings before checking the hf's.
svn path=/trunk/; revision=35453
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index b8c21b58cd..e4a3f6b50f 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1076,10 +1076,7 @@ my $SingleQuotedStr = qr{ (?: \' (?: \\. | [^\'\\])* [']) }x;
# 4. Wireshark is strictly a C program so don't take out C++ style comments
# since they shouldn't be there anyway...
# Also: capturing the comment isn't necessary.
-#my $commentAndStringRegex = qr{ (?: $DoubleQuotedStr | $SingleQuotedStr | $CComment) }x;
-
-# 4. But we need to take out the comments separately from the strings
-my $StringRegex = qr{ (?: $DoubleQuotedStr | $SingleQuotedStr ) }x;
+my $commentAndStringRegex = qr{ (?: $DoubleQuotedStr | $SingleQuotedStr | $CComment) }x;
#### Regex for use when searching for value-string definitions
my $StaticRegex = qr/ static \s+ /xs;
@@ -1171,16 +1168,13 @@ while ($_ = $ARGV[0])
print STDERR "Warning: ".$filename." does not have an SVN Id tag.\n";
}
- # Remove all the C-comments
- $fileContents =~ s {$CComment} []xog;
-
# optionally check the hf entries
if ($check_hf) {
$errorCount += check_hf_entries(\$fileContents, $filename)
}
- # Remove all the strings
- $fileContents =~ s {$StringRegex} []xog;
+ # Remove all the C-comments and strings
+ $fileContents =~ s {$commentAndStringRegex} []xog;
if ($fileContents =~ m{ // }xo)
{