1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

Correct constness of a few variables.

This allows the compiler / linker to mark affected pages as read-only.

There's other cases, but they're a bit more invasive, and should go
through some review. These are easy.

They were found with
objdump -j .data -t src/backend/postgres|awk '{print $4, $5, $6}'|sort -r|less

Discussion: https://postgr.es/m/20181015200754.7y7zfuzsoux2c4ya@alap3.anarazel.de
This commit is contained in:
Andres Freund
2018-10-15 20:45:30 -07:00
parent c5257345ef
commit 62649bad83
9 changed files with 15 additions and 15 deletions

View File

@@ -560,7 +560,7 @@ struct ConnectionOption
*
* The list is small - don't bother with bsearch if it stays so.
*/
static struct ConnectionOption libpq_conninfo_options[] = {
static const struct ConnectionOption libpq_conninfo_options[] = {
{"authtype", ForeignServerRelationId},
{"service", ForeignServerRelationId},
{"user", UserMappingRelationId},
@@ -587,7 +587,7 @@ static struct ConnectionOption libpq_conninfo_options[] = {
static bool
is_conninfo_option(const char *option, Oid context)
{
struct ConnectionOption *opt;
const struct ConnectionOption *opt;
for (opt = libpq_conninfo_options; opt->optname; opt++)
if (context == opt->optcontext && strcmp(opt->optname, option) == 0)
@@ -622,7 +622,7 @@ postgresql_fdw_validator(PG_FUNCTION_ARGS)
if (!is_conninfo_option(def->defname, catalog))
{
struct ConnectionOption *opt;
const struct ConnectionOption *opt;
StringInfoData buf;
/*