Skip to content

Commit 43ce181

Browse files
committed
Perl scripts: eliminate "Useless interpolation" warnings
Eliminate warnings of Perl Critic from src/tools. Backpatch-through: master
1 parent b8ea0f6 commit 43ce181

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

src/tools/copyright.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sub wanted
4444
return if ($_ =~ m/\.(ico|bin|po|key)$/);
4545

4646
my @lines;
47-
tie @lines, "Tie::File", $File::Find::name;
47+
tie @lines, 'Tie::File', $File::Find::name;
4848

4949
# We process all lines because some files have copyright
5050
# strings embedded in them, e.g. src/bin/psql/help.c

src/tools/gen_export.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'format:s' => \$format,
1515
'libname:s' => \$libname,
1616
'input:s' => \$input,
17-
'output:s' => \$output) or die "wrong arguments";
17+
'output:s' => \$output) or die 'wrong arguments';
1818

1919
if (not( $format eq 'darwin'
2020
or $format eq 'gnu'
@@ -32,9 +32,9 @@
3232

3333
if ($format eq 'gnu')
3434
{
35-
print $output_handle "{
35+
print $output_handle '{
3636
global:
37-
";
37+
';
3838
}
3939
elsif ($format eq 'win')
4040
{
@@ -76,7 +76,7 @@
7676

7777
if ($format eq 'gnu')
7878
{
79-
print $output_handle " local: *;
79+
print $output_handle ' local: *;
8080
};
81-
";
81+
';
8282
}

src/tools/gen_keywordlist.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160

161161
# Emit the definition of the hash function.
162162

163-
my $funcname = $varname . "_hash_func";
163+
my $funcname = $varname . '_hash_func';
164164

165165
my $f = PerfectHash::generate_hash_function(\@keywords, $funcname,
166166
case_fold => $case_fold);
@@ -169,7 +169,7 @@
169169

170170
# Emit the struct that wraps all this lookup info into one variable.
171171

172-
printf $kwdef "static " if !$extern;
172+
printf $kwdef 'static ' if !$extern;
173173
printf $kwdef "const ScanKeywordList %s = {\n", $varname;
174174
printf $kwdef qq|\t%s_kw_string,\n|, $varname;
175175
printf $kwdef qq|\t%s_kw_offsets,\n|, $varname;

src/tools/msvc_gendef.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ sub extract_syms
7272
next unless $pieces[6];
7373

7474
# Skip externs used from another compilation unit
75-
next if ($pieces[2] eq "UNDEF");
75+
next if ($pieces[2] eq 'UNDEF');
7676

7777
# Skip static symbols
78-
next unless ($pieces[4] eq "External");
78+
next unless ($pieces[4] eq 'External');
7979

8080
# Skip some more MSVC-generated crud
8181
next if $pieces[6] =~ /^@/;
@@ -120,7 +120,7 @@ sub writedef
120120

121121
# Strip the leading underscore for win32, but not x64
122122
$f =~ s/^_//
123-
unless ($arch eq "x86_64");
123+
unless ($arch eq 'x86_64');
124124

125125
# Emit just the name if it's a function symbol, or emit the name
126126
# decorated with the DATA option for variables.
@@ -193,11 +193,11 @@ sub usage
193193

194194
my $cmd = "dumpbin /nologo /symbols /out:$tmpfile " . join(' ', @files);
195195

196-
system($cmd) == 0 or die "Could not call dumpbin";
196+
system($cmd) == 0 or die 'Could not call dumpbin';
197197
rename($tmpfile, $symfile) or die $!;
198198
extract_syms($symfile, \%def);
199199
print "\n";
200200

201201
writedef($deffile, $arch, \%def);
202202

203-
print "Generated " . scalar(keys(%def)) . " symbols\n";
203+
print 'Generated ' . scalar(keys(%def)) . " symbols\n";

src/tools/version_stamp.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
$dotneeded = 1;
3939
}
40-
elsif ($minor eq "devel")
40+
elsif ($minor eq 'devel')
4141
{
4242
$dotneeded = 0;
4343
}
@@ -63,7 +63,7 @@
6363
# Create various required forms of the version number
6464
if ($dotneeded)
6565
{
66-
$fullversion = $majorversion . "." . $minor;
66+
$fullversion = $majorversion . '.' . $minor;
6767
}
6868
else
6969
{
@@ -73,8 +73,8 @@
7373
# Get the autoconf version number for eventual nag message
7474
# (this also ensures we're in the right directory)
7575

76-
my $aconfver = "";
77-
open(my $fh, '<', "configure.ac") || die "could not read configure.ac: $!\n";
76+
my $aconfver = '';
77+
open(my $fh, '<', 'configure.ac') || die "could not read configure.ac: $!\n";
7878
while (<$fh>)
7979
{
8080
if (m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], \[m4_fatal/
@@ -85,17 +85,17 @@
8585
}
8686
}
8787
close($fh);
88-
$aconfver ne ""
88+
$aconfver ne ''
8989
|| die "could not find autoconf version number in configure.ac\n";
9090

9191
# Update configure.ac and other files that contain version numbers
9292

93-
my $fixedfiles = "";
93+
my $fixedfiles = '';
9494

95-
sed_file("configure.ac",
95+
sed_file('configure.ac',
9696
"-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], [$fullversion]/'"
9797
);
98-
sed_file("meson.build",
98+
sed_file('meson.build',
9999
qq{-e "/^project(/,/^)/ s/ version: '[0-9a-z.]*',/ version: '$fullversion',/"}
100100
);
101101

@@ -107,7 +107,7 @@
107107
sub sed_file
108108
{
109109
my ($filename, $sedargs) = @_;
110-
my ($tmpfilename) = $filename . ".tmp";
110+
my ($tmpfilename) = $filename . '.tmp';
111111

112112
system("sed $sedargs $filename >$tmpfilename") == 0
113113
or die "sed failed: $?";

src/tools/win32tzlist.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ BEGIN
3838
#
3939
my $basekey;
4040
$HKEY_LOCAL_MACHINE->Open(
41-
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", $basekey)
41+
'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones', $basekey)
4242
or die $!;
4343

4444
my @subkeys;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy