Skip to content

Commit

Permalink
ParseXS: rename $c to $outlist_count
Browse files Browse the repository at this point in the history
$c could be a count, but a count of what? clarify it.
  • Loading branch information
tonycoz committed Sep 13, 2021
1 parent 2adc92a commit f572f08
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -690,17 +690,17 @@ EOF
do_push => undef,
} ) for grep $self->{in_out}->{$_} =~ /OUT$/, sort keys %{ $self->{in_out} };

my $c = @{ $outlist_ref };
if ($c) {
my $ext = $c;
my $outlist_count = @{ $outlist_ref };
if ($outlist_count) {
my $ext = $outlist_count;
++$ext if $self->{gotRETVAL} || $wantRETVAL;
print "\tXSprePUSH;";
print "\tEXTEND(SP,$ext);\n";
}
# all OUTPUT done, so now push the return value on the stack
if ($self->{gotRETVAL} && $self->{RETVAL_code}) {
print "\t$self->{RETVAL_code}\n";
print "\t++SP;\n" if $c;
print "\t++SP;\n" if $outlist_count;
}
elsif ($self->{gotRETVAL} || $wantRETVAL) {
my $outputmap = $self->{typemap}->get_outputmap( ctype => $self->{ret_type} );
Expand All @@ -716,7 +716,7 @@ EOF
if (not $trgt->{with_size} and $trgt->{type} eq 'p') { # sv_setpv
# PUSHp corresponds to sv_setpvn. Treat sv_setpv directly
print "\tsv_setpv(TARG, $what);\n";
print "\tXSprePUSH;\n" unless $c;
print "\tXSprePUSH;\n" unless $outlist_count;
print "\tPUSHTARG;\n";
}
else {
Expand All @@ -726,7 +726,7 @@ EOF
qq("$tsize"),
{var => $var, type => $self->{ret_type}}
);
print "\tXSprePUSH;\n" unless $c;
print "\tXSprePUSH;\n" unless $outlist_count;
print "\tPUSH$trgt->{type}($what$tsize);\n";
}
}
Expand All @@ -739,13 +739,13 @@ EOF
do_setmagic => 0,
do_push => undef,
} );
print "\t++SP;\n" if $c;
print "\t++SP;\n" if $outlist_count;
}
}

$xsreturn = 1 if $self->{ret_type} ne "void";
my $num = $xsreturn;
$xsreturn += $c;
$xsreturn += $outlist_count;
$self->generate_output( {
type => $self->{var_types}->{$_},
num => $num++,
Expand Down

0 comments on commit f572f08

Please sign in to comment.