From 57e2e0c10d34c0e4ec52c26b3503362d03eb3700 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 14 May 2018 00:02:31 -0700 Subject: 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 --- tools/checkAPIs.pl | 11 +++-------- 1 file 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) -- cgit v1.2.3