diff src/parallel_execution/generate_stub.pl @ 415:eec6553a2aa6

fix redblacktree
author mir3636
date Thu, 05 Oct 2017 17:00:48 +0900
parents 00d9b0664bdb
children a74bec89c198
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl	Fri Sep 15 22:49:45 2017 +0900
+++ b/src/parallel_execution/generate_stub.pl	Thu Oct 05 17:00:48 2017 +0900
@@ -382,22 +382,26 @@
                 my @args = split(/,/,$4);
                 my @types = @{$dataGearVarType{$codeGearName}};
                 my $ntype;
+                my $ftype;
                 for my $v (@{$dataGearVar{$codeGearName}}) {
                     my $t = shift @types;
                     if ($v eq $next) {
                         $ntype = $t;
+                        $ftype = lcfirst($ntype);
                     }
                 }
-                print $fd "\tGearef(context, $ntype)->$next = $next->$next;\n";
-                # Put interface argument 
+                print $fd "\tGearef(context, $ntype)->$ftype = $next->$ftype;\n";
+                # Put interface argument
                 my $prot = $code{$ntype}->{$method};
                 my $i = 1;
                 for my $arg (@args) {
+                    my $pType;
+                    my $pName;
                     my $p = @$prot[$i];
                     next if ( $p eq $arg);
                     $p =~ s/^(.*)\s(\w+)//;
-                    my $pType = $1;
-                    my $pName = $2;
+                    $pType = $1;
+                    $pName = $2;
                     $arg =~ s/^(\s)*(\w+)/$2/;
                     if ($pType =~ s/\_\_code$//) {
                         print $fd "\tGearef(context, $ntype)->$pName = C_$arg;\n";
@@ -408,7 +412,7 @@
                     }
                     $i++;
                 }
-                print $fd "${prev}goto meta(context, $next->$next->$ntype.$method);\n";
+                print $fd "${prev}goto meta(context, $next->$ftype->$ntype.$method);\n";
                 next;
             } elsif(/^(.*)par goto (\w+)\((.*)\);/) {
                 # handling par goto statement