[media] drx-j: Remove typedefs in drxj.c
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 17 Jan 2014 10:00:31 +0000 (07:00 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 4 Mar 2014 17:29:02 +0000 (14:29 -0300)
commit60d3603ba0b69b69b2acfe3f60217e08788d489b
tree249188ac7047895dc74e95bc9c1980d5444844ff
parente33f2193ade658a509d01178a95c32b9242b7d61
[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>
drivers/media/dvb-frontends/drx39xyj/drxj.c
This page took 0.025624 seconds and 5 git commands to generate.