diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-05-31 13:42:31 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-06-01 08:12:09 +0200 |
commit | 4651945822eaae1ac34ab1179f7bd620cee6e4a8 (patch) | |
tree | 024eb4c796a6b08c64c4e7379283d6269a0c2242 /lib/setopt.c | |
parent | b1c1df0b6b82998142c0b974e4295e4288d545bf (diff) | |
download | curl-4651945822eaae1ac34ab1179f7bd620cee6e4a8.tar.gz |
urldata: reduce size of a few struct fields
When the values are never larger than 32 bit, ints are better than longs.
Closes #8940
Diffstat (limited to 'lib/setopt.c')
-rw-r--r-- | lib/setopt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/setopt.c b/lib/setopt.c index 47b8f8471..fa3c4766f 100644 --- a/lib/setopt.c +++ b/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 |