mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:33:36 +03:00
urldata: reduce size of a few struct fields
When the values are never larger than 32 bit, ints are better than longs. Closes #8940
This commit is contained in:
parent
b1c1df0b6b
commit
4651945822
3 changed files with 17 additions and 17 deletions
12
lib/setopt.c
12
lib/setopt.c
|
|
@ -2420,7 +2420,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
#ifdef USE_SSH
|
||||
/* we only include SSH options if explicitly built to support SSH */
|
||||
case CURLOPT_SSH_AUTH_TYPES:
|
||||
data->set.ssh_auth_types = va_arg(param, long);
|
||||
data->set.ssh_auth_types = (unsigned int)va_arg(param, long);
|
||||
break;
|
||||
|
||||
case CURLOPT_SSH_PUBLIC_KEYFILE:
|
||||
|
|
@ -2508,7 +2508,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
arg = va_arg(param, long);
|
||||
if((arg < 0) || (arg > 0777))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
data->set.new_file_perms = arg;
|
||||
data->set.new_file_perms = (unsigned int)arg;
|
||||
break;
|
||||
|
||||
case CURLOPT_NEW_DIRECTORY_PERMS:
|
||||
|
|
@ -2518,7 +2518,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
arg = va_arg(param, long);
|
||||
if((arg < 0) || (arg > 0777))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
data->set.new_directory_perms = arg;
|
||||
data->set.new_directory_perms = (unsigned int)arg;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
@ -2543,14 +2543,14 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
transfer, which thus helps the app which takes URLs from users or other
|
||||
external inputs and want to restrict what protocol(s) to deal
|
||||
with. Defaults to CURLPROTO_ALL. */
|
||||
data->set.allowed_protocols = va_arg(param, long);
|
||||
data->set.allowed_protocols = (unsigned int)va_arg(param, long);
|
||||
break;
|
||||
|
||||
case CURLOPT_REDIR_PROTOCOLS:
|
||||
/* set the bitmask for the protocols that libcurl is allowed to follow to,
|
||||
as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
|
||||
to be set in both bitmasks to be allowed to get redirected to. */
|
||||
data->set.redir_protocols = va_arg(param, long);
|
||||
data->set.redir_protocols = (unsigned int)va_arg(param, long);
|
||||
break;
|
||||
|
||||
case CURLOPT_DEFAULT_PROTOCOL:
|
||||
|
|
@ -2584,7 +2584,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_MIME)) || \
|
||||
!defined(CURL_DISABLE_SMTP) || !defined(CURL_DISABLE_IMAP)
|
||||
case CURLOPT_MIME_OPTIONS:
|
||||
data->set.mime_options = va_arg(param, long);
|
||||
data->set.mime_options = (unsigned int)va_arg(param, long);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue