clang-tidy: enable and fix readability-uppercase-literal-suffix

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/uppercase-literal-suffix.html

Closes #20629
This commit is contained in:
Viktor Szakats 2026-02-18 13:58:36 +01:00
parent 3cdc167425
commit c07c3cac74
No known key found for this signature in database
4 changed files with 8 additions and 7 deletions

View File

@ -17,4 +17,5 @@ Checks: >-
portability-*,
readability-named-parameter,
readability-redundant-control-flow,
readability-redundant-preprocessor
readability-redundant-preprocessor,
readability-uppercase-literal-suffix

View File

@ -539,7 +539,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data)
bool pickhost = FALSE;
bool pickproxy = FALSE;
CURLcode result = CURLE_OK;
unsigned long authmask = ~0ul;
unsigned long authmask = ~0UL;
if(!data->set.str[STRING_BEARER])
authmask &= (unsigned long)~CURLAUTH_BEARER;

View File

@ -267,8 +267,8 @@ static CURLproxycode socks4_req_add_hd(struct socks_state *sx,
(void)data;
buf[0] = 4; /* version (SOCKS4) */
buf[1] = 1; /* connect */
buf[2] = (unsigned char)((sx->remote_port >> 8) & 0xffu); /* MSB */
buf[3] = (unsigned char)(sx->remote_port & 0xffu); /* LSB */
buf[2] = (unsigned char)((sx->remote_port >> 8) & 0xffU); /* MSB */
buf[3] = (unsigned char)(sx->remote_port & 0xffU); /* LSB */
result = Curl_bufq_write(&sx->iobuf, buf, 4, &nwritten);
if(result || (nwritten != 4))
@ -929,8 +929,8 @@ static CURLproxycode socks5_resolving(struct socks_state *sx,
goto out;
}
/* PORT MSB+LSB */
req[0] = (unsigned char)((sx->remote_port >> 8) & 0xffu);
req[1] = (unsigned char)(sx->remote_port & 0xffu);
req[0] = (unsigned char)((sx->remote_port >> 8) & 0xffU);
req[1] = (unsigned char)(sx->remote_port & 0xffU);
result = Curl_bufq_write(&sx->iobuf, req, 2, &nwritten);
if(result || (nwritten != 2)) {
presult = CURLPX_SEND_REQUEST;

View File

@ -2732,7 +2732,7 @@ out:
default:
if(cerr->error_code >= NGTCP2_CRYPTO_ERROR) {
CURL_TRC_CF(data, cf, "crypto error, tls alert=%u",
(unsigned int)(cerr->error_code & 0xffu));
(unsigned int)(cerr->error_code & 0xffU));
}
else if(cerr->error_code == NGTCP2_CONNECTION_REFUSED) {
CURL_TRC_CF(data, cf, "connection refused by server");