[CI] Fix warnings in warning filter script

This commit is contained in:
Mat Sutcliffe
2021-10-13 21:15:23 +01:00
parent 29f1b9e85d
commit 32d9a9d22c

View File

@@ -39,16 +39,16 @@ print "::set-output name=warnings::$bool\n";
sub extractWarning sub extractWarning
{ {
my $line = shift; my $text = shift;
my %result = extractGccWarning($line); my %result = extractGccWarning($text);
return %result if %result; return %result if %result;
return extractMsvcWarning($line); return extractMsvcWarning($text);
} }
sub extractGccWarning sub extractGccWarning
{ {
my $line = shift; my $text = shift;
$line =~ m(^\s*(?<loc>.*?): warning: (?<msg>.*)$) or return (); $text =~ m(^\s*(?<loc>.*?): warning: (?<msg>.*)$) or return ();
my ($loc, $msg) = @+{ qw(loc msg) }; my ($loc, $msg) = @+{ qw(loc msg) };
$loc =~ m(^(?<file>.*?):(?<loc>[0-9:]+)$) or return (file => $loc, msg => $msg); $loc =~ m(^(?<file>.*?):(?<loc>[0-9:]+)$) or return (file => $loc, msg => $msg);
my ($file, $line) = ($+{file}, split ':', $+{loc}); my ($file, $line) = ($+{file}, split ':', $+{loc});
@@ -57,8 +57,8 @@ sub extractGccWarning
sub extractMsvcWarning sub extractMsvcWarning
{ {
my $line = shift; my $text = shift;
$line =~ m(^\s*(?<loc>.*?): warning (?<msg>[A-Z]+[0-9]+: .*)$) or return (); $text =~ m(^\s*(?<loc>.*?): warning (?<msg>[A-Z]+[0-9]+: .*)$) or return ();
my ($loc, $msg) = @+{ qw(loc msg) }; my ($loc, $msg) = @+{ qw(loc msg) };
$loc =~ m(^(?<file>.*)\((?<loc>[0-9,]+)\)$) or return (file => $loc, msg => $msg); $loc =~ m(^(?<file>.*)\((?<loc>[0-9,]+)\)$) or return (file => $loc, msg => $msg);
my ($file, $line) = ($+{file}, split ',', $+{loc}); my ($file, $line) = ($+{file}, split ',', $+{loc});