@@ -1201,68 +1201,67 @@ EOF
1201
1201
1202
1202
{
1203
1203
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
- }
1212
1204
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
+ }
1226
1212
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 " \t XSprePUSH;" ;
1237
- print " \t EXTEND(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.
1239
1215
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
+ }
1246
1226
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 " \t XSprePUSH;" ;
1237
+ print " \t EXTEND(SP,$ext );\n " ;
1250
1238
}
1251
1239
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
+ # ----------------------------------------------------------------
1256
1246
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 ;
1265
1256
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
+ }
1266
1265
}
1267
1266
1268
1267
0 commit comments