summaryrefslogtreecommitdiff
path: root/tools/checkAPIs.pl
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-09-10 01:53:23 +0000
committerBill Meier <wmeier@newsguy.com>2012-09-10 01:53:23 +0000
commit5e4bff84d36f55c3a7ce2d30a2f9d3f4e2f2d4b1 (patch)
tree085e5c28c3ef7fc49d3f08eb153c1810813fa496 /tools/checkAPIs.pl
parent659569581e71fe9270dfc5adb57cdbbf8d9e77d1 (diff)
downloadwireshark-5e4bff84d36f55c3a7ce2d30a2f9d3f4e2f2d4b1.tar.gz
Use non-capturing grouping when grouping just for alternatives;
Also: improve error message slightly in the case of a missing NULL termination. svn path=/trunk/; revision=44826
Diffstat (limited to 'tools/checkAPIs.pl')
-rwxr-xr-xtools/checkAPIs.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 452c8cadfa..be51831181 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1692,7 +1692,7 @@ my $commentAndStringRegex = qr{ (?: $DoubleQuotedStr | $SingleQuotedStr | $CComm
my $StaticRegex = qr/ static \s+ /xs;
my $ConstRegex = qr/ const \s+ /xs;
my $Static_andor_ConstRegex = qr/ (?: $StaticRegex $ConstRegex | $StaticRegex | $ConstRegex) /xs;
-my $ValueStringRegex = qr/ $Static_andor_ConstRegex (value|string|range)_string \ + [^;*]+ = [^;]+ [{] [^;]+ ; /xs;
+my $ValueStringRegex = qr/ $Static_andor_ConstRegex (?:value|string|range)_string \ + [^;*]+ = [^;]+ [{] [^;]+ ; /xs;
#
# MAIN
@@ -1822,7 +1822,7 @@ while ($_ = $ARGV[0])
# XXX_string array definition found; check if NULL terminated
my $vs = my $vsx = $1;
if ($debug_flag) {
- $vsx =~ / ( .+ (value|string|range)_string [^=]+ ) = /xo;
+ $vsx =~ / ( .+ (?:value|string|range)_string [^=]+ ) = /xo;
printf STDERR "==> %-35.35s: %s\n", $filename, $1;
printf STDERR "%s\n", $vs;
}
@@ -1831,12 +1831,12 @@ while ($_ = $ARGV[0])
# "Don't put a comma after the last tuple of an initializer of an array"
# However: since this usage is present in some number of cases, we'll allow for now
if ($vs !~ / , NULL [}] ,? [}] ; $/xo) {
- $vsx =~ /( (value|string|range)_string [^=]+ ) = /xo;
- printf STDERR "Error: %-35.35s: {0, NULL} is required as the last XXX_string array entry: %s\n", $filename, $1;
+ $vsx =~ /( (?:value|string|range)_string [^=]+ ) = /xo;
+ printf STDERR "Error: %-35.35s: {..., NULL} is required as the last XXX_string array entry: %s\n", $filename, $1;
$errorCount++;
}
- if ($vs !~ / (static)? const (value|string|range)_string /xo) {
- $vsx =~ /( (value|string|range)_string [^=]+ ) = /xo;
+ if ($vs !~ / (static)? const (?:value|string|range)_string /xo) {
+ $vsx =~ /( (?:value|string|range)_string [^=]+ ) = /xo;
printf STDERR "Error: %-35.35s: Missing 'const': %s\n", $filename, $1;
$errorCount++;
}