Skip to content

Commit bbb9904

Browse files
committed
ParseXS: refactor: reindent block
3 commits ago I added a new scope. This commit re-indents that new block. Whitespace-only (apart from deleting a stray empty comment line too).
1 parent ffc833c commit bbb9904

File tree

1 file changed

+53
-54
lines changed

1 file changed

+53
-54
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 53 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,68 +1201,67 @@ EOF
12011201

12021202
{
12031203
my $retval = $self->{xsub_sig}{names}{RETVAL};
1204-
#
1205-
# A CODE section using RETVAL must also have an OUTPUT entry
1206-
if ( $self->{xsub_seen_RETVAL_in_CODE}
1207-
and not ($retval && $retval->{in_output})
1208-
and $self->{xsub_return_type} ne 'void')
1209-
{
1210-
$self->Warn("Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section.");
1211-
}
12121204

1213-
# Process any OUT vars: i.e. vars that are declared OUT in
1214-
# the XSUB's signature rather than in an OUTPUT section.
1215-
1216-
for my $param (
1217-
grep {
1218-
defined $_->{in_out}
1219-
&& $_->{in_out} =~ /OUT$/
1220-
&& !$_->{in_output}
1221-
}
1222-
@{ $self->{xsub_sig}{params}})
1223-
{
1224-
$self->generate_output($param);
1225-
}
1205+
# A CODE section using RETVAL must also have an OUTPUT entry
1206+
if ( $self->{xsub_seen_RETVAL_in_CODE}
1207+
and not ($retval && $retval->{in_output})
1208+
and $self->{xsub_return_type} ne 'void')
1209+
{
1210+
$self->Warn("Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section.");
1211+
}
12261212

1227-
# If there are any OUTLIST vars to be pushed, first extend the
1228-
# stack, to fit all OUTLIST vars + RETVAL
1229-
my $outlist_count = grep { defined $_->{in_out}
1230-
&& $_->{in_out} =~ /OUTLIST$/
1231-
}
1232-
@{$self->{xsub_sig}{params}};
1233-
if ($outlist_count) {
1234-
my $ext = $outlist_count;
1235-
++$ext if ($retval && $retval->{in_output}) || $implicit_OUTPUT_RETVAL;
1236-
print "\tXSprePUSH;";
1237-
print "\tEXTEND(SP,$ext);\n";
1238-
}
1213+
# Process any OUT vars: i.e. vars that are declared OUT in
1214+
# the XSUB's signature rather than in an OUTPUT section.
12391215

1240-
# ----------------------------------------------------------------
1241-
# All OUTPUT done; now handle an implicit or deferred RETVAL.
1242-
# OUTPUT_handler() will have skipped any RETVAL line.
1243-
# Also, $implicit_OUTPUT_RETVAL indicates that an implicit RETVAL
1244-
# should be generated, due to a non-void CODE-less XSUB.
1245-
# ----------------------------------------------------------------
1216+
for my $param (
1217+
grep {
1218+
defined $_->{in_out}
1219+
&& $_->{in_out} =~ /OUT$/
1220+
&& !$_->{in_output}
1221+
}
1222+
@{ $self->{xsub_sig}{params}})
1223+
{
1224+
$self->generate_output($param);
1225+
}
12461226

1247-
if (($retval && $retval->{in_output}) || $implicit_OUTPUT_RETVAL) {
1248-
# emit a deferred RETVAL from OUTPUT or implicit RETVAL
1249-
$self->generate_output($retval);
1227+
# If there are any OUTLIST vars to be pushed, first extend the
1228+
# stack, to fit all OUTLIST vars + RETVAL
1229+
my $outlist_count = grep { defined $_->{in_out}
1230+
&& $_->{in_out} =~ /OUTLIST$/
1231+
}
1232+
@{$self->{xsub_sig}{params}};
1233+
if ($outlist_count) {
1234+
my $ext = $outlist_count;
1235+
++$ext if ($retval && $retval->{in_output}) || $implicit_OUTPUT_RETVAL;
1236+
print "\tXSprePUSH;";
1237+
print "\tEXTEND(SP,$ext);\n";
12501238
}
12511239

1252-
$XSRETURN_count = 1 if $self->{xsub_return_type} ne "void"
1253-
&& !$self->{xsub_seen_NO_OUTPUT};
1254-
my $num = $XSRETURN_count;
1255-
$XSRETURN_count += $outlist_count;
1240+
# ----------------------------------------------------------------
1241+
# All OUTPUT done; now handle an implicit or deferred RETVAL.
1242+
# OUTPUT_handler() will have skipped any RETVAL line.
1243+
# Also, $implicit_OUTPUT_RETVAL indicates that an implicit RETVAL
1244+
# should be generated, due to a non-void CODE-less XSUB.
1245+
# ----------------------------------------------------------------
12561246

1257-
# Now that RETVAL is on the stack, also push any OUTLIST vars too
1258-
for my $param (grep { defined $_->{in_out}
1259-
&& $_->{in_out} =~ /OUTLIST$/
1260-
}
1261-
@{$self->{xsub_sig}{params}}
1262-
) {
1263-
$self->generate_output($param, $num++);
1264-
}
1247+
if (($retval && $retval->{in_output}) || $implicit_OUTPUT_RETVAL) {
1248+
# emit a deferred RETVAL from OUTPUT or implicit RETVAL
1249+
$self->generate_output($retval);
1250+
}
1251+
1252+
$XSRETURN_count = 1 if $self->{xsub_return_type} ne "void"
1253+
&& !$self->{xsub_seen_NO_OUTPUT};
1254+
my $num = $XSRETURN_count;
1255+
$XSRETURN_count += $outlist_count;
12651256

1257+
# Now that RETVAL is on the stack, also push any OUTLIST vars too
1258+
for my $param (grep { defined $_->{in_out}
1259+
&& $_->{in_out} =~ /OUTLIST$/
1260+
}
1261+
@{$self->{xsub_sig}{params}}
1262+
) {
1263+
$self->generate_output($param, $num++);
1264+
}
12661265
}
12671266

12681267

0 commit comments

Comments
 (0)