From fe2c8749fd0ca92a433e5beca00014266074ff4d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 12 Jan 2023 21:23:09 -0600
Subject: [PATCH 05/10] WIP: avoid whitespace preceding/following 'else'

---
 contrib/dblink/dblink.c                                      | 1 -
 contrib/spi/refint.c                                         | 1 -
 src/backend/commands/functioncmds.c                          | 1 -
 src/backend/commands/tablecmds.c                             | 1 -
 src/backend/executor/nodeTidrangescan.c                      | 1 -
 src/backend/libpq/be-secure-openssl.c                        | 1 -
 src/backend/optimizer/geqo/geqo_erx.c                        | 1 -
 src/backend/optimizer/geqo/geqo_pmx.c                        | 1 -
 src/backend/optimizer/geqo/geqo_pool.c                       | 1 -
 src/backend/optimizer/util/clauses.c                         | 1 -
 src/backend/replication/logical/origin.c                     | 1 -
 src/backend/replication/logical/snapbuild.c                  | 1 -
 src/backend/rewrite/rowsecurity.c                            | 1 -
 src/backend/utils/adt/formatting.c                           | 1 -
 src/backend/utils/adt/pgstatfuncs.c                          | 5 -----
 .../mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c  | 1 -
 src/backend/utils/mmgr/mcxt.c                                | 1 -
 src/bin/pg_amcheck/pg_amcheck.c                              | 3 ---
 src/bin/psql/command.c                                       | 4 ----
 src/interfaces/libpq/fe-connect.c                            | 1 -
 20 files changed, 29 deletions(-)

diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 78a8bcee6e3..263e35442b3 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -2428,7 +2428,6 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
 		ereport(ERROR,
 				(errcode(ERRCODE_CARDINALITY_VIOLATION),
 				 errmsg("source criteria matched more than one record")));
-
 	else if (ret == SPI_OK_SELECT && SPI_processed == 1)
 	{
 		SPITupleTable *tuptable = SPI_tuptable;
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index 18062eb1cff..31e95663466 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -456,7 +456,6 @@ check_foreign_key(PG_FUNCTION_ARGS)
 			 * updates new key values in referenced tables
 			 */
 
-
 			else if (action == 'c')
 			{
 				if (is_update == 1)
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 69f66dfe7da..bfd44d3b2c6 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -1575,7 +1575,6 @@ CreateCast(CreateCastStmt *stmt)
 		ereport(WARNING,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 				 errmsg("cast will be ignored because the source data type is a domain")));
-
 	else if (targettyptype == TYPTYPE_DOMAIN)
 		ereport(WARNING,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 1293545947e..debbe8a73ef 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -17002,7 +17002,6 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid,
 	}
 	else if (IsA(stmt, AlterObjectSchemaStmt))
 		reltype = ((AlterObjectSchemaStmt *) stmt)->objectType;
-
 	else if (IsA(stmt, AlterTableStmt))
 		reltype = ((AlterTableStmt *) stmt)->objtype;
 	else
diff --git a/src/backend/executor/nodeTidrangescan.c b/src/backend/executor/nodeTidrangescan.c
index 2124c55ef53..5f0c9f06879 100644
--- a/src/backend/executor/nodeTidrangescan.c
+++ b/src/backend/executor/nodeTidrangescan.c
@@ -183,7 +183,6 @@ TidRangeEval(TidRangeScanState *node)
 			if (ItemPointerCompare(&lb, &lowerBound) > 0)
 				ItemPointerCopy(&lb, &lowerBound);
 		}
-
 		else if (tidopexpr->exprtype == TIDEXPR_UPPER_BOUND)
 		{
 			ItemPointerData ub;
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index e3c7c12aa0e..4e721b705d5 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -1630,7 +1630,6 @@ default_openssl_tls_init(SSL_CTX *context, bool isServerStart)
 		if (ssl_passphrase_command[0] && ssl_passphrase_command_supports_reload)
 			SSL_CTX_set_default_passwd_cb(context, ssl_external_passwd_cb);
 		else
-
 			/*
 			 * If reloading and no external command is configured, override
 			 * OpenSSL's default handling of passphrase-protected files,
diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c
index 21ad7854118..26b58f43dee 100644
--- a/src/backend/optimizer/geqo/geqo_erx.c
+++ b/src/backend/optimizer/geqo/geqo_erx.c
@@ -212,7 +212,6 @@ gimme_tour(PlannerInfo *root, Edge *edge_table, Gene *new_gene, int num_gene)
 
 		if (edge_table[new_gene[i - 1]].unused_edges > 0)
 			new_gene[i] = gimme_gene(root, edge_table[(int) new_gene[i - 1]], edge_table);
-
 		else
 		{						/* cope with fault */
 			edge_failures++;
diff --git a/src/backend/optimizer/geqo/geqo_pmx.c b/src/backend/optimizer/geqo/geqo_pmx.c
index e44fd0bae5a..dd35d269281 100644
--- a/src/backend/optimizer/geqo/geqo_pmx.c
+++ b/src/backend/optimizer/geqo/geqo_pmx.c
@@ -112,7 +112,6 @@ pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene)
 
 		if (tour1[k] == tour2[k])
 			found = 1;			/* find match in tour2 */
