From 6f0bc43b08efcad3fc58cc3350fc86c4b78c3060 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 30 Mar 2025 13:27:13 +0200 Subject: [PATCH] easy: drop `break` after `return` Also some whitespace tidy-ups. Closes #16873 --- lib/setopt.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index a402b5a270..48332295ed 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -477,10 +477,10 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, primary->version = (unsigned char)version; primary->version_max = (unsigned int)version_max; } + break; #else return CURLE_NOT_BUILT_IN; #endif - break; case CURLOPT_POSTFIELDSIZE: /* * The size of the POSTFIELD data to prevent libcurl to do strlen() to @@ -1533,7 +1533,7 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ !defined(CURL_DISABLE_IMAP) # ifndef CURL_DISABLE_MIME - case CURLOPT_MIMEPOST: + case CURLOPT_MIMEPOST: /* * Set to make us do MIME POST */ @@ -1661,8 +1661,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) /* set a list of cipher we want to use in the SSL connection */ return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST], ptr); - return CURLE_NOT_BUILT_IN; - break; + else + return CURLE_NOT_BUILT_IN; #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_SSL_CIPHER_LIST: if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) { @@ -1672,7 +1672,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } else return CURLE_NOT_BUILT_IN; - break; #endif case CURLOPT_TLS13_CIPHERS: if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) { @@ -1681,7 +1680,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } else return CURLE_NOT_BUILT_IN; - break; #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_TLS13_CIPHERS: if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) @@ -1690,7 +1688,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, ptr); else return CURLE_NOT_BUILT_IN; - break; #endif case CURLOPT_RANDOM_FILE: break; @@ -1943,7 +1940,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * to decide for us (if CURLOPT_SOCKS_PROXY setting it to NULL). */ return Curl_setstropt(&data->set.str[STRING_PROXY], ptr); - break; case CURLOPT_PRE_PROXY: /* @@ -1968,7 +1964,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Set authentication service name for DIGEST-MD5, Kerberos 5 and SPNEGO */ return Curl_setstropt(&data->set.str[STRING_SERVICE_NAME], ptr); - break; case CURLOPT_HEADERDATA: /* @@ -2020,12 +2015,13 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Set a SSL_CTX callback parameter pointer */ #ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) + if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) { data->set.ssl.fsslctxp = ptr; + break; + } else #endif return CURLE_NOT_BUILT_IN; - break; case CURLOPT_SOCKOPTDATA: /* * socket callback data pointer. Might be NULL. @@ -2223,6 +2219,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * String that holds file type of the SSL certificate to use for proxy */ return Curl_setstropt(&data->set.str[STRING_CERT_TYPE_PROXY], ptr); + #endif case CURLOPT_SSLKEY: /* @@ -2243,7 +2240,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * String that holds file type of the SSL key to use */ return Curl_setstropt(&data->set.str[STRING_KEY_TYPE], ptr); - break; + #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_SSLKEYTYPE: /* @@ -2264,6 +2261,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * String that holds the SSL private key password for proxy. */ return Curl_setstropt(&data->set.str[STRING_KEY_PASSWD_PROXY], ptr); + #endif case CURLOPT_SSLENGINE: /* @@ -2286,6 +2284,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* enable the HAProxy protocol */ data->set.haproxyprotocol = TRUE; break; + #endif case CURLOPT_INTERFACE: /* @@ -2334,8 +2333,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * CA certificate */ return Curl_setstropt(&data->set.str[STRING_SSL_CAFILE_PROXY], ptr); -#endif +#endif case CURLOPT_CAPATH: /* * Set CA path info for SSL connection. Specify directory name of the CA @@ -2374,6 +2373,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * CRL to check certificates revocation */ return Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE_PROXY], ptr); + #endif case CURLOPT_ISSUERCERT: /* @@ -2391,7 +2391,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, return Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT_PROXY], ptr); #endif - case CURLOPT_PRIVATE: /* * Set private data pointer. @@ -2406,6 +2405,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Specify colon-delimited list of curve algorithm names. */ return Curl_setstropt(&data->set.str[STRING_SSL_EC_CURVES], ptr); + #endif #ifdef USE_SSH case CURLOPT_SSH_PUBLIC_KEYFILE: @@ -2484,7 +2484,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* Set the SMTP auth originator */ return Curl_setstropt(&data->set.str[STRING_MAIL_AUTH], ptr); #endif - case CURLOPT_SASL_AUTHZID: /* Authorization identity (identity to act as) */ return Curl_setstropt(&data->set.str[STRING_SASL_AUTHZID], ptr); @@ -2503,7 +2502,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * for generic server options, the application will need to set this. */ return Curl_setstropt(&data->set.str[STRING_RTSP_STREAM_URI], ptr); - break; case CURLOPT_RTSP_TRANSPORT: /* @@ -2773,12 +2771,13 @@ static CURLcode setopt_func(struct Curl_easy *data, CURLoption option, * Set a SSL_CTX callback */ #ifdef USE_SSL - if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) + if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) { data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback); + break; + } else #endif return CURLE_NOT_BUILT_IN; - break; case CURLOPT_SOCKOPTFUNCTION: /* @@ -2811,7 +2810,6 @@ static CURLcode setopt_func(struct Curl_easy *data, CURLoption option, data->set.resolver_start = va_arg(param, curl_resolver_start_callback); break; - #ifdef USE_SSH #ifdef USE_LIBSSH2 case CURLOPT_SSH_HOSTKEYFUNCTION: -- 2.47.2