%argtype_seen, %in_out, %lengthof,
@line_no,
%XsubAliases, %XsubAliasValues, %Interfaces, @Attributes, %outargs,
- $gotRETVAL, $condnum, $cond,
+ $condnum, $cond,
$RETVAL_code, $func_args, @XSStack, $ALIAS,
);
our ($DoSetMagic, $newXS, $proto, $Module_cname, $XsubAliases, $Interfaces, $var_num, );
$self->{retvaldone} = 0;
$self->{deferred} = "";
%arg_list = ();
- $gotRETVAL = 0;
+ $self->{gotRETVAL} = 0;
INPUT_handler();
process_keyword("INPUT|PREINIT|INTERFACE_MACRO|C_ARGS|ALIAS|ATTRS|PROTOTYPE|SCOPE|OVERLOAD");
}
# do output variables
- $gotRETVAL = 0; # 1 if RETVAL seen in OUTPUT section;
+ $self->{gotRETVAL} = 0; # 1 if RETVAL seen in OUTPUT section;
undef $RETVAL_code ; # code to set RETVAL (from OUTPUT section);
# $wantRETVAL set if 'RETVAL =' autogenerated
($wantRETVAL, $self->{ret_type}) = (0, 'void') if $RETVAL_no_return;
} ) for grep $in_out{$_} =~ /OUT$/, keys %in_out;
# all OUTPUT done, so now push the return value on the stack
- if ($gotRETVAL && $RETVAL_code) {
+ if ($self->{gotRETVAL} && $RETVAL_code) {
print "\t$RETVAL_code\n";
}
- elsif ($gotRETVAL || $wantRETVAL) {
+ elsif ($self->{gotRETVAL} || $wantRETVAL) {
my $t = $args{optimize} && $targetable{$type_kind{$self->{ret_type}}};
# Although the '$var' declared in the next line is never explicitly
# used within this 'elsif' block, commenting it out leads to
my ($outarg, $outcode) = /^\s*(\S+)\s*(.*?)\s*$/s;
blurt ("Error: duplicate OUTPUT argument '$outarg' ignored"), next
if $outargs{$outarg}++;
- if (!$gotRETVAL and $outarg eq 'RETVAL') {
+ if (!$self->{gotRETVAL} and $outarg eq 'RETVAL') {
# deal with RETVAL last
$RETVAL_code = $outcode;
- $gotRETVAL = 1;
+ $self->{gotRETVAL} = 1;
next;
}
blurt ("Error: OUTPUT $outarg not an argument"), next