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:
@ -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
|
||||
|
Reference in New Issue
Block a user