Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit720b0ea

Browse files
committed
Convert some extern variables to static
These probably should have been static all along, it was onlyforgotten 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 parenta4c87df commit720b0ea

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-
constunsignedEAN13_index[10][2]= {
14+
staticconstunsignedEAN13_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-
constchar*EAN13_range[][2]= {
26+
staticconstchar*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-
constunsignedISBN_index[10][2]= {
37+
staticconstunsignedISBN_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-
constchar*ISBN_range[][2]= {
50+
staticconstchar*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-
constunsignedISBN_index_new[10][2]= {
970+
staticconstunsignedISBN_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-
constchar*ISBN_range_new[][2]= {
983+
staticconstchar*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-
constunsignedISMN_index[10][2]= {
33+
staticconstunsignedISMN_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-
constchar*ISMN_range[][2]= {
45+
staticconstchar*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-
constunsignedISSN_index[10][2]= {
34+
staticconstunsignedISSN_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-
constchar*ISSN_range[][2]= {
46+
staticconstchar*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-
constunsignedUPC_index[10][2]= {
14+
staticconstunsignedUPC_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-
constchar*UPC_range[][2]= {
26+
staticconstchar*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
intPassword_encryption=PASSWORD_TYPE_SCRAM_SHA_256;
8686
char*createrole_self_grant="";
87-
boolcreaterole_self_grant_enabled= false;
88-
GrantRoleOptionscreaterole_self_grant_options;
87+
staticboolcreaterole_self_grant_enabled= false;
88+
staticGrantRoleOptionscreaterole_self_grant_options;
8989

9090
/* Hook to check passwords in CreateRole() and AlterRole() */
9191
check_password_hook_typecheck_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
boolshmem_attach;
177177
}child_process_kind;
178178

179-
child_process_kindchild_process_kinds[]= {
179+
staticchild_process_kindchild_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_tmutex;
104104
}SlotSyncCtxStruct;
105105

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

108108
/* GUC variable */
109109
boolsync_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-
ApplyErrorCallbackArgapply_error_callback_arg=
278+
staticApplyErrorCallbackArgapply_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 @@ boolcheck_function_bodies = true;
517517
* This GUC exists solely for backward compatibility, check its definition for
518518
* details.
519519
*/
520-
booldefault_with_oids= false;
520+
staticbooldefault_with_oids= false;
521+
521522
boolcurrent_role_is_superuser;
522523

523524
intlog_min_error_statement=ERROR;
@@ -555,15 +556,15 @@ inttcp_user_timeout;
555556
* This avoids breaking compatibility with clients that have never supported
556557
* renegotiation and therefore always try to zero it.
557558
*/
558-
intssl_renegotiation_limit;
559+
staticintssl_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
inthuge_pages=HUGE_PAGES_TRY;
565566
inthuge_page_size;
566-
inthuge_pages_status=HUGE_PAGES_UNKNOWN;
567+
staticinthuge_pages_status=HUGE_PAGES_UNKNOWN;
567568

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

‎src/bin/pg_archivecleanup/pg_archivecleanup.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@
1919
#include"common/logging.h"
2020
#include"getopt_long.h"
2121

22-
constchar*progname;
22+
staticconstchar*progname;
2323

2424
/* Options and defaults */
25-
booldryrun= false;/* are we performing a dry-run operation? */
26-
boolcleanBackupHistory= false;/* remove files including backup
25+
staticbooldryrun= false;/* are we performing a dry-run operation? */
26+
staticboolcleanBackupHistory= false;/* remove files including backup
2727
* history files */
28-
char*additional_ext=NULL;/* Extension to remove from filenames */
28+
staticchar*additional_ext=NULL;/* Extension to remove from filenames */
2929

30-
char*archiveLocation;/* where to find the archive? */
31-
char*restartWALFileName;/* the file from which we can restart restore */
32-
charexclusiveCleanupFileName[MAXFNAMELEN];/* the oldest file we want
30+
staticchar*archiveLocation;/* where to find the archive? */
31+
staticchar*restartWALFileName;/* the file from which we can restart
32+
* restore */
33+
staticcharexclusiveCleanupFileName[MAXFNAMELEN];/* the oldest file we want
3334
* to remain in archive */
3435

3536

‎src/bin/pg_basebackup/bbstreamer_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void bbstreamer_plain_writer_content(bbstreamer *streamer,
4343
staticvoidbbstreamer_plain_writer_finalize(bbstreamer*streamer);
4444
staticvoidbbstreamer_plain_writer_free(bbstreamer*streamer);
4545

46-
constbbstreamer_opsbbstreamer_plain_writer_ops= {
46+
staticconstbbstreamer_opsbbstreamer_plain_writer_ops= {
4747
.content=bbstreamer_plain_writer_content,
4848
.finalize=bbstreamer_plain_writer_finalize,
4949
.free=bbstreamer_plain_writer_free
@@ -59,7 +59,7 @@ static void extract_directory(const char *filename, mode_t mode);
5959
staticvoidextract_link(constchar*filename,constchar*linktarget);
6060
staticFILE*create_file_for_extract(constchar*filename,mode_tmode);
6161

62-
constbbstreamer_opsbbstreamer_extractor_ops= {
62+
staticconstbbstreamer_opsbbstreamer_extractor_ops= {
6363
.content=bbstreamer_extractor_content,
6464
.finalize=bbstreamer_extractor_finalize,
6565
.free=bbstreamer_extractor_free

‎src/bin/pg_basebackup/bbstreamer_gzip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void bbstreamer_gzip_writer_finalize(bbstreamer *streamer);
4545
staticvoidbbstreamer_gzip_writer_free(bbstreamer*streamer);
4646
staticconstchar*get_gz_error(gzFilegzf);
4747

48-
constbbstreamer_opsbbstreamer_gzip_writer_ops= {
48+
staticconstbbstreamer_opsbbstreamer_gzip_writer_ops= {
4949
.content=bbstreamer_gzip_writer_content,
5050
.finalize=bbstreamer_gzip_writer_finalize,
5151
.free=bbstreamer_gzip_writer_free
@@ -60,7 +60,7 @@ static void bbstreamer_gzip_decompressor_free(bbstreamer *streamer);
6060
staticvoid*gzip_palloc(void*opaque,unsigneditems,unsignedsize);
6161
staticvoidgzip_pfree(void*opaque,void*address);
6262

63-
constbbstreamer_opsbbstreamer_gzip_decompressor_ops= {
63+
staticconstbbstreamer_opsbbstreamer_gzip_decompressor_ops= {
6464
.content=bbstreamer_gzip_decompressor_content,
6565
.finalize=bbstreamer_gzip_decompressor_finalize,
6666
.free=bbstreamer_gzip_decompressor_free

‎src/bin/pg_basebackup/bbstreamer_inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void bbstreamer_recovery_injector_content(bbstreamer *streamer,
3333
staticvoidbbstreamer_recovery_injector_finalize(bbstreamer*streamer);
3434
staticvoidbbstreamer_recovery_injector_free(bbstreamer*streamer);
3535

36-
constbbstreamer_opsbbstreamer_recovery_injector_ops= {
36+
staticconstbbstreamer_opsbbstreamer_recovery_injector_ops= {
3737
.content=bbstreamer_recovery_injector_content,
3838
.finalize=bbstreamer_recovery_injector_finalize,
3939
.free=bbstreamer_recovery_injector_free

‎src/bin/pg_basebackup/bbstreamer_lz4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void bbstreamer_lz4_compressor_content(bbstreamer *streamer,
4242
staticvoidbbstreamer_lz4_compressor_finalize(bbstreamer*streamer);
4343
staticvoidbbstreamer_lz4_compressor_free(bbstreamer*streamer);
4444

45-
constbbstreamer_opsbbstreamer_lz4_compressor_ops= {
45+
staticconstbbstreamer_opsbbstreamer_lz4_compressor_ops= {
4646
.content=bbstreamer_lz4_compressor_content,
4747
.finalize=bbstreamer_lz4_compressor_finalize,
4848
.free=bbstreamer_lz4_compressor_free
@@ -55,7 +55,7 @@ static void bbstreamer_lz4_decompressor_content(bbstreamer *streamer,
5555
staticvoidbbstreamer_lz4_decompressor_finalize(bbstreamer*streamer);
5656
staticvoidbbstreamer_lz4_decompressor_free(bbstreamer*streamer);
5757

58-
constbbstreamer_opsbbstreamer_lz4_decompressor_ops= {
58+
staticconstbbstreamer_opsbbstreamer_lz4_decompressor_ops= {
5959
.content=bbstreamer_lz4_decompressor_content,
6060
.finalize=bbstreamer_lz4_decompressor_finalize,
6161
.free=bbstreamer_lz4_decompressor_free

‎src/bin/pg_basebackup/bbstreamer_tar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void bbstreamer_tar_parser_finalize(bbstreamer *streamer);
5050
staticvoidbbstreamer_tar_parser_free(bbstreamer*streamer);
5151
staticboolbbstreamer_tar_header(bbstreamer_tar_parser*mystreamer);
5252

53-
constbbstreamer_opsbbstreamer_tar_parser_ops= {
53+
staticconstbbstreamer_opsbbstreamer_tar_parser_ops= {
5454
.content=bbstreamer_tar_parser_content,
5555
.finalize=bbstreamer_tar_parser_finalize,
5656
.free=bbstreamer_tar_parser_free
@@ -63,7 +63,7 @@ static void bbstreamer_tar_archiver_content(bbstreamer *streamer,
6363
staticvoidbbstreamer_tar_archiver_finalize(bbstreamer*streamer);
6464
staticvoidbbstreamer_tar_archiver_free(bbstreamer*streamer);
6565

66-
constbbstreamer_opsbbstreamer_tar_archiver_ops= {
66+
staticconstbbstreamer_opsbbstreamer_tar_archiver_ops= {
6767
.content=bbstreamer_tar_archiver_content,
6868
.finalize=bbstreamer_tar_archiver_finalize,
6969
.free=bbstreamer_tar_archiver_free
@@ -76,7 +76,7 @@ static void bbstreamer_tar_terminator_content(bbstreamer *streamer,
7676
staticvoidbbstreamer_tar_terminator_finalize(bbstreamer*streamer);
7777
staticvoidbbstreamer_tar_terminator_free(bbstreamer*streamer);
7878

79-
constbbstreamer_opsbbstreamer_tar_terminator_ops= {
79+
staticconstbbstreamer_opsbbstreamer_tar_terminator_ops= {
8080
.content=bbstreamer_tar_terminator_content,
8181
.finalize=bbstreamer_tar_terminator_finalize,
8282
.free=bbstreamer_tar_terminator_free

‎src/bin/pg_basebackup/bbstreamer_zstd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void bbstreamer_zstd_compressor_content(bbstreamer *streamer,
3838
staticvoidbbstreamer_zstd_compressor_finalize(bbstreamer*streamer);
3939
staticvoidbbstreamer_zstd_compressor_free(bbstreamer*streamer);
4040

41-
constbbstreamer_opsbbstreamer_zstd_compressor_ops= {
41+
staticconstbbstreamer_opsbbstreamer_zstd_compressor_ops= {
4242
.content=bbstreamer_zstd_compressor_content,
4343
.finalize=bbstreamer_zstd_compressor_finalize,
4444
.free=bbstreamer_zstd_compressor_free
@@ -51,7 +51,7 @@ static void bbstreamer_zstd_decompressor_content(bbstreamer *streamer,
5151
staticvoidbbstreamer_zstd_decompressor_finalize(bbstreamer*streamer);
5252
staticvoidbbstreamer_zstd_decompressor_free(bbstreamer*streamer);
5353

54-
constbbstreamer_opsbbstreamer_zstd_decompressor_ops= {
54+
staticconstbbstreamer_opsbbstreamer_zstd_decompressor_ops= {
5555
.content=bbstreamer_zstd_decompressor_content,
5656
.finalize=bbstreamer_zstd_decompressor_finalize,
5757
.free=bbstreamer_zstd_decompressor_free

‎src/bin/pg_basebackup/walmethods.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static intdir_sync(Walfile *f);
5555
staticbooldir_finish(WalWriteMethod*wwmethod);
5656
staticvoiddir_free(WalWriteMethod*wwmethod);
5757

58-
constWalWriteMethodOpsWalDirectoryMethodOps= {
58+
staticconstWalWriteMethodOpsWalDirectoryMethodOps= {
5959
.open_for_write=dir_open_for_write,
6060
.close=dir_close,
6161
.existsfile=dir_existsfile,
@@ -676,7 +676,7 @@ static inttar_sync(Walfile *f);
676676
staticbooltar_finish(WalWriteMethod*wwmethod);
677677
staticvoidtar_free(WalWriteMethod*wwmethod);
678678

679-
constWalWriteMethodOpsWalTarMethodOps= {
679+
staticconstWalWriteMethodOpsWalTarMethodOps= {
680680
.open_for_write=tar_open_for_write,
681681
.close=tar_close,
682682
.existsfile=tar_existsfile,

‎src/bin/pg_checksums/pg_checksums.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ static const char *progname;
6060
/*
6161
* Progress status information.
6262
*/
63-
int64total_size=0;
64-
int64current_size=0;
63+
staticint64total_size=0;
64+
staticint64current_size=0;
6565
staticpg_time_tlast_progress_report=0;
6666

6767
staticvoid

‎src/bin/pg_combinebackup/pg_combinebackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ typedef struct cb_tablespace
9797
}cb_tablespace;
9898

9999
/* Directories to be removed if we exit uncleanly. */
100-
cb_cleanup_dir*cleanup_dir_list=NULL;
100+
staticcb_cleanup_dir*cleanup_dir_list=NULL;
101101

102102
staticvoidadd_tablespace_mapping(cb_options*opt,char*arg);
103103
staticStringInfocheck_backup_label_files(intn_backups,char**backup_dirs);

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,21 @@ static ControlFileData ControlFile_target;
6060
staticControlFileDataControlFile_source;
6161
staticControlFileDataControlFile_source_after;
6262

63-
constchar*progname;
63+
staticconstchar*progname;
6464
intWalSegSz;
6565

6666
/* Configuration options */
6767
char*datadir_target=NULL;
68-
char*datadir_source=NULL;
69-
char*connstr_source=NULL;
70-
char*restore_command=NULL;
71-
char*config_file=NULL;
68+
staticchar*datadir_source=NULL;
69+
staticchar*connstr_source=NULL;
70+
staticchar*restore_command=NULL;
71+
staticchar*config_file=NULL;
7272

7373
staticbooldebug= false;
7474
boolshowprogress= false;
7575
booldry_run= false;
7676
booldo_sync= true;
77-
boolrestore_wal= false;
77+
staticboolrestore_wal= false;
7878
DataDirSyncMethodsync_method=DATA_DIR_SYNC_METHOD_FSYNC;
7979

8080
/* Target history */

‎src/bin/pg_test_timing/pg_test_timing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static uint64 test_timing(unsigned int duration);
2020
staticvoidoutput(uint64loop_count);
2121

2222
/* record duration in powers of 2 microseconds */
23-
long longinthistogram[32];
23+
staticlong longinthistogram[32];
2424

2525
int
2626
main(intargc,char*argv[])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp