1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Rename shadowed local variables

In a similar effort to f01592f91, here we mostly rename shadowed local
variables to remove the warnings produced when compiling with
-Wshadow=compatible-local.

This fixes 63 warnings and leaves just 5.

Author: Justin Pryzby, David Rowley
Reviewed-by: Justin Pryzby
Discussion https://postgr.es/m/20220817145434.GC26426%40telsasoft.com
This commit is contained in:
David Rowley
2022-10-05 21:01:41 +13:00
parent 839c2520a7
commit 2d0bbedda7
39 changed files with 220 additions and 226 deletions

View File

@ -3552,27 +3552,27 @@ do_connect(enum trivalue reuse_previous_specification,
param_is_newly_set(PQhost(o_conn), PQhost(pset.db)) ||
param_is_newly_set(PQport(o_conn), PQport(pset.db)))
{
char *host = PQhost(pset.db);
char *connhost = PQhost(pset.db);
char *hostaddr = PQhostaddr(pset.db);
if (is_unixsock_path(host))
if (is_unixsock_path(connhost))
{
/* hostaddr overrides host */
/* hostaddr overrides connhost */
if (hostaddr && *hostaddr)
printf(_("You are now connected to database \"%s\" as user \"%s\" on address \"%s\" at port \"%s\".\n"),
PQdb(pset.db), PQuser(pset.db), hostaddr, PQport(pset.db));
else
printf(_("You are now connected to database \"%s\" as user \"%s\" via socket in \"%s\" at port \"%s\".\n"),
PQdb(pset.db), PQuser(pset.db), host, PQport(pset.db));
PQdb(pset.db), PQuser(pset.db), connhost, PQport(pset.db));
}
else
{
if (hostaddr && *hostaddr && strcmp(host, hostaddr) != 0)
if (hostaddr && *hostaddr && strcmp(connhost, hostaddr) != 0)
printf(_("You are now connected to database \"%s\" as user \"%s\" on host \"%s\" (address \"%s\") at port \"%s\".\n"),
PQdb(pset.db), PQuser(pset.db), host, hostaddr, PQport(pset.db));
PQdb(pset.db), PQuser(pset.db), connhost, hostaddr, PQport(pset.db));
else
printf(_("You are now connected to database \"%s\" as user \"%s\" on host \"%s\" at port \"%s\".\n"),
PQdb(pset.db), PQuser(pset.db), host, PQport(pset.db));
PQdb(pset.db), PQuser(pset.db), connhost, PQport(pset.db));
}
}
else