From 7ccfd687e6b1554ebcdb123979f005523a1b89b1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 18 Dec 2012 00:14:31 +0000 Subject: perl_checker cleanups git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@237 971eb68f-4bfb-0310-8326-d2484c010a4c --- rpmconstant/rpmh2tbl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'rpmconstant') diff --git a/rpmconstant/rpmh2tbl b/rpmconstant/rpmh2tbl index a198526..3f989c8 100755 --- a/rpmconstant/rpmh2tbl +++ b/rpmconstant/rpmh2tbl @@ -129,7 +129,7 @@ my $ch = *STDOUT; sub parseconst { my ($header) = @_; - my ($hbasename) = $header =~ m#(?:.*/)(.*)$#; + my ($hbasename) = $header =~ m!(?:.*/)(.*)$!; my $hconstant = $file_const{$hbasename} or return; open(my $hheader, "<", $header) or die "Can't open $header\n"; @@ -138,14 +138,14 @@ sub parseconst { my $i; my $line = <$hheader>; - $line =~ /^\s*#\s*ifndef\s+(\S+)/; - my $headerdef = $1 if($1); + my $headerdef; + $headerdef = $1 if $line =~ /^\s*#\s*ifndef\s+(\S+)/; while ($line = <$hheader>) { - $line =~ s#^\s*/\*[^\*]*\*/##; + $line =~ s!^\s*/\*[^\*]*\*/!!; my ($w, $c) = $line =~ m!(?:#\s*define\s*)?([\w_]+)[^(/\*)]*(/\*.*\*/)?!; defined($w) or next; - foreach my $regexp (keys %{$hconstant}) { + foreach my $regexp (keys %$hconstant) { if ($w =~ /$regexp/) { $constants_found{$hconstant->{$regexp}}{$w}{n} ||= ++$i; $constants_found{$hconstant->{$regexp}}{$w}{c} ||= $c; @@ -156,7 +156,7 @@ sub parseconst { close($hheader); - while (my ($tbl, $const) = each (%constants_found)) { + while (my ($tbl, $const) = each %constants_found) { $tableprefix{$tbl} ||= ""; print $ch <{$a}{n} <=> $const->{$b}{n} } keys %$const) { - printf $ch "\t{ \"%s\", %s }, %s\n", + printf $ch qq(\t{ "%s", %s }, %s\n), uc($const->{$c}{s} || $c), $c, $const->{$c}{c} || ""; } - print $ch "#endif /* $headerdef */\n" if ($headerdef); + print $ch "#endif /* $headerdef */\n" if $headerdef; printf $ch "\t{ %s, %s } /* NULL terminated (%s) */\n", "NULL", "0", $tbl; print $ch "};\n"; printf $ch "const struct rpmconstant_s * %sctable = %sctbl;\n\n", $tbl, $tbl; @@ -203,9 +203,9 @@ foreach (@ARGV) { print $ch "static const struct rpmconstantlist_s rpmconstanttp[] = {\n"; foreach (sort(@availlabletables)) { printf $ch "\t{ %s, %s, %s },\n", - '(void *)'.$_."ctbl", + '(void *)' . $_ . "ctbl", '"' . lc($_) . '"', - $tableprefix{$_} ? "\"$tableprefix{$_}\"" : "NULL"; + $tableprefix{$_} ? qq("$tableprefix{$_}") : "NULL"; } printf $ch "\t{ %s, %s, %s } /* NULL terminated */\n", "(void *) NULL", "NULL", "NULL"; print $ch "};\n"; -- cgit v1.2.1