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
This commit is contained in:
Peter Geoghegan 2022-09-22 13:59:20 -07:00
parent 8fb4e001e9
commit 0faf7d933f
21 changed files with 59 additions and 58 deletions

View File

@ -159,7 +159,7 @@ static void bt_child_highkey_check(BtreeCheckState *state,
Page loaded_child,
uint32 target_level);
static void bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
BlockNumber targetblock, Page target);
BlockNumber blkno, Page page);
static void bt_tuple_present_callback(Relation index, ItemPointer tid,
Datum *values, bool *isnull,
bool tupleIsAlive, void *checkstate);

View File

@ -96,7 +96,7 @@ int32 cube_cmp_v0(NDBOX *a, NDBOX *b);
bool cube_contains_v0(NDBOX *a, NDBOX *b);
bool cube_overlap_v0(NDBOX *a, NDBOX *b);
NDBOX *cube_union_v0(NDBOX *a, NDBOX *b);
void rt_cube_size(NDBOX *a, double *sz);
void rt_cube_size(NDBOX *a, double *size);
NDBOX *g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep);
bool g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);

View File

@ -114,7 +114,7 @@ static void dblink_security_check(PGconn *conn, remoteConn *rconn);
static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
static char *get_connect_string(const char *servername);
static char *escape_param_str(const char *from);
static char *escape_param_str(const char *str);
static void validate_pkattnums(Relation rel,
int2vector *pkattnums_arg, int32 pknumatts_arg,
int **pkattnums, int *pknumatts);

View File

@ -117,7 +117,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
#include <ctype.h>
/* prototype for the main function we got from the perl module */
static void DoubleMetaphone(char *, char **);
static void DoubleMetaphone(char *str, char **codes);
#ifndef DMETAPHONE_MAIN

View File

@ -114,7 +114,7 @@ ArrayType *new_intArrayType(int num);
ArrayType *copy_intArrayType(ArrayType *a);
ArrayType *resize_intArrayType(ArrayType *a, int num);
int internal_size(int *a, int len);
ArrayType *_int_unique(ArrayType *a);
ArrayType *_int_unique(ArrayType *r);
int32 intarray_match_first(ArrayType *a, int32 elem);
ArrayType *intarray_add_elem(ArrayType *a, int32 elem);
ArrayType *intarray_concat_arrays(ArrayType *a, ArrayType *b);

View File

@ -34,8 +34,8 @@ PG_FUNCTION_INFO_V1(_int_contained_joinsel);
PG_FUNCTION_INFO_V1(_int_matchsel);
static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs,
int nmncelems, float4 minfreq);
static Selectivity int_query_opr_selec(ITEM *item, Datum *mcelems, float4 *mcefreqs,
int nmcelems, float4 minfreq);
static int compare_val_int4(const void *a, const void *b);
/*

View File

@ -382,14 +382,14 @@ intarray_concat_arrays(ArrayType *a, ArrayType *b)
}
ArrayType *
int_to_intset(int32 n)
int_to_intset(int32 elem)
{
ArrayType *result;
int32 *aa;
result = new_intArrayType(1);
aa = ARRPTR(result);
aa[0] = n;
aa[0] = elem;
return result;
}

View File

@ -206,7 +206,7 @@ bool ltree_execute(ITEM *curitem, void *checkval,
int ltree_compare(const ltree *a, const ltree *b);
bool inner_isparent(const ltree *c, const ltree *p);
bool compare_subnode(ltree_level *t, char *q, int len,
bool compare_subnode(ltree_level *t, char *qn, int len,
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
ltree *lca_inner(ltree **a, int len);
int ltree_strncasecmp(const char *a, const char *b, size_t s);

View File

@ -48,15 +48,15 @@ struct options
/* function prototypes */
static void help(const char *progname);
void get_opts(int, char **, struct options *);
void get_opts(int argc, char **argv, struct options *my_opts);
void add_one_elt(char *eltname, eary *eary);
char *get_comma_elts(eary *eary);
PGconn *sql_conn(struct options *);
int sql_exec(PGconn *, const char *sql, bool quiet);
void sql_exec_dumpalldbs(PGconn *, struct options *);
void sql_exec_dumpalltables(PGconn *, struct options *);
void sql_exec_searchtables(PGconn *, struct options *);
void sql_exec_dumpalltbspc(PGconn *, struct options *);
PGconn *sql_conn(struct options *my_opts);
int sql_exec(PGconn *conn, const char *todo, bool quiet);
void sql_exec_dumpalldbs(PGconn *conn, struct options *opts);
void sql_exec_dumpalltables(PGconn *conn, struct options *opts);
void sql_exec_searchtables(PGconn *conn, struct options *opts);
void sql_exec_dumpalltbspc(PGconn *conn, struct options *opts);
/* function to parse command line options and check for some usage errors. */
void

View File

@ -82,33 +82,33 @@ int mbuf_avail(MBuf *mbuf);
int mbuf_size(MBuf *mbuf);
int mbuf_grab(MBuf *mbuf, int len, uint8 **data_p);
int mbuf_steal_data(MBuf *mbuf, uint8 **data_p);
int mbuf_append(MBuf *dst, const uint8 *buf, int cnt);
int mbuf_append(MBuf *dst, const uint8 *buf, int len);
int mbuf_free(MBuf *mbuf);
/*
* Push filter
*/
int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
PushFilter *next);
int pushf_create(PushFilter **mp_p, const PushFilterOps *op,
void *init_arg, PushFilter *next);
int pushf_write(PushFilter *mp, const uint8 *data, int len);
void pushf_free_all(PushFilter *mp);
void pushf_free(PushFilter *mp);
int pushf_flush(PushFilter *mp);
int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
int pushf_create_mbuf_writer(PushFilter **res, MBuf *dst);
/*
* Pull filter
*/
int pullf_create(PullFilter **res, const PullFilterOps *ops,
int pullf_create(PullFilter **pf_p, const PullFilterOps *op,
void *init_arg, PullFilter *src);
int pullf_read(PullFilter *mp, int len, uint8 **data_p);
int pullf_read_max(PullFilter *mp, int len,
int pullf_read(PullFilter *pf, int len, uint8 **data_p);
int pullf_read_max(PullFilter *pf, int len,
uint8 **data_p, uint8 *tmpbuf);
void pullf_free(PullFilter *mp);
void pullf_free(PullFilter *pf);
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src);
#define GETBYTE(pf, dst) \
do { \

View File

@ -45,7 +45,8 @@ PG_MODULE_MAGIC;
/* private stuff */
typedef int (*PFN) (const char *name, void **res);
static void *find_provider(text *name, PFN pf, const char *desc, int silent);
static void *find_provider(text *name, PFN provider_lookup, const char *desc,
int silent);
/* SQL function: hash(bytea, text) returns bytea */
PG_FUNCTION_INFO_V1(pg_digest);

View File

@ -236,9 +236,9 @@ struct PGP_PubKey
int can_encrypt;
};
int pgp_init(PGP_Context **ctx);
int pgp_init(PGP_Context **ctx_p);
int pgp_encrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
int pgp_decrypt(PGP_Context *ctx, MBuf *src, MBuf *dst);
int pgp_decrypt(PGP_Context *ctx, MBuf *msrc, MBuf *mdst);
int pgp_free(PGP_Context *ctx);
int pgp_get_digest_code(const char *name);
@ -246,7 +246,7 @@ int pgp_get_cipher_code(const char *name);
const char *pgp_get_digest_name(int code);
int pgp_set_cipher_algo(PGP_Context *ctx, const char *name);
int pgp_set_s2k_mode(PGP_Context *ctx, int type);
int pgp_set_s2k_mode(PGP_Context *ctx, int mode);
int pgp_set_s2k_count(PGP_Context *ctx, int count);
int pgp_set_s2k_cipher_algo(PGP_Context *ctx, const char *name);
int pgp_set_s2k_digest_algo(PGP_Context *ctx, const char *name);
@ -259,22 +259,22 @@ int pgp_set_text_mode(PGP_Context *ctx, int mode);
int pgp_set_unicode_mode(PGP_Context *ctx, int mode);
int pgp_get_unicode_mode(PGP_Context *ctx);
int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen);
int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int len);
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
const uint8 *key, int klen, int pubtype);
const uint8 *key, int key_len, int pubtype);
int pgp_get_keyid(MBuf *pgp_data, char *dst);
/* internal functions */
int pgp_load_digest(int c, PX_MD **res);
int pgp_load_cipher(int c, PX_Cipher **res);
int pgp_get_cipher_key_size(int c);
int pgp_get_cipher_block_size(int c);
int pgp_load_digest(int code, PX_MD **res);
int pgp_load_cipher(int code, PX_Cipher **res);
int pgp_get_cipher_key_size(int code);
int pgp_get_cipher_block_size(int code);
int pgp_s2k_fill(PGP_S2K *s2k, int mode, int digest_algo, int count);
int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k);
int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen);
int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int key_len);
typedef struct PGP_CFB PGP_CFB;
int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
@ -316,11 +316,11 @@ int pgp_mpi_write(PushFilter *dst, PGP_MPI *n);
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n);
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n);
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
PGP_MPI **c1, PGP_MPI **c2);
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
PGP_MPI **m);
int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c);
int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m);
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
PGP_MPI **c1_p, PGP_MPI **c2_p);
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
PGP_MPI **msg_p);
int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p);
int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p);
extern struct PullFilterOps pgp_decrypt_filter;

View File

@ -48,8 +48,8 @@
/*
* main interface
*/
char *px_crypt(const char *psw, const char *salt, char *buf, unsigned buflen);
int px_gen_salt(const char *salt_type, char *dst, int rounds);
char *px_crypt(const char *psw, const char *salt, char *buf, unsigned len);
int px_gen_salt(const char *salt_type, char *buf, int rounds);
/*
* internal functions
@ -77,6 +77,6 @@ char *px_crypt_des(const char *key, const char *setting);
/* crypt-md5.c */
char *px_crypt_md5(const char *pw, const char *salt,
char *dst, unsigned dstlen);
char *passwd, unsigned dstlen);
#endif /* _PX_CRYPT_H */

View File

@ -176,7 +176,7 @@ int px_find_combo(const char *name, PX_Combo **res);
void px_THROW_ERROR(int err) pg_attribute_noreturn();
const char *px_strerror(int err);
const char *px_resolve_alias(const PX_Alias *aliases, const char *name);
const char *px_resolve_alias(const PX_Alias *list, const char *name);
void px_set_debug_handler(void (*handler) (const char *));

View File

@ -149,7 +149,7 @@ static void deparseReturningList(StringInfo buf, RangeTblEntry *rte,
static void deparseColumnRef(StringInfo buf, int varno, int varattno,
RangeTblEntry *rte, bool qualify_col);
static void deparseRelation(StringInfo buf, Relation rel);
static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
static void deparseExpr(Expr *node, deparse_expr_cxt *context);
static void deparseVar(Var *node, deparse_expr_cxt *context);
static void deparseConst(Const *node, deparse_expr_cxt *context, int showtype);
static void deparseParam(Param *node, deparse_expr_cxt *context);

View File

@ -457,7 +457,7 @@ static PgFdwModifyState *create_foreign_modify(EState *estate,
Plan *subplan,
char *query,
List *target_attrs,
int len,
int values_end,
bool has_returning,
List *retrieved_attrs);
static TupleTableSlot **execute_foreign_modify(EState *estate,

View File

@ -226,7 +226,7 @@ extern EquivalenceMember *find_em_for_rel_target(PlannerInfo *root,
RelOptInfo *rel);
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root,
RelOptInfo *foreignrel, List *tlist,
RelOptInfo *rel, List *tlist,
List *remote_conds, List *pathkeys,
bool has_final_sort, bool has_limit,
bool is_subquery,

View File

@ -92,7 +92,7 @@ PG_FUNCTION_INFO_V1(seg_different);
/*
** Auxiliary functions
*/
static int restore(char *s, float val, int n);
static int restore(char *result, float val, int n);
/*****************************************************************************

View File

@ -12,7 +12,7 @@ typedef struct SEG
} SEG;
/* in seg.c */
extern int significant_digits(const char *str);
extern int significant_digits(const char *s);
/* in segscan.l */
extern int seg_yylex(void);

View File

@ -51,9 +51,9 @@ static Tuplestorestate *get_crosstab_tuplestore(char *sql,
HTAB *crosstab_hash,
TupleDesc tupdesc,
bool randomAccess);
static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial);
static bool compatCrosstabTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
static void compatConnectbyTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
static void validateConnectbyTupleDesc(TupleDesc td, bool show_branch, bool show_serial);
static bool compatCrosstabTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc);
static void compatConnectbyTupleDescs(TupleDesc ret_tupdesc, TupleDesc sql_tupdesc);
static void get_normal_pair(float8 *x1, float8 *x2);
static Tuplestorestate *connectby(char *relname,
char *key_fld,

View File

@ -60,7 +60,7 @@ static void pg_output_begin(LogicalDecodingContext *ctx,
static void pg_decode_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pg_decode_change(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, Relation rel,
ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pg_decode_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
@ -69,7 +69,7 @@ static void pg_decode_truncate(LogicalDecodingContext *ctx,
static bool pg_decode_filter(LogicalDecodingContext *ctx,
RepOriginId origin_id);
static void pg_decode_message(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr message_lsn,
ReorderBufferTXN *txn, XLogRecPtr lsn,
bool transactional, const char *prefix,
Size sz, const char *message);
static bool pg_decode_filter_prepare(LogicalDecodingContext *ctx,
@ -109,7 +109,7 @@ static void pg_decode_stream_change(LogicalDecodingContext *ctx,
Relation relation,
ReorderBufferChange *change);
static void pg_decode_stream_message(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr message_lsn,
ReorderBufferTXN *txn, XLogRecPtr lsn,
bool transactional, const char *prefix,
Size sz, const char *message);
static void pg_decode_stream_truncate(LogicalDecodingContext *ctx,