diff options
author | Tom Lane | 2023-05-19 21:24:48 +0000 |
---|---|---|
committer | Tom Lane | 2023-05-19 21:24:48 +0000 |
commit | 0245f8db36f375326c2bae0c3420d3c77714e72d (patch) | |
tree | 7ce91f23658a05ea24be4703fb06cdc6b56248f7 /src/backend/utils/Gen_fmgrtab.pl | |
parent | df6b19fbbc20d830de91d9bea68715a39635b568 (diff) |
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files.
This set of diffs is a bit larger than typical. We've updated to
pg_bsd_indent 2.1.2, which properly indents variable declarations that
have multi-line initialization expressions (the continuation lines are
now indented one tab stop). We've also updated to perltidy version
20230309 and changed some of its settings, which reduces its desire to
add whitespace to lines to make assignments etc. line up. Going
forward, that should make for fewer random-seeming changes to existing
code.
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/utils/Gen_fmgrtab.pl')
-rw-r--r-- | src/backend/utils/Gen_fmgrtab.pl | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index 2792373feda..764216c56dd 100644 --- a/src/backend/utils/Gen_fmgrtab.pl +++ b/src/backend/utils/Gen_fmgrtab.pl @@ -24,7 +24,7 @@ my $output_path = ''; my $include_path; GetOptions( - 'output:s' => \$output_path, + 'output:s' => \$output_path, 'include-path:s' => \$include_path) || usage(); # Make sure output_path ends in a slash. @@ -34,7 +34,7 @@ if ($output_path ne '' && substr($output_path, -1) ne '/') } # Sanity check arguments. -die "No input files.\n" unless @ARGV; +die "No input files.\n" unless @ARGV; die "--include-path must be specified.\n" unless $include_path; # Read all the input files into internal data structures. @@ -56,7 +56,7 @@ foreach my $datfile (@ARGV) my $catalog = Catalog::ParseHeader($header); my $catname = $catalog->{catname}; - my $schema = $catalog->{columns}; + my $schema = $catalog->{columns}; $catalogs{$catname} = $catalog; $catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0); @@ -72,14 +72,14 @@ foreach my $row (@{ $catalog_data{pg_proc} }) push @fmgr, { - oid => $bki_values{oid}, - name => $bki_values{proname}, - lang => $bki_values{prolang}, - kind => $bki_values{prokind}, + oid => $bki_values{oid}, + name => $bki_values{proname}, + lang => $bki_values{prolang}, + kind => $bki_values{prokind}, strict => $bki_values{proisstrict}, retset => $bki_values{proretset}, - nargs => $bki_values{pronargs}, - args => $bki_values{proargtypes}, + nargs => $bki_values{pronargs}, + args => $bki_values{proargtypes}, prosrc => $bki_values{prosrc}, }; @@ -88,10 +88,10 @@ foreach my $row (@{ $catalog_data{pg_proc} }) } # Emit headers for both files -my $tmpext = ".tmp$$"; -my $oidsfile = $output_path . 'fmgroids.h'; +my $tmpext = ".tmp$$"; +my $oidsfile = $output_path . 'fmgroids.h'; my $protosfile = $output_path . 'fmgrprotos.h'; -my $tabfile = $output_path . 'fmgrtab.c'; +my $tabfile = $output_path . 'fmgrtab.c'; open my $ofh, '>', $oidsfile . $tmpext or die "Could not open $oidsfile$tmpext: $!"; @@ -213,7 +213,8 @@ $bmap{'t'} = 'true'; $bmap{'f'} = 'false'; my @fmgr_builtin_oid_index; my $last_builtin_oid = 0; -my $fmgr_count = 0; +my $fmgr_count = 0; + foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr) { next if $s->{lang} ne 'internal'; @@ -273,9 +274,9 @@ close($pfh); close($tfh); # Finally, rename the completed files into place. -Catalog::RenameTempFile($oidsfile, $tmpext); +Catalog::RenameTempFile($oidsfile, $tmpext); Catalog::RenameTempFile($protosfile, $tmpext); -Catalog::RenameTempFile($tabfile, $tmpext); +Catalog::RenameTempFile($tabfile, $tmpext); sub usage { |