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

@ -670,7 +670,7 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num)
/*
* push header access function. Only to be used from within the push callback
*/
char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
char *curl_pushheader_byname(struct curl_pushheaders *h, const char *name)
{
struct h2_stream_ctx *stream;
size_t len;
@ -681,17 +681,17 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
the header, but header == ":" must be rejected. If we have ':' in
the middle of header, it could be matched in middle of the value,
this is because we do prefix match.*/
if(!h || !GOOD_EASY_HANDLE(h->data) || !header || !header[0] ||
!strcmp(header, ":") || strchr(header + 1, ':'))
if(!h || !GOOD_EASY_HANDLE(h->data) || !name || !name[0] ||
!strcmp(name, ":") || strchr(name + 1, ':'))
return NULL;
stream = h->stream;
if(!stream)
return NULL;
len = strlen(header);
len = strlen(name);
for(i = 0; i < stream->push_headers_used; i++) {
if(!strncmp(header, stream->push_headers[i], len)) {
if(!strncmp(name, stream->push_headers[i], len)) {
/* sub-match, make sure that it is followed by a colon */
if(stream->push_headers[i][len] != ':')
continue;
@ -3001,10 +3001,10 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num)
return NULL;
}
char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
char *curl_pushheader_byname(struct curl_pushheaders *h, const char *name)
{
(void)h;
(void)header;
(void)name;
return NULL;
}