X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fwarnings.pm;h=656b7ac49175a64806ee720731c42553d4066281;hb=78e38bb6033b96ad3fdd5f4f7bd08f6fedae70cb;hp=edbe1a7c7487e8e6389ddd6fc7eaa7faa7688469;hpb=71a1411e8309f445a8e3afde57ce393886ff905f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/warnings.pm b/lib/warnings.pm index edbe1a7..656b7ac 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -133,7 +133,7 @@ See L and L. use Carp (); -our %Offsets : unique = ( +our %Offsets = ( # Warnings Categories added in Perl 5.008 @@ -190,7 +190,7 @@ our %Offsets : unique = ( 'assertions' => 94, ); -our %Bits : unique = ( +our %Bits = ( 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..47] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [29] 'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [47] @@ -241,7 +241,7 @@ our %Bits : unique = ( 'y2k' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [46] ); -our %DeadBits : unique = ( +our %DeadBits = ( 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..47] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [29] 'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [47] @@ -439,17 +439,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])")