Fix a few more generator scripts to produce pgindent-clean output.
authorTom Lane <[email protected]>
Mon, 21 Sep 2020 17:58:26 +0000 (13:58 -0400)
committerTom Lane <[email protected]>
Mon, 21 Sep 2020 17:58:26 +0000 (13:58 -0400)
This completes the project of making all our derived files be
pgindent-clean (or else explicitly excluded from indentation),
so that no surprises result when running pgindent in a built-out
development tree.

Discussion: https://postgr.es/m/79ed5348-be7a-b647-dd40-742207186a22@2ndquadrant.com

src/backend/utils/sort/gen_qsort_tuple.pl
src/pl/plpgsql/src/generate-plerrcodes.pl
src/pl/plpython/generate-spiexceptions.pl
src/pl/tcl/generate-pltclerrcodes.pl

index eb0f7c5814f4b9e53fb563618944af60e0012d53..4c305806c7ce3ff1e0d1b8d3edc4991dc3717213 100644 (file)
@@ -115,7 +115,8 @@ swapfunc(SortTuple *a, SortTuple *b, size_t n)
 {
    do
    {
-       SortTuple   t = *a;
+       SortTuple   t = *a;
+
        *a++ = *b;
        *b++ = t;
    } while (--n > 0);
@@ -143,9 +144,9 @@ med3_$SUFFIX(SortTuple *a, SortTuple *b, SortTuple *c$EXTRAARGS)
 {
    return cmp_$SUFFIX(a, b$CMPPARAMS) < 0 ?
        (cmp_$SUFFIX(b, c$CMPPARAMS) < 0 ? b :
-           (cmp_$SUFFIX(a, c$CMPPARAMS) < 0 ? c : a))
+        (cmp_$SUFFIX(a, c$CMPPARAMS) < 0 ? c : a))
        : (cmp_$SUFFIX(b, c$CMPPARAMS) > 0 ? b :
-           (cmp_$SUFFIX(a, c$CMPPARAMS) < 0 ? a : c));
+          (cmp_$SUFFIX(a, c$CMPPARAMS) < 0 ? a : c));
 }
 
 static void
index 32d251c8c2f19c424c135573213a29adb1a9c4a0..a50de66ef813f154fcf9a97065fce145d141825d 100644 (file)
@@ -34,7 +34,7 @@ while (<$errcodes>)
    # Skip lines without PL/pgSQL condition names
    next unless defined($condition_name);
 
-   print "{\n\t\"$condition_name\", $errcode_macro\n},\n\n";
+   print "\n{\n\t\"$condition_name\", $errcode_macro\n},\n";
 }
 
 close $errcodes;
index fba603e9ec8971e8a51754050a8e984af7beea94..14967ba3eef6a342067b31f9dad83a0bb203ff3d 100644 (file)
@@ -37,8 +37,8 @@ while (<$errcodes>)
    # Change some_error_condition to SomeErrorCondition
    $condition_name =~ s/([a-z])([^_]*)(?:_|$)/\u$1$2/g;
 
-   print "\"spiexceptions.$condition_name\", "
-     . "\"$condition_name\", $errcode_macro },\n";
+   print "\n{\n\t\"spiexceptions.$condition_name\", "
+     . "\"$condition_name\", $errcode_macro\n},\n";
 }
 
 close $errcodes;
index 43417a4bb4c2111f313b82a2d96b44fd734a23cd..bb9eb8a824dc05689b3172b20f1b8e67460c99f2 100644 (file)
@@ -34,7 +34,7 @@ while (<$errcodes>)
    # Skip lines without PL/pgSQL condition names
    next unless defined($condition_name);
 
-   print "{\n\t\"$condition_name\", $errcode_macro\n},\n\n";
+   print "\n{\n\t\"$condition_name\", $errcode_macro\n},\n";
 }
 
 close $errcodes;