]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
clang-tidy: enable and fix `readability-uppercase-literal-suffix`
authorViktor Szakats <commit@vsz.me>
Wed, 18 Feb 2026 12:58:36 +0000 (13:58 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 19 Feb 2026 14:27:17 +0000 (15:27 +0100)
Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/uppercase-literal-suffix.html

Closes #20629

.clang-tidy.yml
lib/http.c
lib/socks.c
lib/vquic/curl_ngtcp2.c

index 582237eea5f1be462108b7b952756e9f40e48633..f9187b439bae3af1cea03174f69a3ddfc3ab3ea3 100644 (file)
@@ -17,4 +17,5 @@ Checks: >-
   portability-*,
   readability-named-parameter,
   readability-redundant-control-flow,
-  readability-redundant-preprocessor
+  readability-redundant-preprocessor,
+  readability-uppercase-literal-suffix
index d5d69a83dc3b299f3d9c81d4ef572059ab66c64b..d56ec19e814649bd783b0afaa3067bc425dc684b 100644 (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;
index e983d29d110361931ac3a16b76bca7947e54a79d..569d10945c3cec5e9088946199e1cd9b9b624975 100644 (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;
index 66bb5770f1bf77c7c91c528fac7b06724622481d..32ccada1bc59125ad119a27ddb462f461cef547b 100644 (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");