tidy-up: C and CI

- drop redundant casts for `CURL_UNCONST()` pointers (Windows).
- GHA/linux: delete redundant/dupe `-g` C flag in memory sanitizer job.
  Spotted-by: Daniel Stenberg
- examples/http2-upload: drop local macro.
- examples/http2-upload: drop leading underscore from union name.
- examples/http2-upload: drop interim macro.
- tests/server/util: reapply patch lost in a rebase.
- sync `main()` declarations across the codebase.

Closes #22559
This commit is contained in:
Viktor Szakats 2026-08-03 02:28:33 +02:00
parent 35843dd635
commit 8a8ff47b63
No known key found for this signature in database
37 changed files with 59 additions and 68 deletions

View file

@ -77,8 +77,7 @@ static CURLcode socks5_sspi_setup(struct Curl_cfilter *cf,
return CURLE_OUT_OF_MEMORY;
status =
Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT("Kerberos")),
Curl_pSecFn->AcquireCredentialsHandle(NULL, CURL_UNCONST(TEXT("Kerberos")),
SECPKG_CRED_OUTBOUND,
NULL, NULL, NULL, NULL,
cred_handle, NULL);

View file

@ -54,7 +54,7 @@ bool Curl_auth_is_digest_supported(void)
/* Query the security package for Digest */
status =
Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
@ -115,7 +115,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
/* Query the security package for DigestSSP */
status =
Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
&SecurityPackage);
if(status != SEC_E_OK) {
failf(data, "SSPI: could not get auth info");
@ -158,7 +158,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
/* Acquire our credentials handle */
status = Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
SECPKG_CRED_OUTBOUND, NULL,
p_identity, NULL, NULL,
&credentials, NULL);
@ -402,7 +402,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
/* Query the security package for DigestSSP */
status =
Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
&SecurityPackage);
if(status != SEC_E_OK) {
failf(data, "SSPI: could not get auth info");
@ -502,7 +502,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
/* Acquire our credentials handle */
status = Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
CURL_UNCONST(TEXT(SP_NAME_DIGEST)),
SECPKG_CRED_OUTBOUND, NULL,
p_identity, NULL, NULL,
&credentials, NULL);

View file

@ -46,7 +46,7 @@ bool Curl_auth_is_gssapi_supported(void)
/* Query the security package for Kerberos */
status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
@ -109,7 +109,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
if(!krb5->output_token) {
/* Query the security package for Kerberos */
status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
&SecurityPackage);
if(status != SEC_E_OK) {
failf(data, "SSPI: could not get auth info");
@ -150,7 +150,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
/* Acquire our credentials handle */
status = Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
CURL_UNCONST(TEXT(SP_NAME_KERBEROS)),
SECPKG_CRED_OUTBOUND, NULL,
krb5->p_identity, NULL, NULL,
krb5->credentials, NULL);

View file

@ -46,7 +46,7 @@ bool Curl_auth_is_ntlm_supported(void)
/* Query the security package for NTLM */
status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NTLM)),
CURL_UNCONST(TEXT(SP_NAME_NTLM)),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
@ -95,7 +95,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data,
/* Query the security package for NTLM */
status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NTLM)),
CURL_UNCONST(TEXT(SP_NAME_NTLM)),
&SecurityPackage);
if(status != SEC_E_OK) {
failf(data, "SSPI: could not get auth info");
@ -135,7 +135,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data,
/* Acquire our credentials handle */
status = Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NTLM)),
CURL_UNCONST(TEXT(SP_NAME_NTLM)),
SECPKG_CRED_OUTBOUND, NULL,
ntlm->p_identity, NULL, NULL,
ntlm->credentials, NULL);

View file

@ -48,7 +48,7 @@ bool Curl_auth_is_spnego_supported(void)
/* Query the security package for Negotiate */
status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
&SecurityPackage);
/* Release the package buffer as it is not required anymore */
@ -114,7 +114,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
if(!nego->output_token) {
/* Query the security package for Negotiate */
nego->status = Curl_pSecFn->QuerySecurityPackageInfo(
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
&SecurityPackage);
if(nego->status != SEC_E_OK) {
failf(data, "SSPI: could not get auth info");
@ -166,11 +166,9 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
* https://learn.microsoft.com/windows/win32/api/sspi/ns-sspi-sec_winnt_auth_identity_exa
*/
#ifdef UNICODE
nego->identity.PackageList =
(unsigned short *)CURL_UNCONST(TEXT("!ntlm"));
nego->identity.PackageList = CURL_UNCONST(TEXT("!ntlm"));
#else
nego->identity.PackageList =
(unsigned char *)CURL_UNCONST(TEXT("!ntlm"));
nego->identity.PackageList = CURL_UNCONST(TEXT("!ntlm"));
#endif
nego->identity.PackageListLength = 5;
@ -181,7 +179,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
/* Acquire our credentials handle */
nego->status = Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
CURL_UNCONST(TEXT(SP_NAME_NEGOTIATE)),
SECPKG_CRED_OUTBOUND, NULL,
nego->p_identity, NULL, NULL,
nego->credentials, NULL);

View file

@ -627,8 +627,7 @@ static CURLcode acquire_sspi_handle(struct Curl_cfilter *cf,
}
sspi_status =
Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(UNISP_NAME),
Curl_pSecFn->AcquireCredentialsHandle(NULL, CURL_UNCONST(UNISP_NAME),
SECPKG_CRED_OUTBOUND, NULL,
&credentials, NULL, NULL,
&backend->cred->cred_handle, NULL);
@ -677,8 +676,7 @@ static CURLcode acquire_sspi_handle(struct Curl_cfilter *cf,
}
sspi_status =
Curl_pSecFn->AcquireCredentialsHandle(NULL,
(TCHAR *)CURL_UNCONST(UNISP_NAME),
Curl_pSecFn->AcquireCredentialsHandle(NULL, CURL_UNCONST(UNISP_NAME),
SECPKG_CRED_OUTBOUND, NULL,
&schannel_cred, NULL, NULL,
&backend->cred->cred_handle, NULL);