src: fix formatting nits

Closes #19823
This commit is contained in:
Viktor Szakats 2025-12-03 15:53:46 +01:00
parent 1753de9d7a
commit 0417d323c9
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
52 changed files with 490 additions and 543 deletions

View file

@ -224,7 +224,7 @@ static ParameterError getnum(long *val, const char *str, int base)
*val = (long)num;
if(is_neg)
*val = -*val;
return PARAM_OK; /* Ok */
return PARAM_OK; /* Ok */
}
}
return PARAM_BAD_NUMERIC; /* badness */
@ -309,7 +309,7 @@ ParameterError secs2ms(long *valp, const char *str)
const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 100000,
1000000, 10000000, 100000000 };
if(!str ||
curlx_str_number(&str, &secs, LONG_MAX/1000 - 1))
curlx_str_number(&str, &secs, LONG_MAX / 1000 - 1))
return PARAM_BAD_NUMERIC;
if(!curlx_str_single(&str, '.')) {
curl_off_t fracs;
@ -319,7 +319,7 @@ ParameterError secs2ms(long *valp, const char *str)
return PARAM_NUMBER_TOO_LARGE;
/* how many milliseconds are in fracs ? */
len = (str - s);
while((len > CURL_ARRAYSIZE(digs) || (fracs > LONG_MAX/100))) {
while((len > CURL_ARRAYSIZE(digs) || (fracs > LONG_MAX / 100))) {
fracs /= 10;
len--;
}
@ -340,7 +340,7 @@ static size_t protoset_index(const char * const *protoset, const char *proto)
{
const char * const *p = protoset;
DEBUGASSERT(proto == proto_token(proto)); /* Ensure it is tokenized. */
DEBUGASSERT(proto == proto_token(proto)); /* Ensure it is tokenized. */
for(; *p; p++)
if(proto == *p)
@ -388,7 +388,7 @@ static void protoset_clear(const char **protoset, const char *proto)
* data.
*/
#define MAX_PROTOSTRING (64*11) /* Enough room for 64 10-chars proto names. */
#define MAX_PROTOSTRING (64 * 11) /* Room for 64 10-chars proto names. */
ParameterError proto2num(const char * const *val, char **ostr, const char *str)
{
@ -452,8 +452,8 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str)
break;
case allow:
case set:
memcpy((char *) protoset,
built_in_protos, (proto_count + 1) * sizeof(*protoset));
memcpy((char *)protoset, built_in_protos,
(proto_count + 1) * sizeof(*protoset));
break;
}
}
@ -491,7 +491,7 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str)
}
/* We need the protocols in alphabetic order for CI tests requirements. */
qsort((char *) protoset, protoset_index(protoset, NULL), sizeof(*protoset),
qsort((char *)protoset, protoset_index(protoset, NULL), sizeof(*protoset),
struplocompare4sort);
for(proto = 0; protoset[proto] && !result; proto++)
@ -543,7 +543,7 @@ ParameterError str2offset(curl_off_t *val, const char *str)
return PARAM_OK;
}
#define MAX_USERPWDLENGTH (100*1024)
#define MAX_USERPWDLENGTH (100 * 1024)
static CURLcode checkpasswd(const char *kind, /* for what purpose */
const size_t i, /* operation index */
const bool last, /* TRUE if last operation */
@ -648,22 +648,21 @@ long delegation(const char *str)
return CURLGSSAPI_DELEGATION_NONE;
}
#define isheadersep(x) ((((x)==':') || ((x)==';')))
#define isheadersep(x) ((((x) == ':') || ((x) == ';')))
/*
* inlist() returns true if the given 'checkfor' header is present in the
* header list.
*/
static bool inlist(const struct curl_slist *head,
const char *checkfor)
static bool inlist(const struct curl_slist *head, const char *checkfor)
{
size_t thislen = strlen(checkfor);
DEBUGASSERT(thislen);
DEBUGASSERT(checkfor[thislen-1] != ':');
DEBUGASSERT(checkfor[thislen - 1] != ':');
for(; head; head = head->next) {
if(curl_strnequal(head->data, checkfor, thislen) &&
isheadersep(head->data[thislen]) )
isheadersep(head->data[thislen]))
return TRUE;
}