Skip to content

Commit 66c04c9

Browse files
committed
Mark some more variables as static or include the appropriate header
Detected by clang's -Wmissing-variable-declarations. From: Andres Freund <andres@anarazel.de>
1 parent 6aa2bdf commit 66c04c9

File tree

8 files changed

+8
-7
lines changed

8 files changed

+8
-7
lines changed

src/backend/commands/event_trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typedef struct EventTriggerQueryState
5151
struct EventTriggerQueryState *previous;
5252
} EventTriggerQueryState;
5353

54-
EventTriggerQueryState *currentEventTriggerState = NULL;
54+
static EventTriggerQueryState *currentEventTriggerState = NULL;
5555

5656
typedef struct
5757
{

src/backend/postmaster/bgworker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct BackgroundWorkerHandle
9090
uint64 generation;
9191
};
9292

93-
BackgroundWorkerArray *BackgroundWorkerData;
93+
static BackgroundWorkerArray *BackgroundWorkerData;
9494

9595
/*
9696
* Calculate shared memory needed.

src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ bool enable_bonjour = false;
237237
char *bonjour_name;
238238
bool restart_after_crash = true;
239239

240-
char *output_config_variable = NULL;
241-
242240
/* PIDs of special child processes; 0 when not running */
243241
static pid_t StartupPID = 0,
244242
BgWriterPID = 0,
@@ -545,6 +543,7 @@ PostmasterMain(int argc, char *argv[])
545543
char *userDoption = NULL;
546544
bool listen_addr_saved = false;
547545
int i;
546+
char *output_config_variable = NULL;
548547

549548
MyProcPid = PostmasterPid = getpid();
550549

src/backend/storage/lmgr/s_lock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <unistd.h>
2020

2121
#include "storage/s_lock.h"
22+
#include "storage/barrier.h"
2223

2324
slock_t dummy_spinlock;
2425

src/backend/utils/init/globals.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
#include "postgres.h"
2020

21+
#include "libpq/libpq-be.h"
2122
#include "libpq/pqcomm.h"
2223
#include "miscadmin.h"
2324
#include "storage/backendid.h"

src/bin/initdb/initdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static const char *backend_options = "--single -F -O -c search_path=pg_catalog -
180180
#ifdef WIN32
181181
char *restrict_env;
182182
#endif
183-
const char *subdirs[] = {
183+
static const char *subdirs[] = {
184184
"global",
185185
"pg_xlog",
186186
"pg_xlog/archive_status",

src/include/storage/pg_shmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ typedef enum
4949
HUGE_TLB_TRY
5050
} HugeTlbType;
5151

52-
#ifdef EXEC_BACKEND
5352
#ifndef WIN32
5453
extern unsigned long UsedShmemSegID;
5554
#else
5655
extern HANDLE UsedShmemSegID;
5756
#endif
5857
extern void *UsedShmemSegAddr;
5958

59+
#ifdef EXEC_BACKEND
6060
extern void PGSharedMemoryReAttach(void);
6161
#endif
6262

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static bool isdefine(void);
5656
static bool isinformixdefine(void);
5757

5858
char *token_start;
59-
int state_before;
59+
static int state_before;
6060

6161
struct _yy_buffer
6262
{

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