# HG changeset patch # User anatofuz # Date 1581069616 -32400 # Node ID b85ac65a3b52a4460df0fe56db2dec9053cdc914 # Parent b4e3629ca798544939808d3a9fef915656fd011b fix_gen_context diff -r b4e3629ca798 -r b85ac65a3b52 src/gearsTools/lib/Gears/Util.pm --- 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;