From e8697f90d03af120d21259c941f9e40d76902b0e Mon Sep 17 00:00:00 2001 From: "James E. Keenan" Date: Sat, 3 Apr 2010 10:00:52 -0400 Subject: [PATCH] Change \@BootCode to $BootCode_ref to facilitate more refactoring of code into (somewhat) encapsulated subs. --- dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index 10c8331..ca71735 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -297,7 +297,8 @@ EOF $self->{lastline} = $_; $self->{lastline_no} = $.; - my (@BootCode, @outlist, $prepush_done, $xsreturn, $func_header, $orig_args, ); + my (@outlist, $prepush_done, $xsreturn, $func_header, $orig_args, ); + my $BootCode_ref = []; my $XSS_work_idx = 0; my $cpp_next_tmp = 'XSubPPtmpAAAA'; PARAGRAPH: @@ -317,7 +318,7 @@ EOF if $self->{XSStack}->[-1]{type} ne 'if'; if ($self->{XSStack}->[-1]{varname}) { push(@{ $self->{InitFileCode} }, "#endif\n"); - push(@BootCode, "#endif"); + push(@{ $BootCode_ref }, "#endif"); } my(@fns) = keys %{$self->{XSStack}->[-1]{functions}}; @@ -343,7 +344,7 @@ EOF # We are inside an #if, but have not yet #defined its xsubpp variable. print "#define $cpp_next_tmp 1\n\n"; push(@{ $self->{InitFileCode} }, "#if $cpp_next_tmp\n"); - push(@BootCode, "#if $cpp_next_tmp"); + push(@{ $BootCode_ref }, "#if $cpp_next_tmp"); $self->{XSStack}->[$XSS_work_idx]{varname} = $cpp_next_tmp++; } @@ -388,9 +389,9 @@ EOF if (check_keyword("BOOT")) { &check_cpp; - push (@BootCode, "#line $self->{line_no}->[@{ $self->{line_no} } - @{ $self->{line} }] \"$self->{filepathname}\"") + push (@{ $BootCode_ref }, "#line $self->{line_no}->[@{ $self->{line_no} } - @{ $self->{line} }] \"$self->{filepathname}\"") if $self->{WantLineNumbers} && $self->{line}->[0] !~ /^\s*#\s*line\b/; - push (@BootCode, @{ $self->{line} }, ""); + push (@{ $BootCode_ref }, @{ $self->{line} }, ""); next PARAGRAPH; } @@ -1033,9 +1034,9 @@ EOF # } EOF - if (@BootCode) { + if (@{ $BootCode_ref }) { print "\n /* Initialisation Section */\n\n"; - @{ $self->{line} } = @BootCode; + @{ $self->{line} } = @{ $BootCode_ref }; print_section(); print "\n /* End of Initialisation Section */\n\n"; } -- 2.7.4