From: Nicholas Clark Date: Sun, 21 Aug 2011 15:50:26 +0000 (+0200) Subject: In embed.pl, inline walk_table() into its only caller. X-Git-Tag: accepted/trunk/20130322.191538~3036^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a54c8e7c7d0987480043de667a1b5afee4bcd54;p=platform%2Fupstream%2Fperl.git In embed.pl, inline walk_table() into its only caller. --- diff --git a/regen/embed.pl b/regen/embed.pl index 5a75009..d339016 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -53,27 +53,6 @@ sub open_print_header { my ($embed, $core, $ext, $api) = setup_embed(); -# walk table providing an array of components in each line to -# subroutine, printing the result -sub walk_table (&@) { - my ($function, $filename) = @_; - my $F; - if (ref $filename) { # filehandle - $F = $filename; - } - else { - $F = open_print_header($filename); - } - foreach (@$embed) { - my @outs = &{$function}(@$_); - # $function->(@args) is not 5.003 - print $F @outs; - } - unless (ref $filename) { - read_only_bottom_close_and_rename($F); - } -} - # generate proto.h { my $pr = open_print_header("proto.h"); @@ -358,17 +337,17 @@ print $em <<'END'; # define perl_atexit(a,b) call_atexit(a,b) END -walk_table { - my ($flags,$retval,$func,@args) = @_; - return unless $func; - return unless $flags =~ /O/; +foreach (@$embed) { + my ($flags, $retval, $func, @args) = @$_; + next unless $func; + next unless $flags =~ /O/; my $alist = join ",", @az[0..$#args]; my $ret = "# define perl_$func($alist)"; my $t = (length $ret) >> 3; $ret .= "\t" x ($t < 5 ? 5 - $t : 1); - "$ret$func($alist)\n"; -} $em; + print $em "$ret$func($alist)\n"; +} my @nocontext; {