tidy-up: miscellaneous

- vms/curlmsg_vms.h: delete unused/commented code.
- vtls/schannel_verify: sort includes.
- typecheck-gcc.h: fix indent and alignment.
- lib/config-win32.h: drop idle `#undef`.
- spacecheck: check for stray empty lines before after curly braces.
- make literals more readable: 1048576 -> 1024 * 1024
- scope variables.
- use ISO date in a comment.
- drop redundant parentheses.
- drop empty comments.
- unfold lines.
- duplicate/stray spaces in comments.
- fix indent, whitespace, minor typos.

Closes #20690
This commit is contained in:
Viktor Szakats 2026-02-13 01:47:10 +01:00
parent ac46392f44
commit af78b199b2
No known key found for this signature in database
89 changed files with 424 additions and 448 deletions

View file

@ -322,7 +322,7 @@ static CURLcode empty_multi_test(void)
multi_init(multi);
/* calling curl_multi_waitfds() on an empty multi handle. */
/* calling curl_multi_waitfds() on an empty multi handle. */
mresult = curl_multi_waitfds(multi, ufds, 10, &fd_count);
if(mresult != CURLM_OK) {

View file

@ -330,15 +330,15 @@ static bool bad_long(CURLcode res, int check)
static bool bad_neg(int check)
{
switch(check) {
case CURLOPT_DNS_CACHE_TIMEOUT:
case CURLOPT_INFILESIZE:
case CURLOPT_INFILESIZE_LARGE:
case CURLOPT_MAXREDIRS:
case CURLOPT_POSTFIELDSIZE:
case CURLOPT_POSTFIELDSIZE_LARGE:
case CURLOPT_RESUME_FROM:
case CURLOPT_RESUME_FROM_LARGE:
return TRUE;
case CURLOPT_DNS_CACHE_TIMEOUT:
case CURLOPT_INFILESIZE:
case CURLOPT_INFILESIZE_LARGE:
case CURLOPT_MAXREDIRS:
case CURLOPT_POSTFIELDSIZE:
case CURLOPT_POSTFIELDSIZE_LARGE:
case CURLOPT_RESUME_FROM:
case CURLOPT_RESUME_FROM_LARGE:
return TRUE;
}
return FALSE;
}

View file

@ -146,7 +146,7 @@ elsif($ARGV[0] eq "postprocess") {
}
close(IN);
@canondir = sort {substr($a,57) cmp substr($b,57)} @canondir;
@canondir = sort {substr($a, 57) cmp substr($b, 57)} @canondir;
my $newfile = $logfile . ".new";
open(OUT, ">$newfile") || die "$!";
print OUT join('', @canondir);

View file

@ -154,7 +154,6 @@ sub memanalyze {
$sizeataddr{$addr}=-1; # set -1 to mark as freed
$getmem{$addr}="$source:$linenum";
}
}
elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) {
@ -380,7 +379,6 @@ sub memanalyze {
push @res, "FREEADDRINFO ($source:$linenum)\n";
}
}
}
else {
push @res, "Not recognized prefix line: $line\n";

View file

@ -1447,7 +1447,6 @@ sub singletest_check {
}
$ok .= "p";
}
else {
$ok .= "-"; # protocol not checked
@ -1609,7 +1608,6 @@ sub singletest_check {
}
$ok .= "P";
}
else {
$ok .= "-"; # proxy not checked

View file

@ -519,7 +519,6 @@ static curl_socket_t sockit(curl_socket_t fd)
rep = s_config.connectrep;
}
/* */
response[SOCKS5_VERSION] = s_config.responseversion;
/*

View file

@ -311,7 +311,7 @@ sub serverfortest {
push @lprotocols, "dns";
if(! grep /^\Q$server\E$/, @lprotocols) {
if(substr($server,0,5) ne "socks") {
if(substr($server, 0, 5) ne "socks") {
if($tlsext) {
return ("curl lacks $tlsext support", 4);
}

View file

@ -279,7 +279,6 @@ while(<$r>) {
push @toolhelp, $combo;
$opts{$combo} |= 4;
}
}
}
close($r);

View file

@ -315,7 +315,7 @@ static CURLcode test_unit1664(const char *arg)
/* CURL_OFF_T is typically 9223372036854775807 */
static const char *nums[] = {
"9223372036854775807", /* 2^63 -1 */
"9223372036854775808", /* 2^63 */
"9223372036854775808", /* 2^63 */
"18446744073709551615", /* 2^64 - 1 */
"18446744073709551616", /* 2^64 */
"18446744073709551617", /* 2^64 + 1 */
@ -429,7 +429,7 @@ static CURLcode test_unit1664(const char *arg)
/* CURL_OFF_T is typically 2^63-1 */
static const char *nums[] = {
"777777777777777777777", /* 2^63 -1 */
"1000000000000000000000", /* 2^63 */
"1000000000000000000000", /* 2^63 */
"111111111111111111111",
"222222222222222222222",
"333333333333333333333",
@ -453,7 +453,7 @@ static CURLcode test_unit1664(const char *arg)
/* CURL_OFF_T is typically 2^63-1 */
static const char *nums[] = {
"7FFFFFFFFFFFFFFF", /* 2^63 -1 */
"8000000000000000", /* 2^63 */
"8000000000000000", /* 2^63 */
"1111111111111111",
"2222222222222222",
"3333333333333333",

View file

@ -360,17 +360,17 @@ static CURLcode test_unit2600(const char *arg)
/* CNCT HE v4 v6 v4 v6 MIN MAX */
{ 1, TURL, "test.com:123:192.0.2.1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 1, 0, 200, TC_TMOT, R_FAIL, NULL },
/* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */
/* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */
{ 2, TURL, "test.com:123:192.0.2.1,192.0.2.2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 2, 0, 400, TC_TMOT, R_FAIL, NULL },
/* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
/* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
#ifdef USE_IPV6
{ 3, TURL, "test.com:123:::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 0, 1, 200, TC_TMOT, R_FAIL, NULL },
/* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */
/* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */
{ 4, TURL, "test.com:123:::1,::2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 0, 2, 400, TC_TMOT, R_FAIL, NULL },
/* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */
/* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */
{ 5, TURL, "test.com:123:192.0.2.1,::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 1, 1, 350, TC_TMOT, R_FAIL, "v6" },
/* mixed ip4+6, v6 always first, v4 kicks in on HE, fails after ~350ms */