summaryrefslogtreecommitdiffstats
path: root/rpmconstant/rpmh2tbl
diff options
context:
space:
mode:
authortv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-12-18 00:14:31 +0000
committertv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-12-18 00:14:31 +0000
commit7ccfd687e6b1554ebcdb123979f005523a1b89b1 (patch)
tree1dfe48275990559a7652d3b6b45eabe7914b0531 /rpmconstant/rpmh2tbl
parentf2b68f33b2083673835a2bcb6307861611bf7a98 (diff)
downloadperl-RPM4-7ccfd687e6b1554ebcdb123979f005523a1b89b1.tar
perl-RPM4-7ccfd687e6b1554ebcdb123979f005523a1b89b1.tar.gz
perl-RPM4-7ccfd687e6b1554ebcdb123979f005523a1b89b1.tar.bz2
perl-RPM4-7ccfd687e6b1554ebcdb123979f005523a1b89b1.tar.xz
perl-RPM4-7ccfd687e6b1554ebcdb123979f005523a1b89b1.zip
perl_checker cleanups
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@237 971eb68f-4bfb-0310-8326-d2484c010a4c
Diffstat (limited to 'rpmconstant/rpmh2tbl')
-rwxr-xr-xrpmconstant/rpmh2tbl22
1 files changed, 11 insertions, 11 deletions
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 <<EOF;
@@ -166,12 +166,12 @@ sub parseconst {
EOF
printf $ch "static const struct rpmconstant_s %sctbl[] = {\n",
$tbl;
- print $ch "#ifdef $headerdef\n" if ($headerdef);
+ print $ch "#ifdef $headerdef\n" if $headerdef;
foreach my $c (sort { $const->{$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";