X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=warnings.pl;h=df766fea3df58c1e9af37bc99391faac1ab154d3;hb=0a76ff6528f0ab52947d4f1b9664310ce137b9a0;hp=61779528ec43db96370954941c62cf3a84e010da;hpb=8becbb3b066adee4495175867634bdba48ae2c5d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/warnings.pl b/warnings.pl index 6177952..df766fe 100644 --- a/warnings.pl +++ b/warnings.pl @@ -414,7 +414,7 @@ while () { #$list{'all'} = [ $offset .. 8 * ($warn_size/2) - 1 ] ; $last_ver = 0; -print PM "our %Offsets : unique = (\n" ; +print PM "our %Offsets = (\n" ; foreach my $k (sort { $a <=> $b } keys %ValueToName) { my ($name, $version) = @{ $ValueToName{$k} }; $name = lc $name; @@ -430,7 +430,7 @@ foreach my $k (sort { $a <=> $b } keys %ValueToName) { print PM " );\n\n" ; -print PM "our %Bits : unique = (\n" ; +print PM "our %Bits = (\n" ; foreach $k (sort keys %list) { my $v = $list{$k} ; @@ -444,7 +444,7 @@ foreach $k (sort keys %list) { print PM " );\n\n" ; -print PM "our %DeadBits : unique = (\n" ; +print PM "our %DeadBits = (\n" ; foreach $k (sort keys %list) { my $v = $list{$k} ; @@ -747,17 +747,18 @@ sub __chk $i -= 2 ; } else { - for ($i = 2 ; $pkg = (caller($i))[0] ; ++ $i) { - last if $pkg ne $this_pkg ; - } - $i = 2 - if !$pkg || $pkg eq $this_pkg ; + $i = _error_loc(); # see where Carp will allocate the error } my $callers_bitmask = (caller($i))[9] ; return ($callers_bitmask, $offset, $i) ; } +sub _error_loc { + require Carp::Heavy; + goto &Carp::short_error_loc; # don't introduce another stack frame +} + sub enabled { Croaker("Usage: warnings::enabled([category])")