mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-21 03:13:05 +08:00
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
This commit is contained in:
parent
85829c973c
commit
fe8dd65bf2
@ -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),
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
};
|
||||
|
@ -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]
|
||||
|
||||
|
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user