changeset 325:b85ac65a3b52

fix_gen_context
author anatofuz
date Fri, 07 Feb 2020 19:00:16 +0900
parents b4e3629ca798
children f0b337cb6024
files src/gearsTools/lib/Gears/Util.pm
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/lib/Gears/Util.pm	Fri Feb 07 18:47:41 2020 +0900
+++ b/src/gearsTools/lib/Gears/Util.pm	Fri Feb 07 19:00:16 2020 +0900
@@ -30,6 +30,7 @@
   Gears::Util->file_checking($file);
   open my $fh, '<', $file;
   my $line = <$fh>;
+  my $static_data_gear_write_mode = 0;
 
   if ($line =~ /typedef struct (\w+)\s?<.*>([\s\w{]+)/) {
     die "invalied struct name $1" unless $1;
@@ -55,6 +56,7 @@
 
     if ($line =~ m|__code (\w+)|) {
       push(@tmp_args,"enum Code $1;\n");
+      next if $static_data_gear_write_mode;
       my $args = $';
       #$args eq  (Impl* vm, pde_t* pgdir, char* init, uint sz, __code next(...));
       while ($args =~ /\s*(struct|union|const)?\s*([\w*\[\]_]+)\s*(\w+),?/g) {
@@ -71,6 +73,7 @@
 
     $line =~ s/^\s+//;
     push(@tmp_args,$line);
+    $static_data_gear_write_mode = 1;
   }
 
   push(@{$ir->{content}}, _uniq(@tmp_args));
@@ -229,9 +232,13 @@
        }
 
 
-       if ($line =~ /^(\w+)\*\s*create(\w+)\(/) {
+       if ($line =~ /^(\w+)\*\s*create(\w+)\(([*\w\s]+)\)/) {
           my $interface = $1;
           my $implementation = $2;
+          my $arg = $3;
+          if ($arg eq "") {
+            next;
+          }
           push(@{$counter{interfaces}->{$interface}->{$cbc_file}},$.);
           push(@{$counter{impl}->{$implementation}->{$cbc_file}},$.);
           next;