fixup hide the typecasts by providing private defines for unsigned

This commit is contained in:
Daniel Stenberg 2026-03-03 14:06:33 +01:00
parent 9020b448ed
commit f48ae36221
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 6 additions and 3 deletions

View file

@ -37,4 +37,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host,
bool has_scheme);
#endif
#define U_CURLU_URLDECODE (unsigned int)CURLU_URLDECODE
#define U_CURLU_PATH_AS_IS (unsigned int)CURLU_PATH_AS_IS
#endif /* HEADER_CURL_URLAPI_INT_H */

View file

@ -1274,7 +1274,7 @@ static CURLUcode redirect_url(const char *base, const char *relurl,
if(!curlx_dyn_addn(&urlbuf, base, prelen) &&
!urlencode_str(&urlbuf, useurl, strlen(useurl), !host_changed, FALSE)) {
uc = parseurl_and_replace(curlx_dyn_ptr(&urlbuf), u,
flags & ~(unsigned int)CURLU_PATH_AS_IS);
flags & ~U_CURLU_PATH_AS_IS);
}
else
uc = CURLUE_OUT_OF_MEMORY;
@ -1555,7 +1555,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
case CURLUPART_SCHEME:
ptr = u->scheme;
ifmissing = CURLUE_NO_SCHEME;
flags &= ~(unsigned int)CURLU_URLDECODE; /* never for schemes */
flags &= ~U_CURLU_URLDECODE; /* never for schemes */
if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme)
return CURLUE_NO_SCHEME;
break;
@ -1582,7 +1582,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
case CURLUPART_PORT:
ptr = u->port;
ifmissing = CURLUE_NO_PORT;
flags &= ~(unsigned int)CURLU_URLDECODE; /* never for port */
flags &= ~ U_CURLU_URLDECODE; /* never for port */
if(!ptr && (flags & CURLU_DEFAULT_PORT) && u->scheme) {
/* there is no stored port number, but asked to deliver
a default one for the scheme */