No need to return $i from warnings::__chk, as the value is not used.
authorNicholas Clark <nick@ccl4.org>
Sun, 20 Jun 2010 13:40:33 +0000 (14:40 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 23 Jun 2010 07:44:42 +0000 (08:44 +0100)
$i holds the depth of the caller frame from which the warnings bitmask is read.
The value has not been used by any caller of __chk() since c3186b657097c822.

lib/warnings.pm
warnings.pl

index ef91ff6..837718c 100644 (file)
@@ -453,7 +453,7 @@ sub __chk
 
     # Defaulting this to 0 reduces complexity in code paths below.
     my $callers_bitmask = (caller($i))[9] || 0 ;
-    return ($callers_bitmask, $offset, $i) ;
+    return ($callers_bitmask, $offset) ;
 }
 
 sub _error_loc {
@@ -466,7 +466,7 @@ sub enabled
     Croaker("Usage: warnings::enabled([category])")
        unless @_ == 1 || @_ == 0 ;
 
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return vec($callers_bitmask, $offset, 1) ||
            vec($callers_bitmask, $Offsets{'all'}, 1) ;
@@ -477,7 +477,7 @@ sub fatal_enabled
     Croaker("Usage: warnings::fatal_enabled([category])")
   unless @_ == 1 || @_ == 0 ;
 
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return vec($callers_bitmask, $offset + 1, 1) ||
            vec($callers_bitmask, $Offsets{'all'} + 1, 1) ;
@@ -489,7 +489,7 @@ sub warn
        unless @_ == 2 || @_ == 1 ;
 
     my $message = pop ;
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
     require Carp;
     Carp::croak($message)
        if vec($callers_bitmask, $offset+1, 1) ||
@@ -503,7 +503,7 @@ sub warnif
        unless @_ == 2 || @_ == 1 ;
 
     my $message = pop ;
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return
         unless (vec($callers_bitmask, $offset, 1) ||
index 25dd302..4c2c3bb 100644 (file)
@@ -738,7 +738,7 @@ sub __chk
 
     # Defaulting this to 0 reduces complexity in code paths below.
     my $callers_bitmask = (caller($i))[9] || 0 ;
-    return ($callers_bitmask, $offset, $i) ;
+    return ($callers_bitmask, $offset) ;
 }
 
 sub _error_loc {
@@ -751,7 +751,7 @@ sub enabled
     Croaker("Usage: warnings::enabled([category])")
        unless @_ == 1 || @_ == 0 ;
 
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return vec($callers_bitmask, $offset, 1) ||
            vec($callers_bitmask, $Offsets{'all'}, 1) ;
@@ -762,7 +762,7 @@ sub fatal_enabled
     Croaker("Usage: warnings::fatal_enabled([category])")
   unless @_ == 1 || @_ == 0 ;
 
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return vec($callers_bitmask, $offset + 1, 1) ||
            vec($callers_bitmask, $Offsets{'all'} + 1, 1) ;
@@ -774,7 +774,7 @@ sub warn
        unless @_ == 2 || @_ == 1 ;
 
     my $message = pop ;
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
     require Carp;
     Carp::croak($message)
        if vec($callers_bitmask, $offset+1, 1) ||
@@ -788,7 +788,7 @@ sub warnif
        unless @_ == 2 || @_ == 1 ;
 
     my $message = pop ;
-    my ($callers_bitmask, $offset, $i) = __chk(@_) ;
+    my ($callers_bitmask, $offset) = __chk(@_) ;
 
     return
         unless (vec($callers_bitmask, $offset, 1) ||