From: Nicholas Clark Date: Sun, 20 Jun 2010 13:40:33 +0000 (+0100) Subject: No need to return $i from warnings::__chk, as the value is not used. X-Git-Tag: accepted/trunk/20130322.191538~8726 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=980a43b097489a68f8b49125b2258eb2697e313e;p=platform%2Fupstream%2Fperl.git No need to return $i from warnings::__chk, as the value is not used. $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. --- diff --git a/lib/warnings.pm b/lib/warnings.pm index ef91ff6..837718c 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -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) || diff --git a/warnings.pl b/warnings.pl index 25dd302..4c2c3bb 100644 --- a/warnings.pl +++ b/warnings.pl @@ -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) ||