Content-Length: 820174 | pFad | https://github.com/postgrespro/postgres/commit/720b0eaae9b8a8326b2b6a6ff88fca4f47c631d4

71 Convert some extern variables to static · postgrespro/postgres@720b0ea · GitHub
Skip to content

Commit 720b0ea

Browse files
committed
Convert some extern variables to static
These probably should have been static all along, it was only forgotten out of sloppiness. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
1 parent a4c87df commit 720b0ea

File tree

29 files changed

+99
-96
lines changed

29 files changed

+99
-96
lines changed

contrib/isn/EAN13.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
/* where the digit set begins, and how many of them are in the table */
14-
const unsigned EAN13_index[10][2] = {
14+
static const unsigned EAN13_index[10][2] = {
1515
{0, 6},
1616
{6, 1},
1717
{7, 1},
@@ -23,7 +23,7 @@ const unsigned EAN13_index[10][2] = {
2323
{90, 17},
2424
{107, 12},
2525
};
26-
const char *EAN13_range[][2] = {
26+
static const char *EAN13_range[][2] = {
2727
{"000", "019"}, /* GS1 US */
2828
{"020", "029"}, /* Restricted distribution (MO defined) */
2929
{"030", "039"}, /* GS1 US */

contrib/isn/ISBN.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535

3636
/* where the digit set begins, and how many of them are in the table */
37-
const unsigned ISBN_index[10][2] = {
37+
static const unsigned ISBN_index[10][2] = {
3838
{0, 6},
3939
{6, 6},
4040
{12, 8},
@@ -47,7 +47,7 @@ const unsigned ISBN_index[10][2] = {
4747
{192, 718},
4848
};
4949

50-
const char *ISBN_range[][2] = {
50+
static const char *ISBN_range[][2] = {
5151
{"0-00", "0-19"},
5252
{"0-200", "0-699"},
5353
{"0-7000", "0-8499"},
@@ -967,7 +967,7 @@ const char *ISBN_range[][2] = {
967967
*/
968968

969969
/* where the digit set begins, and how many of them are in the table */
970-
const unsigned ISBN_index_new[10][2] = {
970+
static const unsigned ISBN_index_new[10][2] = {
971971
{0, 0},
972972
{0, 5},
973973
{5, 0},
@@ -980,7 +980,7 @@ const unsigned ISBN_index_new[10][2] = {
980980
{5, 0},
981981
};
982982

983-
const char *ISBN_range_new[][2] = {
983+
static const char *ISBN_range_new[][2] = {
984984
{"10-00", "10-19"},
985985
{"10-200", "10-699"},
986986
{"10-7000", "10-8999"},

contrib/isn/ISMN.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131

3232
/* where the digit set begins, and how many of them are in the table */
33-
const unsigned ISMN_index[10][2] = {
33+
static const unsigned ISMN_index[10][2] = {
3434
{0, 5},
3535
{5, 0},
3636
{5, 0},
@@ -42,7 +42,7 @@ const unsigned ISMN_index[10][2] = {
4242
{5, 0},
4343
{5, 0},
4444
};
45-
const char *ISMN_range[][2] = {
45+
static const char *ISMN_range[][2] = {
4646
{"0-000", "0-099"},
4747
{"0-1000", "0-3999"},
4848
{"0-40000", "0-69999"},

contrib/isn/ISSN.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232

3333
/* where the digit set begins, and how many of them are in the table */
34-
const unsigned ISSN_index[10][2] = {
34+
static const unsigned ISSN_index[10][2] = {
3535
{0, 1},
3636
{0, 1},
3737
{0, 1},
@@ -43,7 +43,7 @@ const unsigned ISSN_index[10][2] = {
4343
{0, 1},
4444
{0, 1},
4545
};
46-
const char *ISSN_range[][2] = {
46+
static const char *ISSN_range[][2] = {
4747
{"0000-000", "9999-999"},
4848
{NULL, NULL}
4949
};

contrib/isn/UPC.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
/* where the digit set begins, and how many of them are in the table */
14-
const unsigned UPC_index[10][2] = {
14+
static const unsigned UPC_index[10][2] = {
1515
{0, 0},
1616
{0, 0},
1717
{0, 0},
@@ -23,6 +23,6 @@ const unsigned UPC_index[10][2] = {
2323
{0, 0},
2424
{0, 0},
2525
};
26-
const char *UPC_range[][2] = {
26+
static const char *UPC_range[][2] = {
2727
{NULL, NULL}
2828
};

src/backend/commands/user.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ typedef struct
8484
/* GUC parameters */
8585
int Password_encryption = PASSWORD_TYPE_SCRAM_SHA_256;
8686
char *createrole_self_grant = "";
87-
bool createrole_self_grant_enabled = false;
88-
GrantRoleOptions createrole_self_grant_options;
87+
static bool createrole_self_grant_enabled = false;
88+
static GrantRoleOptions createrole_self_grant_options;
8989

9090
/* Hook to check passwords in CreateRole() and AlterRole() */
9191
check_password_hook_type check_password_hook = NULL;

src/backend/postmaster/launch_backend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ typedef struct
176176
bool shmem_attach;
177177
} child_process_kind;
178178

179-
child_process_kind child_process_kinds[] = {
179+
static child_process_kind child_process_kinds[] = {
180180
[B_INVALID] = {"invalid", NULL, false},
181181

182182
[B_BACKEND] = {"backend", BackendMain, true},

src/backend/replication/logical/slotsync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ typedef struct SlotSyncCtxStruct
103103
slock_t mutex;
104104
} SlotSyncCtxStruct;
105105

106-
SlotSyncCtxStruct *SlotSyncCtx = NULL;
106+
static SlotSyncCtxStruct *SlotSyncCtx = NULL;
107107

108108
/* GUC variable */
109109
bool sync_replication_slots = false;

src/backend/replication/logical/worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ typedef enum
275275
} TransApplyAction;
276276

277277
/* errcontext tracker */
278-
ApplyErrorCallbackArg apply_error_callback_arg =
278+
static ApplyErrorCallbackArg apply_error_callback_arg =
279279
{
280280
.command = 0,
281281
.rel = NULL,

src/backend/utils/misc/guc_tables.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ bool check_function_bodies = true;
517517
* This GUC exists solely for backward compatibility, check its definition for
518518
* details.
519519
*/
520-
bool default_with_oids = false;
520+
static bool default_with_oids = false;
521+
521522
bool current_role_is_superuser;
522523

523524
int log_min_error_statement = ERROR;
@@ -555,15 +556,15 @@ int tcp_user_timeout;
555556
* This avoids breaking compatibility with clients that have never supported
556557
* renegotiation and therefore always try to zero it.
557558
*/
558-
int ssl_renegotiation_limit;
559+
static int ssl_renegotiation_limit;
559560

560561
/*
561562
* This really belongs in pg_shmem.c, but is defined here so that it doesn't
562563
* need to be duplicated in all the different implementations of pg_shmem.c.
563564
*/
564565
int huge_pages = HUGE_PAGES_TRY;
565566
int huge_page_size;
566-
int huge_pages_status = HUGE_PAGES_UNKNOWN;
567+
static int huge_pages_status = HUGE_PAGES_UNKNOWN;
567568

568569
/*
569570
* These variables are all dummies that don't do anything, except in some

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/720b0eaae9b8a8326b2b6a6ff88fca4f47c631d4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy