8000 Harmonize parameter names in contrib code. · postgrespro/postgres@0faf7d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0faf7d9

Browse files
Harmonize parameter names in contrib code.
Make sure that function declarations use names that exactly match the corresponding names from function definitions in contrib code. Like other recent commits that cleaned up function parameter names, this commit was written with help from clang-tidy. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
1 parent 8fb4e00 commit 0faf7d9

File tree

21 files changed

+59
-58
lines changed

21 files changed

+59
-58
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void bt_child_highkey_check(BtreeCheckState *state,
159159
Page loaded_child,
160160
uint32 target_level);
161161
static void bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
162-
BlockNumber targetblock, Page target);
162+
BlockNumber blkno, Page page);
163163
static void bt_tuple_present_callback(Relation index, ItemPointer tid,
164164
Datum *values, bool *isnull,
165165
bool tupleIsAlive, void *checkstate);

contrib/cube/cube.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 8000 int32 cube_cmp_v0(NDBOX *a, NDBOX *b);
9696
bool cube_contains_v0(NDBOX *a, NDBOX *b);
9797
bool cube_overlap_v0(NDBOX *a, NDBOX *b);
9898
NDBOX *cube_union_v0(NDBOX *a, NDBOX *b);
99-
void rt_cube_size(NDBOX *a, double *sz);
99+
void rt_cube_size(NDBOX *a, double *size);
100100
NDBOX *g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep);
101101
bool g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
102102
bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);

contrib/dblink/dblink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void dblink_security_check(PGconn *conn, remoteConn *rconn);
114114
static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
115115
bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
116116
static char *get_connect_string(const char *servername);
117-
static char *escape_param_str(const char *from);
117+
static char *escape_param_str(const char *str);
118118
static void validate_pkattnums(Relation rel,
119119
int2vector *pkattnums_arg, int32 pknumatts_arg,
120120
int **pkattnums, int *pknumatts);

contrib/fuzzystrmatch/dmetaphone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
117117
#include <ctype.h>
118118

119119
/* prototype for the main function we got from the perl module */
120-
static void DoubleMetaphone(char *, char **);
120+
static void DoubleMetaphone(char *str, char **codes);
121121

122122
#ifndef DMETAPHONE_MAIN
123123

contrib/intarray/_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ArrayType *new_intArrayType(int num);
114114
ArrayType *copy_intArrayType(ArrayType *a);
115115
ArrayType *resize_intArrayType(ArrayType *a, int num);
116116
int internal_size(int *a, int len);
117-
ArrayType *_int_unique(ArrayType *a);
117+
ArrayType *_int_unique(ArrayType *r);
118118
int32 intarray_match_first(ArrayType *a, int32 elem);
119119
ArrayType *intarray_add_elem(ArrayType *a, int32 elem);
120120
ArrayType *intarray_concat_arrays(ArrayType *a, ArrayType *b);

contrib/intarray/_int_selfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ PG_FUNCTION_INFO_V1(_int_contained_joinsel);
3434
PG_FUNCTION_INFO_V1(_int_matchsel);
3535

3636

37-
static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs,
38-
int nmncelems, float4 minfreq);
37+
static Selectivity int_query_opr_selec(ITEM *item, Datum *mcelems, float4 *mcefreqs,
38+
int nmcelems, float4 minfreq);
3939
static int compare_val_int4(const void *a, const void *b);
4040

