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

Commit64b7876

Browse files
committed
Add some const qualifiers
There was a mismatch between the const qualifiers forexcludeDirContents in src/backend/backup/basebackup.c andsrc/bin/pg_rewind/filemap.c, which led to a quick search for similarcases. We should make excludeDirContents match, but the rest of thechanges seem like a good idea as well.Author: David Steele <david@pgmasters.net>Discussion:https://www.postgresql.org/message-id/flat/669a035c-d23d-2f38-7ff0-0cb93e01d610@pgmasters.net
1 parenteddad67 commit64b7876

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

‎contrib/fuzzystrmatch/fuzzystrmatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void _soundex(const char *instr, char *outstr);
5555
#defineSOUNDEX_LEN 4
5656

5757
/*ABCDEFGHIJKLMNOPQRSTUVWXYZ */
58-
staticconstchar*soundex_table="01230120022455012623010202";
58+
staticconstchar*constsoundex_table="01230120022455012623010202";
5959

6060
staticchar
6161
soundex_code(charletter)

‎contrib/pgcrypto/pgp-armor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ pg_base64_dec_len(unsigned srclen)
178178
* PGP armor
179179
*/
180180

181-
staticconstchar*armor_header="-----BEGIN PGP MESSAGE-----\n";
182-
staticconstchar*armor_footer="\n-----END PGP MESSAGE-----\n";
181+
staticconstchar*constarmor_header="-----BEGIN PGP MESSAGE-----\n";
182+
staticconstchar*constarmor_footer="\n-----END PGP MESSAGE-----\n";
183183

184184
/* CRC24 implementation from rfc2440 */
185185
#defineCRC24_INIT 0x00b704ceL

‎src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static const FormData_pg_attribute a6 = {
228228
.attislocal= true,
229229
};
230230

231-
staticconstFormData_pg_attribute*SysAtt[]= {&a1,&a2,&a3,&a4,&a5,&a6};
231+
staticconstFormData_pg_attribute*constSysAtt[]= {&a1,&a2,&a3,&a4,&a5,&a6};
232232

233233
/*
234234
* This function returns a Form_pg_attribute pointer for a system attribute.

‎src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ typedef void (*rsv_callback) (Node *node, deparse_context *context,
316316
* ----------
317317
*/
318318
staticSPIPlanPtrplan_getrulebyoid=NULL;
319-
staticconstchar*query_getrulebyoid="SELECT * FROM pg_catalog.pg_rewrite WHERE oid = $1";
319+
staticconstchar*constquery_getrulebyoid="SELECT * FROM pg_catalog.pg_rewrite WHERE oid = $1";
320320
staticSPIPlanPtrplan_getviewrule=NULL;
321-
staticconstchar*query_getviewrule="SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2";
321+
staticconstchar*constquery_getviewrule="SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2";
322322

323323
/* GUC parameters */
324324
boolquote_all_identifiers= false;

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ typedef struct
112112
#error XLOG_BLCKSZ must be between 1KB and 1MB
113113
#endif
114114

115-
staticconstchar*memory_units_hint=gettext_noop("Valid units for this parameter are \"B\", \"kB\", \"MB\", \"GB\", and \"TB\".");
115+
staticconstchar*constmemory_units_hint=gettext_noop("Valid units for this parameter are \"B\", \"kB\", \"MB\", \"GB\", and \"TB\".");
116116

117117
staticconstunit_conversionmemory_unit_conversion_table[]=
118118
{
@@ -149,7 +149,7 @@ static const unit_conversion memory_unit_conversion_table[] =
149149
{""}/* end of table marker */
150150
};
151151

152-
staticconstchar*time_units_hint=gettext_noop("Valid units for this parameter are \"us\", \"ms\", \"s\", \"min\", \"h\", and \"d\".");
152+
staticconstchar*consttime_units_hint=gettext_noop("Valid units for this parameter are \"us\", \"ms\", \"s\", \"min\", \"h\", and \"d\".");
153153

154154
staticconstunit_conversiontime_unit_conversion_table[]=
155155
{

‎src/bin/initdb/initdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ static bool authwarning = false;
218218
* but here it is more convenient to pass it as an environment variable
219219
* (no quoting to worry about).
220220
*/
221-
staticconstchar*boot_options="-F -c log_checkpoints=false";
222-
staticconstchar*backend_options="--single -F -O -j -c search_path=pg_catalog -c exit_on_error=true -c log_checkpoints=false";
221+
staticconstchar*constboot_options="-F -c log_checkpoints=false";
222+
staticconstchar*constbackend_options="--single -F -O -j -c search_path=pg_catalog -c exit_on_error=true -c log_checkpoints=false";
223223

224224
/* Additional switches to pass to backend (either boot or standalone) */
225225
staticchar*extra_options="";

‎src/bin/pg_amcheck/pg_amcheck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ typedef struct RelationInfo
166166
* Query for determining if contrib's amcheck is installed. If so, selects the
167167
* namespace name where amcheck's functions can be found.
168168
*/
169-
staticconstchar*amcheck_sql=
169+
staticconstchar*constamcheck_sql=
170170
"SELECT n.nspname, x.extversion FROM pg_catalog.pg_extension x"
171171
"\nJOIN pg_catalog.pg_namespace n ON x.extnamespace = n.oid"
172172
"\nWHERE x.extname = 'amcheck'";

‎src/bin/pg_rewind/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct exclude_list_item
8585
* they are defined in backend-only headers. So this list is maintained
8686
* with a best effort in mind.
8787
*/
88-
staticconstchar*excludeDirContents[]=
88+
staticconstchar*constexcludeDirContents[]=
8989
{
9090
/*
9191
* Skip temporary statistics files. PG_STAT_TMP_DIR must be skipped

‎src/bin/pg_rewind/parsexlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#definePG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask,decode) \
3232
name,
3333

34-
staticconstchar*RmgrNames[RM_MAX_ID+1]= {
34+
staticconstchar*constRmgrNames[RM_MAX_ID+1]= {
3535
#include"access/rmgrlist.h"
3636
};
3737

‎src/bin/pgbench/pgbench.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ typedef enum
231231
}partition_method_t;
232232

233233
staticpartition_method_tpartition_method=PART_NONE;
234-
staticconstchar*PARTITION_METHOD[]= {"none","range","hash"};
234+
staticconstchar*constPARTITION_METHOD[]= {"none","range","hash"};
235235

236236
/* random seed used to initialize base_random_sequence */
237237
int64random_seed=-1;
@@ -709,7 +709,7 @@ typedef enum QueryMode
709709
}QueryMode;
710710

711711
staticQueryModequerymode=QUERY_SIMPLE;
712-
staticconstchar*QUERYMODE[]= {"simple","extended","prepared"};
712+
staticconstchar*constQUERYMODE[]= {"simple","extended","prepared"};
713713

714714
/*
715715
* struct Command represents one command in a script.

‎src/interfaces/libpq/pqexpbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
staticconstcharoom_buffer[1]="";
3939

4040
/* Need a char * for unconstify() compatibility */
41-
staticconstchar*oom_buffer_ptr=oom_buffer;
41+
staticconstchar*constoom_buffer_ptr=oom_buffer;
4242

4343

4444
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp