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

@ -404,19 +404,19 @@ static CURLcode ip2addr(struct Curl_addrinfo **addrp, int af,
* Given an IPv4 or IPv6 dotted string address, this converts it to a proper
* allocated Curl_addrinfo struct and returns it.
*/
CURLcode Curl_str2addr(const char *address, int port,
CURLcode Curl_str2addr(const char *dotted, int port,
struct Curl_addrinfo **addrp)
{
struct in_addr in;
if(curlx_inet_pton(AF_INET, address, &in) > 0)
if(curlx_inet_pton(AF_INET, dotted, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
return ip2addr(addrp, AF_INET, &in, address, port);
return ip2addr(addrp, AF_INET, &in, dotted, port);
#ifdef USE_IPV6
{
struct in6_addr in6;
if(curlx_inet_pton(AF_INET6, address, &in6) > 0)
if(curlx_inet_pton(AF_INET6, dotted, &in6) > 0)
/* This is a dotted IPv6 address ::1-style */
return ip2addr(addrp, AF_INET6, &in6, address, port);
return ip2addr(addrp, AF_INET6, &in6, dotted, port);
}
#endif
return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */