Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e1539b

Browse files
committed
Add some const decorations to prototypes
Reviewed-by: Fabien COELHO <[email protected]>
1 parent 7e60e67 commit 0e1539b

File tree

95 files changed

+236
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+236
-236
lines changed

contrib/dict_xsyn/dict_xsyn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ compare_syn(const void *a, const void *b)
7070
}
7171

7272
static void
73-
read_dictionary(DictSyn *d, char *filename)
73+
read_dictionary(DictSyn *d, const char *filename)
7474
{
7575
char *real_filename = get_tsearch_config_filename(filename, "rules");
7676
tsearch_readline_state trst;

contrib/fuzzystrmatch/dmetaphone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ metastring;
232232
*/
233233

234234
static metastring *
235-
NewMetaString(char *init_str)
235+
NewMetaString(const char *init_str)
236236
{
237237
metastring *s;
238238
char empty_string[] = "";
@@ -375,7 +375,7 @@ StringAt(metastring *s, int start, int length,...)
375375

376376

377377
static void
378-
MetaphAdd(metastring *s, char *new_str)
378+
MetaphAdd(metastring *s, const char *new_str)
379379
{
380380
int add_length;
381381

contrib/pgcrypto/pgcrypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ PG_MODULE_MAGIC;
4747
/* private stuff */
4848

4949
typedef int (*PFN) (const char *name, void **res);
50-
static void *find_provider(text *name, PFN pf, char *desc, int silent);
50+
static void *find_provider(text *name, PFN pf, const char *desc, int silent);
5151

5252
/* SQL function: hash(bytea, text) returns bytea */
5353
PG_FUNCTION_INFO_V1(pg_digest);
@@ -474,7 +474,7 @@ pg_random_uuid(PG_FUNCTION_ARGS)
474474
static void *
475475
find_provider(text *name,
476476
PFN provider_lookup,
477-
char *desc, int silent)
477+
const char *desc, int silent)
478478
{
479479
void *res;
480480
char *buf;

contrib/seg/seg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,9 @@ restore(char *result, float val, int n)
10521052
* a floating point number
10531053
*/
10541054
int
1055-
significant_digits(char *s)
1055+
significant_digits(const char *s)
10561056
{
1057-
char *p = s;
1057+
const char *p = s;
10581058
int n,
10591059
c,
10601060
zeroes;

contrib/seg/segdata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ typedef struct SEG
1212
} SEG;
1313

1414
/* in seg.c */
15-
extern int significant_digits(char *str);
15+
extern int significant_digits(const char *str);
1616

1717
/* in segscan.l */
1818
extern int seg_yylex(void);

contrib/seg/segparse.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define YYMALLOC palloc
2222
#define YYFREE pfree
2323

24-
static float seg_atof(char *value);
24+
static float seg_atof(const char *value);
2525

2626
static char strbuf[25] = {
2727
'0', '0', '0', '0', '0',
@@ -151,7 +151,7 @@ deviation: SEGFLOAT
151151

152152

153153
static float
154-
seg_atof(char *value)
154+
seg_atof(const char *value)
155155
{
156156
Datum datum;
157157

contrib/unaccent/unaccent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ placeChar(TrieChar *node, const unsigned char *str, int lenstr,
9090
* Function converts UTF8-encoded file into current encoding.
9191
*/
9292
static TrieChar *
93-
initTrie(char *filename)
93+
initTrie(const char *filename)
9494
{
9595
TrieChar *volatile rootTrie = NULL;
9696
MemoryContext ccxt = CurrentMemoryContext;

contrib/uuid-ossp/uuid-ossp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
253253
#else /* !HAVE_UUID_OSSP */
254254

255255
static Datum
256-
uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len)
256+
uuid_generate_internal(int v, unsigned char *ns, const char *ptr, int len)
257257
{
258258
char strbuf[40];
259259

src/backend/access/common/reloptions.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ add_reloption(relopt_gen *newoption)
582582
* (for types other than string)
583583
*/
584584
static relopt_gen *
585-
allocate_reloption(bits32 kinds, int type, char *name, char *desc)
585+
allocate_reloption(bits32 kinds, int type, const char *name, const char *desc)
586586
{
587587
MemoryContext oldcxt;
588588
size_t size;
@@ -630,7 +630,7 @@ allocate_reloption(bits32 kinds, int type, char *name, char *desc)
630630
* Add a new boolean reloption
631631
*/
632632
void
633-
add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val)
633+
add_bool_reloption(bits32 kinds, const char *name, const char *desc, bool default_val)
634634
{
635635
relopt_bool *newoption;
636636

@@ -646,7 +646,7 @@ add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val)
646646
* Add a new integer reloption
647647
*/
648648
void
649-
add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
649+
add_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val,
650650
int min_val, int max_val)
651651
{
652652
relopt_int *newoption;
@@ -665,7 +665,7 @@ add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
665665
* Add a new float reloption
666666
*/
667667
void
668-
add_real_reloption(bits32 kinds, char *name, char *desc, double default_val,
668+
add_real_reloption(bits32 kinds, const char *name, const char *desc, double default_val,
669669
double min_val, double max_val)
670670
{
671671
relopt_real *newoption;
@@ -689,7 +689,7 @@ add_real_reloption(bits32 kinds, char *name, char *desc, double default_val,
689689
* the validation.
690690
*/
691691
void
692-
add_string_reloption(bits32 kinds, char *name, char *desc, char *default_val,
692+
add_string_reloption(bits32 kinds, const char *name, const char *desc, const char *default_val,
693693
validate_string_relopt validator)
694694
{
695695
relopt_string *newoption;
@@ -742,7 +742,7 @@ add_string_reloption(bits32 kinds, char *name, char *desc, char *default_val,
742742
* but we declare them as Datums to avoid including array.h in reloptions.h.
743743
*/
744744
Datum
745-
transformRelOptions(Datum oldOptions, List *defList, char *namspace,
745+
transformRelOptions(Datum oldOptions, List *defList, const char *namspace,
746746
char *validnsps[], bool ignoreOids, bool isReset)
747747
{
748748
Datum result;

src/backend/access/gist/gistbuild.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ gistbuild(Relation heap, Relation index, IndexInfo *indexInfo)
238238
* and "auto" values.
239239
*/
240240
void
241-
gistValidateBufferingOption(char *value)
241+
gistValidateBufferingOption(const char *value)
242242
{
243243
if (value == NULL ||
244244
(strcmp(value, "on") != 0 &&

0 commit comments

Comments
 (0)