summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDavid Rowley2026-04-23 04:49:29 +0000
committerDavid Rowley2026-04-23 04:49:29 +0000
commit4f0cbc6fb5df6dec84482d0bf0ff2d2d4be58132 (patch)
tree9ed180a8ff8c0ffa51fadbfc9eefb468075800ec /src/bin
parentdbf217c1c7c2744a18db489c255255e07cfbb110 (diff)
Fix new-to-v19 -Wshadow warnings
There's some talk about upgrading our current -Wshadow=compatible-local up to -Wshadow. There's some pending questions as to whether the churn and extra backpatching pain are worthwhile for doing all of them. We can't use the latter argument for ones that are new to v19, providing we fix them now. So let's fix those ones so that the problem is not any worse for if we decide to fix the remainder for v20. Author: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Yuchen Li <liyuchen_xyz@163.com> Discussion: https://postgr.es/m/CAApHDvp=rx5GxM=yW8QhFF3noXtYt7LkOxJ7zkaPOzpti4Gm8w@mail.gmail.com
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_dump/pg_dumpall.c26
-rw-r--r--src/bin/psql/describe.c12
2 files changed, 18 insertions, 20 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 9e904f76baa..c1f43113c53 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -83,7 +83,7 @@ static void buildShSecLabels(PGconn *conn,
PQExpBuffer buffer);
static void executeCommand(PGconn *conn, const char *query);
static void check_for_invalid_global_names(PGconn *conn,
- SimpleStringList *database_exclude_names);
+ SimpleStringList *excluded_names);
static void expand_dbname_patterns(PGconn *conn, SimpleStringList *patterns,
SimpleStringList *names);
static void read_dumpall_filters(const char *filename, SimpleStringList *pattern);
@@ -2269,7 +2269,7 @@ executeCommand(PGconn *conn, const char *query)
*/
static void
check_for_invalid_global_names(PGconn *conn,
- SimpleStringList *database_exclude_names)
+ SimpleStringList *excluded_names)
{
PGresult *res;
int i;
@@ -2296,7 +2296,7 @@ check_for_invalid_global_names(PGconn *conn,
/* Skip excluded databases since they won't be in map.dat */
if (strcmp(objtype, "database") == 0 &&
- simple_string_list_member(database_exclude_names, objname))
+ simple_string_list_member(excluded_names, objname))
continue;
if (strpbrk(objname, "\n\r"))
@@ -2406,29 +2406,27 @@ read_dumpall_filters(const char *filename, SimpleStringList *pattern)
static ArchiveFormat
parseDumpFormat(const char *format)
{
- ArchiveFormat archDumpFormat;
-
if (pg_strcasecmp(format, "c") == 0)
- archDumpFormat = archCustom;
+ return archCustom;
else if (pg_strcasecmp(format, "custom") == 0)
- archDumpFormat = archCustom;
+ return archCustom;
else if (pg_strcasecmp(format, "d") == 0)
- archDumpFormat = archDirectory;
+ return archDirectory;
else if (pg_strcasecmp(format, "directory") == 0)
- archDumpFormat = archDirectory;
+ return archDirectory;
else if (pg_strcasecmp(format, "p") == 0)
- archDumpFormat = archNull;
+ return archNull;
else if (pg_strcasecmp(format, "plain") == 0)
- archDumpFormat = archNull;
+ return archNull;
else if (pg_strcasecmp(format, "t") == 0)
- archDumpFormat = archTar;
+ return archTar;
else if (pg_strcasecmp(format, "tar") == 0)
- archDumpFormat = archTar;
+ return archTar;
else
pg_fatal("unrecognized output format \"%s\"; please specify \"c\", \"d\", \"p\", or \"t\"",
format);
- return archDumpFormat;
+ return archUnknown;
}
/*
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index dd1179ef927..4a1ab873260 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1938,7 +1938,7 @@ describeOneTableDetails(const char *schemaname,
*/
if (tableinfo.relkind == RELKIND_PROPGRAPH)
{
- printQueryOpt myopt = pset.popt;
+ printQueryOpt popt = pset.popt;
char *footers[3] = {NULL, NULL, NULL};
printfPQExpBuffer(&buf, "/* %s */\n", _("Get property graph information"));
@@ -1993,12 +1993,12 @@ describeOneTableDetails(const char *schemaname,
}
}
- myopt.footers = footers;
- myopt.topt.default_footer = false;
- myopt.title = title.data;
- myopt.translate_header = true;
+ popt.footers = footers;
+ popt.topt.default_footer = false;
+ popt.title = title.data;
+ popt.translate_header = true;
- printQuery(res, &myopt, pset.queryFout, false, pset.logfile);
+ printQuery(res, &popt, pset.queryFout, false, pset.logfile);
free(footers[0]);
free(footers[1]);