4141
/*

contrib/intarray/_int_tool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,14 @@ intarray_concat_arrays(ArrayType *a, ArrayType *b)
382382
}
383383

384384
ArrayType *
385-
int_to_intset(int32 n)
385+
int_to_intset(int32 elem)
386386
{
387387
ArrayType *result;
388388
int32 *aa;
389389

390390
result = new_intArrayType(1);
391391
aa = ARRPTR(result);
392-
aa[0] = n;
392+
aa[0] = elem;
393393
return result;
394394
}
395395

contrib/ltree/ltree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ bool ltree_execute(ITEM *curitem, void *checkval,
206206

207207
int ltree_compare(const ltree *a, const ltree *b);
208208
bool inner_isparent(const ltree *c, const ltree *p);
209-
bool compare_subnode(ltree_level *t, char *q, int len,
209+
bool compare_subnode(ltree_level *t, char *qn, int len,
210210
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
211211
ltree *lca_inner(ltree **a, int len);
212212
int ltree_strncasecmp(const char *a, const char *b, size_t s);

contrib/oid2name/oid2name.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ struct options
4848

4949
/* function prototypes */
5050
static void help(const char *progname);
51-
void get_opts(int, char **, struct options *);
51+
void get_opts(int argc, char **argv, struct options *my_opts);
5252
void add_one_elt(char *eltname, eary *eary);
5353
char *get_comma_elts(eary *eary);
54-
PGconn *sql_conn(struct options *);
55-
int sql_exec(PGconn *, const char *sql, bool quiet);
56-
void sql_exec_dumpalldbs(PGconn *, struct options *);
57-
void sql_exec_dumpalltables(PGconn *, struct options *);
58-
void sql_exec_searchtables(PGconn *, struct options *);
59-
void sql_exec_dumpalltbspc(PGconn *, struct options *);
54+
PGconn *sql_conn(struct options *my_opts);
55+
int sql_exec(PGconn *conn, const char *todo, bool quiet);
56+
void sql_exec_dumpalldbs(PGconn *conn, struct options *opts);
57+
void sql_exec_dumpalltables(PGconn *conn, struct options *opts);
58+
void sql_exec_searchtables(PGconn *conn, struct options *opts);
59+
void sql_exec_dumpalltbspc(PGconn *conn, struct options *opts);
6060

6161
/* function to parse command line options and check for some usage errors. */
6262
void

contrib/pgcrypto/mbuf.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,33 +82,33 @@ int mbuf_avail(MBuf *mbuf);
8282
int mbuf_size(MBuf *mbuf);
8383
int mbuf_grab(MBuf *mbuf, int len, uint8 **data_p);
8484
int mbuf_steal_data(MBuf *mbuf, uint8 **data_p);
85-
int mbuf_append(MBuf *dst, const uint8 *buf, int cnt);
85+
int mbuf_append(MBuf *dst, const uint8 *buf, int len);
8686
int mbuf_free(MBuf *mbuf);
8787

8888
/*
8989
* Push filter
9090
*/
91-
int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
92-
PushFilter *next);
91+
int pushf_create(PushFilter **mp_p, const PushFilterOps *op,
92+
void *init_arg, PushFilter *next);
9393
int pushf_write(PushFilter *mp, const uint8 *data, int len);
9494
void pushf_free_all(PushFilter *mp);
9595
void pushf_free(PushFilter *mp);
9696
int pushf_flush(PushFilter *mp);
9797

98-
int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
98+
int pushf_create_mbuf_writer(PushFilter **res, MBuf *dst);
9999

100100
/*
101101
* Pull filter
102102
*/
103-
int pullf_create(PullFilter **res, const PullFilterOps *ops,
103+
int pullf_create(PullFilter **pf_p, const PullFilterOps *op,
104104
void *init_arg, PullFilter *src);
105-
int pullf_read(PullFilter *mp, int len, uint8 **data_p);
106-
int pullf_read_max(PullFilter *mp, int len,
105+
int pullf_read(PullFilter *pf, int len, uint8 **data_p);
106+
int pullf_read_max(PullFilter *pf, int len,
107107
uint8 **data_p, uint8 *tmpbuf);
108-
void pullf_free(PullFilter *mp);
108+
void pullf_free(PullFilter *pf);
109109
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
110110

111-
int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
111+
int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src);
112112

113113
#define GETBYTE(pf, dst) \
114114
do { \

0 commit comments

Comments
 (0)
0