-
 		else
 		{
 			found = 0;			/* substitute elements */
diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c
index e45bd7286b2..584dc020fda 100644
--- a/src/backend/optimizer/geqo/geqo_pool.c
+++ b/src/backend/optimizer/geqo/geqo_pool.c
@@ -218,7 +218,6 @@ spread_chromo(PlannerInfo *root, Chromosome *chromo, Pool *pool)
 		else if (bot - top <= 1)
 			index = bot;
 
-
 		/*
 		 * these 2 cases move the search indices since a new location has not
 		 * yet been found.
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 76e25118f94..080180e2d0d 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -733,7 +733,6 @@ max_parallel_hazard_walker(Node *node, max_parallel_hazard_context *context)
 		if (max_parallel_hazard_test(PROPARALLEL_RESTRICTED, context))
 			return true;
 	}
-
 	else if (IsA(node, NextValueExpr))
 	{
 		if (max_parallel_hazard_test(PROPARALLEL_UNSAFE, context))
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 2c04c8707dc..04b084d298e 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -1133,7 +1133,6 @@ replorigin_session_setup(RepOriginId node, int acquired_by)
 		/* not our slot */
 		if (curstate->roident != node)
 			continue;
-
 		else if (curstate->acquired_by != 0 && acquired_by == 0)
 		{
 			ereport(ERROR,
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 62542827e4b..e45e0e56756 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1647,7 +1647,6 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
 		ereport(ERROR,
 				(errcode_for_file_access(),
 				 errmsg("could not stat file \"%s\": %m", path)));
-
 	else if (ret == 0)
 	{
 		/*
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index 569c1c94679..0666e7ba06a 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -727,7 +727,6 @@ add_security_quals(int rt_index,
 		*securityQuals = list_append_unique(*securityQuals, rowsec_expr);
 	}
 	else
-
 		/*
 		 * A permissive policy must exist for rows to be visible at all.
 		 * Therefore, if there were no permissive policies found, return a
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index f3f4db5ef60..7ac400ce092 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -5082,7 +5082,6 @@ NUM_prepare_locale(NUMProc *Np)
 		 */
 		if (lconv->decimal_point && *lconv->decimal_point)
 			Np->decimal = lconv->decimal_point;
-
 		else
 			Np->decimal = ".";
 
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 67374934022..1797416427d 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -814,7 +814,6 @@ pg_stat_get_backend_activity_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -840,7 +839,6 @@ pg_stat_get_backend_xact_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -862,7 +860,6 @@ pg_stat_get_backend_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -886,7 +883,6 @@ pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -931,7 +927,6 @@ pg_stat_get_backend_client_port(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
diff --git a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
index bae24681668..9d344e9a8e4 100644
--- a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
+++ b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
@@ -162,7 +162,6 @@ euc_jis_20042shift_jis_2004(const unsigned char *euc, unsigned char *p, int len,
 			else
 				*p++ = ten + 0x9e;
 		}
-
 		else if (l == 2)		/* JIS X 0213 plane 1? */
 		{
 			ku = c1 - 0xa0;
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 0b00802df70..4646ae50277 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -711,7 +711,6 @@ MemoryContextStatsDetail(MemoryContext context, int max_children,
 				grand_totals.freespace, grand_totals.freechunks,
 				grand_totals.totalspace - grand_totals.freespace);
 	else
-
 		/*
 		 * Use LOG_SERVER_ONLY to prevent the memory contexts from being sent
 		 * to the connected client.
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index 68f8180c19f..4b770d83a70 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -1017,18 +1017,15 @@ verify_heap_slot_handler(PGresult *res, PGconn *conn, void *context)
 					   PQgetvalue(res, i, 0),	/* blkno */
 					   PQgetvalue(res, i, 1),	/* offnum */
 					   PQgetvalue(res, i, 2));	/* attnum */
-
 			else if (!PQgetisnull(res, i, 1))
 				printf(_("heap table \"%s.%s.%s\", block %s, offset %s:\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname,
 					   PQgetvalue(res, i, 0),	/* blkno */
 					   PQgetvalue(res, i, 1));	/* offnum */
-
 			else if (!PQgetisnull(res, i, 0))
 				printf(_("heap table \"%s.%s.%s\", block %s:\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname,
 					   PQgetvalue(res, i, 0));	/* blkno */
-
 			else
 				printf(_("heap table \"%s.%s.%s\":\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname);
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b5201edf555..3e0b37a17ca 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1992,7 +1992,6 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 				success = do_lo_export(opt1, opt2);
 			}
 		}
-
 		else if (strcmp(cmd + 3, "import") == 0)
 		{
 			if (!opt1)
@@ -2006,12 +2005,10 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 				success = do_lo_import(opt1, opt2);
 			}
 		}
-
 		else if (strcmp(cmd + 3, "list") == 0)
 			success = listLargeObjects(false);
 		else if (strcmp(cmd + 3, "list+") == 0)
 			success = listLargeObjects(true);
-
 		else if (strcmp(cmd + 3, "unlink") == 0)
 		{
 			if (!opt1)
@@ -2022,7 +2019,6 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 			else
 				success = do_lo_unlink(opt1);
 		}
-
 		else
 			status = PSQL_CMD_UNKNOWN;
 
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 50b5df3490b..00ba10b01b4 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7012,7 +7012,6 @@ passwordFromFile(const char *hostname, const char *port, const char *dbname,
 	if (hostname == NULL || hostname[0] == '\0')
 		hostname = DefaultHost;
 	else if (is_unixsock_path(hostname))
-
 		/*
 		 * We should probably use canonicalize_path(), but then we have to
 		 * bring path.c into libpq, and it doesn't seem worth it.
-- 
2.25.1

