summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2024-08-06 20:04:48 +0000
committerHeikki Linnakangas2024-08-06 20:04:48 +0000
commitfe8dd65bf28db1a6ad690ffcd5124d1863b5a4c6 (patch)
treebebe94fc30af8dcf35787e619febef093979c0ee
parent85829c973cb33592dbc0b0f3aaf9132f5dea6953 (diff)
Mark misc static global variables as const
Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/[email protected]
-rw-r--r--contrib/btree_gist/btree_interval.c2
-rw-r--r--contrib/oid2name/oid2name.c2
-rw-r--r--src/backend/access/transam/xlogprefetcher.c2
-rw-r--r--src/common/sha1.c2
-rw-r--r--src/pl/plpython/plpy_cursorobject.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c
index b0afdf02bb5..156f2cebac5 100644
--- a/contrib/btree_gist/btree_interval.c
+++ b/contrib/btree_gist/btree_interval.c
@@ -113,7 +113,7 @@ static const gbtree_ninfo tinfo =
Interval *
abs_interval(Interval *a)
{
- static Interval zero = {0, 0, 0};
+ static const Interval zero = {0, 0, 0};
if (DatumGetBool(DirectFunctionCall2(interval_lt,
IntervalPGetDatum(a),
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index e8c1e2c97bd..c2785848f55 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -62,7 +62,7 @@ void sql_exec_dumpalltbspc(PGconn *conn, struct options *opts);
void
get_opts(int argc, char **argv, struct options *my_opts)
{
- static struct option long_options[] = {
+ static const struct option long_options[] = {
{"dbname", required_argument, NULL, 'd'},
{"host", required_argument, NULL, 'h'},
{"host", required_argument, NULL, 'H'}, /* deprecated */
diff --git a/src/backend/access/transam/xlogprefetcher.c b/src/backend/access/transam/xlogprefetcher.c
index 84023d61baf..2dc2fb760a2 100644
--- a/src/backend/access/transam/xlogprefetcher.c
+++ b/src/backend/access/transam/xlogprefetcher.c
@@ -362,7 +362,7 @@ XLogPrefetcher *
XLogPrefetcherAllocate(XLogReaderState *reader)
{
XLogPrefetcher *prefetcher;
- static HASHCTL hash_table_ctl = {
+ const HASHCTL hash_table_ctl = {
.keysize = sizeof(RelFileLocator),
.entrysize = sizeof(XLogPrefetcherFilter)
};
diff --git a/src/common/sha1.c b/src/common/sha1.c
index 0525c4ff316..abfbd1c087d 100644
--- a/src/common/sha1.c
+++ b/src/common/sha1.c
@@ -61,7 +61,7 @@
#include "sha1_int.h"
/* constant table */
-static uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
+static const uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
#define K(t) _K[(t) / 20]
diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c
index 57e8f8ec217..24f2ac8c46b 100644
--- a/src/pl/plpython/plpy_cursorobject.c
+++ b/src/pl/plpython/plpy_cursorobject.c
@@ -27,7 +27,7 @@ static PyObject *PLy_cursor_iternext(PyObject *self);
static PyObject *PLy_cursor_fetch(PyObject *self, PyObject *args);
static PyObject *PLy_cursor_close(PyObject *self, PyObject *unused);
-static char PLy_cursor_doc[] = "Wrapper around a PostgreSQL cursor";
+static const char PLy_cursor_doc[] = "Wrapper around a PostgreSQL cursor";
static PyMethodDef PLy_cursor_methods[] = {
{"fetch", PLy_cursor_fetch, METH_VARARGS, NULL},