Skip to content

Commit

Permalink
Used warnings::unused to find unused vars.
Browse files Browse the repository at this point in the history
These are declarations that were missed by Perl::Critic.
  • Loading branch information
rjray committed Jan 22, 2011
1 parent e787398 commit 81e3fab
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
21 changes: 14 additions & 7 deletions lib/RPC/XML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,20 @@ sub time2iso8601
}
}
# You have to check ints first, because they match the
# next pattern too
# next pattern (for doubles) too
elsif (! $FORCE_STRING_ENCODING &&
/^[-+]?\d+$/ &&
$_ > $MIN_BIG_INT &&
$_ < $MAX_BIG_INT)
$_ >= $MIN_BIG_INT &&
$_ <= $MAX_BIG_INT)
{
$type = (abs($_) > $MAX_INT) ? 'RPC::XML::i8' : 'RPC::XML::int';
$type = $type->new($_);
if (($_ > $MAX_INT) || ($_ < $MIN_INT))
{
$type = RPC::XML::i8->new($_);
}
else
{
$type = RPC::XML::int->new($_);
}
}
# Pattern taken from perldata(1)
elsif (! $FORCE_STRING_ENCODING &&
Expand All @@ -265,7 +271,8 @@ sub time2iso8601
}
# The XMLRPC spec only allows for the incorrect iso8601 format
# without dashes, but dashes are part of the standard so we include
# them (DateTime->now->iso8601 includes them).
# them (DateTime->now->iso8601 includes them). Note that the actual
# RPC::XML::datetime_iso8601 class will strip them out if present.
elsif (m{
^ # start
\d{4} # 4 digit year
Expand Down Expand Up @@ -1169,7 +1176,7 @@ sub new
{
my ($class, @args) = @_;

my ($self, %args);
my %args;

$RPC::XML::ERROR = q{};
if (blessed $args[0] and $args[0]->isa('RPC::XML::struct'))
Expand Down
2 changes: 1 addition & 1 deletion lib/RPC/XML/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ sub simple_request
{
my ($self, @args) = @_;

my ($return, $value);
my $return;

$RPC::XML::ERROR = q{};

Expand Down
12 changes: 8 additions & 4 deletions lib/RPC/XML/Parser/XMLParser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ sub message_init
return $self;
}

# This is called when the parsing process is complete
# This is called when the parsing process is complete. There is a second arg,
# $self, that is passed but not used. So it isn't declared for now.
sub final
{
my ($robj, $self) = @_;
my ($robj) = @_;

# Look at the top-most marker, it'll need to be one of the end cases
my $marker = pop @{$robj->[M_STACK]};
Expand All @@ -224,10 +225,13 @@ sub final
return $retval;
}

# This gets called each time an opening tag is parsed
# This gets called each time an opening tag is parsed. In addition to the three
# args here, any attributes are passed in hash form as well. But the XML-RPC
# spec uses no attributes, so we aren't declaring them here as the list will
# (or should, at least) always be empty.
sub tag_start
{
my ($robj, $self, $elem, %attr) = @_;
my ($robj, $self, $elem) = @_;

$robj->[M_CDATA] = [];
return if ($elem eq 'data');
Expand Down
12 changes: 6 additions & 6 deletions lib/RPC/XML/ParserFactory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ for (keys %AVAILABLE)
# Description: Method called when this module is use'd
#
# Arguments: NAME IN/OUT TYPE DESCRIPTION
# $class in scalar Class name
# $class in scalar Class name (not used)
# @args in list Arguments to the import
#
# Globals: $PARSER_CLASS
Expand All @@ -74,14 +74,14 @@ for (keys %AVAILABLE)
###############################################################################
sub import
{
my ($class, @args) = @_;
my (undef, @args) = @_;

# As a special-case, this one parameter might be specified without the
# key, if it is the ONLY thing passed:
if (1 == @args)
{
@args = (class => @args);
}
if (1 == @args)
{
@args = (class => @args);
}

# For now, the only arguments are key/value pairs so it's safe to coerce
# this into a hash
Expand Down
4 changes: 2 additions & 2 deletions lib/RPC/XML/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ sub new ## no critic (ProhibitExcessComplexity)

my (
$self, $http, $resp, $host,
$port, $queue, $path, $URI,
$srv_name, $srv_version, $timeout
$port, $queue, $URI, $srv_version,
$srv_name
);

$class = ref($class) || $class;
Expand Down

0 comments on commit 81e3fab

Please sign in to comment.