From: Mauro Carvalho Chehab Date: Fri, 17 Jan 2014 10:00:31 +0000 (-0300) Subject: [media] drx-j: Remove typedefs in drxj.c X-Git-Tag: v3.15-rc1~85^2~274 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60d3603ba0b69b69b2acfe3f60217e08788d489b;p=pandora-kernel.git [media] drx-j: Remove typedefs in drxj.c Remove three typedefs from drxj.c, using the following script: use File::Find; use strict; my $dir = shift or die "need a dir"; my $type = shift or die "need type"; my $var = shift or die "need var"; sub handle_file { my $file = shift; my $out; open IN, $file or die "can't open $file"; $out .= $_ while (); close IN; $out =~ s/\btypedef\s+($type)\s+\{([\d\D]+?)\s*\}\s+\b($var)[^\;]+\;/$type $var \{\2\};/; # This replaces the typedef declaration for a simple struct declaration - style 1 # This replaces the typedef declaration for a simple struct declaration - style 2 # Replace struct occurrences $out =~ s,\b($var)_t\s+,$type \1 ,g; $out =~ s,\bp_*($var)_t\s+,$type \1 *,g; $out =~ s,\b($var)_t\b,$type \1,g; $out =~ s,\bp_*($var)_t\b,$type \1 *,g; open OUT, ">$file" or die "can't open $file"; print OUT $out; close OUT; } sub parse_dir { my $file = $File::Find::name; return if (!($file =~ /.[ch]$/)); handle_file $file; } find({wanted => \&parse_dir, no_chdir => 1}, $dir); Acked-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed