[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 (<IN>); 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 <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Showing
Please register or sign in to comment