diff src/gearsTools/generate_stub.pl @ 82:d419660ad71d

tweak generate_stub.pl
author anatofuz
date Fri, 11 Oct 2019 19:32:16 +0900
parents 214d21c891c7
children
line wrap: on
line diff
--- a/src/gearsTools/generate_stub.pl	Wed Oct 09 20:43:04 2019 +0900
+++ b/src/gearsTools/generate_stub.pl	Fri Oct 11 19:32:16 2019 +0900
@@ -248,7 +248,7 @@
                 if ($typeName eq $var{$interface}->{$ivar}) {
                     if ($output) {
                         $dataGearName{$codeGearName} .= "\t$typeName$ptrType* O_$varName = &Gearef(cbc_context, $interface)->$varName;\n";
-                        $outputVar{$codeGearName} .= "\t$typeName$ptrType $varName = *O_$varName;\n";
+                        $outputVar{$codeGearName} .= "\t$typeName$ptrType $varName  __attribute__((unused))  = *O_$varName;\n";
                         return 1;
                     }
                     $dataGearName{$codeGearName} .= "\t$typeName$ptrType $varName = Gearef(cbc_context, $interface)->$varName;\n";
@@ -449,6 +449,7 @@
                 }
                 next;
             } elsif (! $inCode) {
+                s/new\s+(\w+)\(\)/\&ALLOCATE(cbc_context, \1)->\1/g;   # replacing new
                 print $fd $_;
                 next;
             } elsif (/^(.*)goto (\w+)\-\>(\w+)\((.*)\);/) {
@@ -458,7 +459,7 @@
                 my $next = $2;
                 my $method = $3;
                 my $tmpArgs = $4;
-                $tmpArgs =~ s/\(.*\)/\(\)/;
+                #$tmpArgs =~ s/\(.*\)/\(\)/;
                 my @args = split(/,/,$tmpArgs);
                 if (! defined $dataGearVarType{$codeGearName}) {
                    print $fd $_ ;