tidy-up: miscellaneous

- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000
This commit is contained in:
Viktor Szakats 2026-03-09 12:27:12 +01:00
parent 3512b673dd
commit e0dd6eb4a4
No known key found for this signature in database
148 changed files with 612 additions and 684 deletions

View file

@ -111,14 +111,6 @@
* CURLRES_* defines based on the config*.h and curl_setup.h defines.
*/
/*
* Curl_printable_address() stores a printable version of the 1st address
* given in the 'ai' argument. The result will be stored in the buf that is
* bufsize bytes big.
*
* If the conversion fails, the target buffer is empty.
*/
uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
{
(void)data;
@ -129,7 +121,7 @@ uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
return CURL_DNSQ_A;
default:
if(Curl_ipv6works(data))
return (CURL_DNSQ_A|CURL_DNSQ_AAAA);
return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
else
return CURL_DNSQ_A;
}
@ -139,15 +131,15 @@ uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
const char *Curl_resolv_query_str(uint8_t dns_queries)
{
switch(dns_queries) {
case (CURL_DNSQ_A|CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
return "A+AAAA+HTTPS";
case (CURL_DNSQ_A|CURL_DNSQ_AAAA):
case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
return "A+AAAA";
case (CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
return "AAAA+HTTPS";
case (CURL_DNSQ_AAAA):
return "AAAA";
case (CURL_DNSQ_A|CURL_DNSQ_HTTPS):
case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
return "A+HTTPS";
case (CURL_DNSQ_A):
return "A";
@ -162,6 +154,13 @@ const char *Curl_resolv_query_str(uint8_t dns_queries)
}
#endif
/*
* Curl_printable_address() stores a printable version of the 1st address
* given in the 'ai' argument. The result will be stored in the buf that is
* bufsize bytes big.
*
* If the conversion fails, the target buffer is empty.
*/
void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf,
size_t bufsize)
{
@ -360,13 +359,12 @@ CURLcode Curl_resolv_announce_start(struct Curl_easy *data,
}
#ifdef USE_CURL_ASYNC
static struct Curl_resolv_async *
hostip_async_new(struct Curl_easy *data,
uint8_t dns_queries,
const char *hostname,
uint16_t port,
uint8_t transport,
timediff_t timeout_ms)
static struct Curl_resolv_async *hostip_async_new(struct Curl_easy *data,
uint8_t dns_queries,
const char *hostname,
uint16_t port,
uint8_t transport,
timediff_t timeout_ms)
{
struct Curl_resolv_async *async;
size_t hostlen = strlen(hostname);
@ -442,9 +440,10 @@ static CURLcode hostip_resolv_take_result(struct Curl_easy *data,
return result;
}
const struct Curl_addrinfo *
Curl_resolv_get_ai(struct Curl_easy *data, uint32_t resolv_id,
int ai_family, unsigned int index)
const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
uint32_t resolv_id,
int ai_family,
unsigned int index)
{
#ifdef CURLRES_ASYNCH
struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
@ -959,7 +958,6 @@ CURLcode Curl_resolv(struct Curl_easy *data,
timeout_ms, TRUE, presolv_id, entry);
}
#ifdef USE_CURL_ASYNC
struct Curl_resolv_async *Curl_async_get(struct Curl_easy *data,