@@ -261,15 +261,15 @@ static bool assignable_custom_variable_name(const char *name, bool skip_errors,
261261 int elevel );
262262static void do_serialize (char * * destptr , Size * maxbytes ,
263263 const char * fmt ,...) pg_attribute_printf (3 , 4 );
264- static bool call_bool_check_hook (struct config_bool * conf , bool * newval ,
264+ static bool call_bool_check_hook (const struct config_bool * conf , bool * newval ,
265265 void * * extra , GucSource source , int elevel );
266- static bool call_int_check_hook (struct config_int * conf , int * newval ,
266+ static bool call_int_check_hook (const struct config_int * conf , int * newval ,
267267 void * * extra , GucSource source , int elevel );
268- static bool call_real_check_hook (struct config_real * conf , double * newval ,
268+ static bool call_real_check_hook (const struct config_real * conf , double * newval ,
269269 void * * extra , GucSource source , int elevel );
270- static bool call_string_check_hook (struct config_string * conf , char * * newval ,
270+ static bool call_string_check_hook (const struct config_string * conf , char * * newval ,
271271 void * * extra , GucSource source , int elevel );
272- static bool call_enum_check_hook (struct config_enum * conf , int * newval ,
272+ static bool call_enum_check_hook (const struct config_enum * conf , int * newval ,
273273 void * * extra , GucSource source , int elevel );
274274
275275
@@ -1425,14 +1425,14 @@ check_GUC_name_for_parameter_acl(const char *name)
14251425 */
14261426#ifdef USE_ASSERT_CHECKING
14271427static bool
1428- check_GUC_init (struct config_generic * gconf )
1428+ check_GUC_init (const struct config_generic * gconf )
14291429{
14301430 /* Checks on values */
14311431 switch (gconf -> vartype )
14321432 {
14331433 case PGC_BOOL :
14341434 {
1435- struct config_bool * conf = (struct config_bool * ) gconf ;
1435+ const struct config_bool * conf = (const struct config_bool * ) gconf ;
14361436
14371437 if (* conf -> variable && !conf -> boot_val )
14381438 {
@@ -1444,7 +1444,7 @@ check_GUC_init(struct config_generic *gconf)
14441444 }
14451445 case PGC_INT :
14461446 {
1447- struct config_int * conf = (struct config_int * ) gconf ;
1447+ const struct config_int * conf = (const struct config_int * ) gconf ;
14481448
14491449 if (* conf -> variable != 0 && * conf -> variable != conf -> boot_val )
14501450 {
@@ -1456,7 +1456,7 @@ check_GUC_init(struct config_generic *gconf)
14561456 }
14571457 case PGC_REAL :
14581458 {
1459- struct config_real * conf = (struct config_real * ) gconf ;
1459+ const struct config_real * conf = (const struct config_real * ) gconf ;
14601460
14611461 if (* conf -> variable != 0.0 && * conf -> variable != conf -> boot_val )
14621462 {
@@ -1468,7 +1468,7 @@ check_GUC_init(struct config_generic *gconf)
14681468 }
14691469 case PGC_STRING :
14701470 {
1471- struct config_string * conf = (struct config_string * ) gconf ;
1471+ const struct config_string * conf = (const struct config_string * ) gconf ;
14721472
14731473 if (* conf -> variable != NULL &&
14741474 (conf -> boot_val == NULL ||
@@ -1482,7 +1482,7 @@ check_GUC_init(struct config_generic *gconf)
14821482 }
14831483 case PGC_ENUM :
14841484 {
1485- struct config_enum * conf = (struct config_enum * ) gconf ;
1485+ const struct config_enum * conf = (const struct config_enum * ) gconf ;
14861486
14871487 if (* conf -> variable != conf -> boot_val )
14881488 {
@@ -3013,7 +3013,7 @@ parse_real(const char *value, double *result, int flags, const char **hintmsg)
30133013 * allocated for modification.
30143014 */
30153015const char *
3016- config_enum_lookup_by_value (struct config_enum * record , int val )
3016+ config_enum_lookup_by_value (const struct config_enum * record , int val )
30173017{
30183018 for (const struct config_enum_entry * entry = record -> options ; entry && entry -> name ; entry ++ )
30193019 {
@@ -3034,7 +3034,7 @@ config_enum_lookup_by_value(struct config_enum *record, int val)
30343034 * true. If it's not found, return false and retval is set to 0.
30353035 */
30363036bool
3037- config_enum_lookup_by_name (struct config_enum * record , const char * value ,
3037+ config_enum_lookup_by_name (const struct config_enum * record , const char * value ,
30383038 int * retval )
30393039{
30403040 for (const struct config_enum_entry * entry = record -> options ; entry && entry -> name ; entry ++ )
@@ -3058,7 +3058,7 @@ config_enum_lookup_by_name(struct config_enum *record, const char *value,
30583058 * If suffix is non-NULL, it is added to the end of the string.
30593059 */
30603060char *
3061- config_enum_get_options (struct config_enum * record , const char * prefix ,
3061+ config_enum_get_options (const struct config_enum * record , const char * prefix ,
30623062 const char * suffix , const char * separator )
30633063{
30643064 StringInfoData retstr ;
@@ -3114,7 +3114,7 @@ config_enum_get_options(struct config_enum *record, const char *prefix,
31143114 * Returns true if OK, false if not (or throws error, if elevel >= ERROR)
31153115 */
31163116static bool
3117- parse_and_validate_value (struct config_generic * record ,
3117+ parse_and_validate_value (const struct config_generic * record ,
31183118 const char * value ,
31193119 GucSource source , int elevel ,
31203120 union config_var_val * newval , void * * newextra )
@@ -3123,7 +3123,7 @@ parse_and_validate_value(struct config_generic *record,
31233123 {
31243124 case PGC_BOOL :
31253125 {
3126- struct config_bool * conf = (struct config_bool * ) record ;
3126+ const struct config_bool * conf = (const struct config_bool * ) record ;
31273127
31283128 if (!parse_bool (value , & newval -> boolval ))
31293129 {
@@ -3141,7 +3141,7 @@ parse_and_validate_value(struct config_generic *record,
31413141 break ;
31423142 case PGC_INT :
31433143 {
3144- struct config_int * conf = (struct config_int * ) record ;
3144+ const struct config_int * conf = (const struct config_int * ) record ;
31453145 const char * hintmsg ;
31463146
31473147 if (!parse_int (value , & newval -> intval ,
@@ -3182,7 +3182,7 @@ parse_and_validate_value(struct config_generic *record,
31823182 break ;
31833183 case PGC_REAL :
31843184 {
3185- struct config_real * conf = (struct config_real * ) record ;
3185+ const struct config_real * conf = (const struct config_real * ) record ;
31863186 const char * hintmsg ;
31873187
31883188 if (!parse_real (value , & newval -> realval ,
@@ -3223,7 +3223,7 @@ parse_and_validate_value(struct config_generic *record,
32233223 break ;
32243224 case PGC_STRING :
32253225 {
3226- struct config_string * conf = (struct config_string * ) record ;
3226+ const struct config_string * conf = (const struct config_string * ) record ;
32273227
32283228 /*
32293229 * The value passed by the caller could be transient, so we
@@ -3253,7 +3253,7 @@ parse_and_validate_value(struct config_generic *record,
32533253 break ;
32543254 case PGC_ENUM :
32553255 {
3256- struct config_enum * conf = (struct config_enum * ) record ;
3256+ const struct config_enum * conf = (const struct config_enum * ) record ;
32573257
32583258 if (!config_enum_lookup_by_name (conf , value , & newval -> enumval ))
32593259 {
@@ -5456,7 +5456,7 @@ GetConfigOptionByName(const char *name, const char **varname, bool missing_ok)
54565456 * The result string is palloc'd.
54575457 */
54585458char *
5459- ShowGUCOption (struct config_generic * record , bool use_units )
5459+ ShowGUCOption (const struct config_generic * record , bool use_units )
54605460{
54615461 char buffer [256 ];
54625462 const char * val ;
@@ -5465,7 +5465,7 @@ ShowGUCOption(struct config_generic *record, bool use_units)
54655465 {
54665466 case PGC_BOOL :
54675467 {
5468- struct config_bool * conf = (struct config_bool * ) record ;
5468+ const struct config_bool * conf = (const struct config_bool * ) record ;
54695469
54705470 if (conf -> show_hook )
54715471 val = conf -> show_hook ();
@@ -5476,7 +5476,7 @@ ShowGUCOption(struct config_generic *record, bool use_units)
54765476
54775477 case PGC_INT :
54785478 {
5479- struct config_int * conf = (struct config_int * ) record ;
5479+ const struct config_int * conf = (const struct config_int * ) record ;
54805480
54815481 if (conf -> show_hook )
54825482 val = conf -> show_hook ();
@@ -5505,7 +5505,7 @@ ShowGUCOption(struct config_generic *record, bool use_units)
55055505
55065506 case PGC_REAL :
55075507 {
5508- struct config_real * conf = (struct config_real * ) record ;
5508+ const struct config_real * conf = (const struct config_real * ) record ;
55095509
55105510 if (conf -> show_hook )
55115511 val = conf -> show_hook ();
@@ -5530,7 +5530,7 @@ ShowGUCOption(struct config_generic *record, bool use_units)
55305530
55315531 case PGC_STRING :
55325532 {
5533- struct config_string * conf = (struct config_string * ) record ;
5533+ const struct config_string * conf = (const struct config_string * ) record ;
55345534
55355535 if (conf -> show_hook )
55365536 val = conf -> show_hook ();
@@ -5543,7 +5543,7 @@ ShowGUCOption(struct config_generic *record, bool use_units)
55435543
55445544 case PGC_ENUM :
55455545 {
5546- struct config_enum * conf = (struct config_enum * ) record ;
5546+ const struct config_enum * conf = (const struct config_enum * ) record ;
55475547
55485548 if (conf -> show_hook )
55495549 val = conf -> show_hook ();
@@ -6789,7 +6789,7 @@ GUC_check_errcode(int sqlerrcode)
67896789 */
67906790
67916791static bool
6792- call_bool_check_hook (struct config_bool * conf , bool * newval , void * * extra ,
6792+ call_bool_check_hook (const struct config_bool * conf , bool * newval , void * * extra ,
67936793 GucSource source , int elevel )
67946794{
67956795 /* Quick success if no hook */
@@ -6823,7 +6823,7 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra,
68236823}
68246824
68256825static bool
6826- call_int_check_hook (struct config_int * conf , int * newval , void * * extra ,
6826+ call_int_check_hook (const struct config_int * conf , int * newval , void * * extra ,
68276827 GucSource source , int elevel )
68286828{
68296829 /* Quick success if no hook */
@@ -6857,7 +6857,7 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra,
68576857}
68586858
68596859static bool
6860- call_real_check_hook (struct config_real * conf , double * newval , void * * extra ,
6860+ call_real_check_hook (const struct config_real * conf , double * newval , void * * extra ,
68616861 GucSource source , int elevel )
68626862{
68636863 /* Quick success if no hook */
@@ -6891,7 +6891,7 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra,
68916891}
68926892
68936893static bool
6894- call_string_check_hook (struct config_string * conf , char * * newval , void * * extra ,
6894+ call_string_check_hook (const struct config_string * conf , char * * newval , void * * extra ,
68956895 GucSource source , int elevel )
68966896{
68976897 volatile bool result = true;
@@ -6941,7 +6941,7 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra,
69416941}
69426942
69436943static bool
6944- call_enum_check_hook (struct config_enum * conf , int * newval , void * * extra ,
6944+ call_enum_check_hook (const struct config_enum * conf , int * newval , void * * extra ,
69456945 GucSource source , int elevel )
69466946{
69476947 /* Quick success if no hook */
0 commit comments