Skip to content

Commit fe8dd65

Browse files
committed
Mark misc static global variables as const
Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/54c29fb0-edf2-48ea-9814-44e918bbd6e8@iki.fi
1 parent 85829c9 commit fe8dd65

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

contrib/btree_gist/btree_interval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static const gbtree_ninfo tinfo =
113113
Interval *
114114
abs_interval(Interval *a)
115115
{
116-
static Interval zero = {0, 0, 0};
116+
static const Interval zero = {0, 0, 0};
117117

118118
if (DatumGetBool(DirectFunctionCall2(interval_lt,
119119
IntervalPGetDatum(a),

contrib/oid2name/oid2name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void sql_exec_dumpalltbspc(PGconn *conn, struct options *opts);
6262
void
6363
get_opts(int argc, char **argv, struct options *my_opts)
6464
{
65-
static struct option long_options[] = {
65+
static const struct option long_options[] = {
6666
{"dbname", required_argument, NULL, 'd'},
6767
{"host", required_argument, NULL, 'h'},
6868
{"host", required_argument, NULL, 'H'}, /* deprecated */

src/backend/access/transam/xlogprefetcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ XLogPrefetcher *
362362
XLogPrefetcherAllocate(XLogReaderState *reader)
363363
{
364364
XLogPrefetcher *prefetcher;
365-
static HASHCTL hash_table_ctl = {
365+
const HASHCTL hash_table_ctl = {
366366
.keysize = sizeof(RelFileLocator),
367367
.entrysize = sizeof(XLogPrefetcherFilter)
368368
};

src/common/sha1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#include "sha1_int.h"
6262

6363
/* constant table */
64-
static uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
64+
static const uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
6565

6666
#define K(t) _K[(t) / 20]
6767

src/pl/plpython/plpy_cursorobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static PyObject *PLy_cursor_iternext(PyObject *self);
2727
static PyObject *PLy_cursor_fetch(PyObject *self, PyObject *args);
2828
static PyObject *PLy_cursor_close(PyObject *self, PyObject *unused);
2929

30-
static char PLy_cursor_doc[] = "Wrapper around a PostgreSQL cursor";
30+
static const char PLy_cursor_doc[] = "Wrapper around a PostgreSQL cursor";
3131

3232
static PyMethodDef PLy_cursor_methods[] = {
3333
{"fetch", PLy_cursor_fetch, METH_VARARGS, NULL},

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy