clang-tidy: sync argument names in prototype and definition

Discovered with clang-tidy checker
`readability-inconsistent-declaration-parameter-name`.

Also:
- do not enforce the above because of inconsistencies still present
  between public API prototypes and definitions. (Also betwen man page
  protos, and man page examples, and other parts of the code, e.g.
  `easy` vs `curl` vs `d` vs `handle`) Perhaps subject for a future
  effort:
  https://github.com/curl/curl/actions/runs/22166472728/job/64094691653
- enable and fix `readability-named-parameter` where missing.

Refs:
https://clang.llvm.org/extra/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/named-parameter.html

Closes #20624
This commit is contained in:
Viktor Szakats 2026-02-18 00:55:27 +01:00
parent 7c01bb23bc
commit c878160e9c
No known key found for this signature in database
64 changed files with 200 additions and 195 deletions

View file

@ -28,7 +28,7 @@
#if defined(USE_OPENSSL) || defined(USE_SCHANNEL)
/* returns TRUE if there is a match */
bool Curl_cert_hostcheck(const char *match_pattern, size_t matchlen,
bool Curl_cert_hostcheck(const char *match, size_t matchlen,
const char *hostname, size_t hostlen);
#endif

View file

@ -917,10 +917,9 @@ static bool is_pkcs11_uri(const char *string)
#endif
static CURLcode ossl_set_engine(struct Curl_easy *data, const char *engine);
static CURLcode ossl_set_engine(struct Curl_easy *data, const char *name);
#ifdef OPENSSL_HAS_PROVIDERS
static CURLcode ossl_set_provider(struct Curl_easy *data,
const char *provider);
static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname);
#endif
static int use_certificate_blob(SSL_CTX *ctx, const struct curl_blob *blob,

View file

@ -106,7 +106,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
struct Curl_cfilter *cf,
struct Curl_easy *data,
struct ssl_peer *peer,
const struct alpn_spec *alpns,
const struct alpn_spec *alpns_requested,
Curl_ossl_ctx_setup_cb *cb_setup,
void *cb_user_data,
Curl_ossl_new_session_cb *cb_new_session,
@ -138,7 +138,7 @@ CURLcode Curl_ossl_ctx_configure(struct Curl_cfilter *cf,
CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf,
struct Curl_easy *data,
const char *ssl_peer_key,
SSL_SESSION *ssl_sessionid,
SSL_SESSION *session,
int ietf_tls_id,
const char *alpn,
unsigned char *quic_tp,

View file

@ -679,12 +679,11 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data,
/* get length bytes of randomness */
CURLcode Curl_ssl_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
unsigned char *buffer, size_t length)
{
DEBUGASSERT(length == sizeof(int));
if(Curl_ssl->random)
return Curl_ssl->random(data, entropy, length);
return Curl_ssl->random(data, buffer, length);
else
return CURLE_NOT_BUILT_IN;
}

View file

@ -178,8 +178,8 @@ CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data, int certnum,
/* Functions to be used by SSL library adaptation functions */
/* get N random bytes into the buffer */
CURLcode Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer,
size_t length);
CURLcode Curl_ssl_random(struct Curl_easy *data,
unsigned char *buffer, size_t length);
/* Check pinned public key. */
CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
const char *pinnedpubkey,

View file

@ -914,7 +914,7 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf,
struct Curl_easy *data,
const char *ssl_peer_key,
void *sobj,
Curl_ssl_scache_obj_dtor *sobj_free)
Curl_ssl_scache_obj_dtor *sobj_dtor_cb)
{
struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
@ -922,7 +922,7 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf,
CURLcode result;
DEBUGASSERT(sobj);
DEBUGASSERT(sobj_free);
DEBUGASSERT(sobj_dtor_cb);
if(!scache) {
result = CURLE_BAD_FUNCTION_ARGUMENT;
@ -935,12 +935,12 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf,
goto out;
}
cf_ssl_scache_peer_set_obj(peer, sobj, sobj_free);
cf_ssl_scache_peer_set_obj(peer, sobj, sobj_dtor_cb);
sobj = NULL; /* peer took ownership */
out:
if(sobj && sobj_free)
sobj_free(sobj);
if(sobj && sobj_dtor_cb)
sobj_dtor_cb(sobj);
return result;
}