aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-05-14 00:02:31 -0700
committerGuy Harris <guy@alum.mit.edu>2018-05-14 07:04:03 +0000
commit57e2e0c10d34c0e4ec52c26b3503362d03eb3700 (patch)
treea41a09cc1eb69d9c603cb934bc002a8b5533872d
parent5e5cc440a26c93c9edfcf596eddc0974702d6d2c (diff)
Update some comments.
(Wireshark hasn't been strictly a C program for a while, and we now allow C99-and-later comments in the C code.) Change-Id: Ic68e053eed7aae1971a800cf74135bc86d211e97 Reviewed-on: https://code.wireshark.org/review/27520 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rwxr-xr-xtools/checkAPIs.pl11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 51af5160de..60818a5fa9 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1002,10 +1002,10 @@ my $debug = 0;
# http://aspn.activestate.com/ASPN/Cookbook/Rx/Recipe/59811
# They are in the public domain.
-# 1. A complicated regex which matches C-style comments.
+# 1. A complicated regex which matches "classic C"-style comments.
my $CComment = qr{ / [*] [^*]* [*]+ (?: [^/*] [^*]* [*]+ )* / }x;
-# 1.a A regex that matches C++/C99-style comments.
+# 1.a A regex that matches C++/C99-and-later-style comments.
# XXX handle comments after a statement and not just at the beginning of a line.
my $CppComment = qr{ ^ \s* // (.*?) \n }xm;
@@ -1024,11 +1024,6 @@ my $SingleQuotedStr = qr{ (?: \' (?: \\. | [^\'\\])* [']) }x;
# of the comment in $1.
# my $commentAndStringRegex = qr{(?:$DoubleQuotedStr|$SingleQuotedStr)|($CComment)|($CppComment)};
-# 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;
-
#
# MAIN
#
@@ -1157,7 +1152,7 @@ while ($_ = pop @filelist)
$errorCount++;
}
- # Remove all the C-comments
+ # Remove all the C/C++ comments
$fileContents =~ s{ $CComment | $CppComment } []xog;
# optionally check the hf entries (including those under #if 0)