Mercurial > hg > Members > Moririn
changeset 387:590f03af1a2c
fix getCodeGear
author | mir3636 |
---|---|
date | Thu, 27 Jul 2017 18:23:03 +0900 |
parents | 89a9e9c14498 |
children | 8940d1451a0d |
files | src/parallel_execution/generate_stub.pl |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl Wed Jul 26 18:57:19 2017 +0900 +++ b/src/parallel_execution/generate_stub.pl Thu Jul 27 18:23:03 2017 +0900 @@ -146,13 +146,13 @@ if ($args =~ s/^(\s)*\_\_code\s+(\w+)\(([^)]*)\)//) { my $next = $2; my @args = split(/,/,$3); - push(@{$code{$name}->{$method}},$next); + push(@{$code{$name}->{$method}},"\_\_code $next"); } elsif ($args =~ s/^(struct|union) (\w+)(\*)+\s(\w+)//) { my $structType = $1; my $typeName = $2; my $varName = $4; my $typeField = lcfirst($typeName); - push(@{$code{$name}->{$method}},$varName); + push(@{$code{$name}->{$method}},"$typeName $varName"); } elsif ($args =~ s/(.*,)//) { } else { last; @@ -356,7 +356,15 @@ for my $arg (@args) { my $p = @$prot[$i]; next if ( $p eq $arg); - print $fd "\tGearef(context, $ntype)->$p = $arg;\n"; + $p =~ s/^(.*)\s(\w+)//; + my $pType = $1; + my $pName = $2; + $arg =~ s/^(\s)*(\w+)/$2/; + if ($pType =~ s/\_\_code$//) { + print $fd "\tGearef(context, $ntype)->$pName = C_$arg;\n"; + } else { + print $fd "\tGearef(context, $ntype)->$pName = $arg;\n"; + } $i++; } print $fd "${prev}goto meta(context, $next->$next->$ntype.$method);\n";