vtls: Use '(void) arg' for unused parameters
Prefer void for unused parameters, rather than assigning an argument to itself as a) unintelligent compilers won't optimize it out, b) it can't be used for const parameters, c) it will cause compilation warnings for clang with -Wself-assign and d) is inconsistent with other areas of the curl source code.
This commit is contained in:
parent
56603e2770
commit
e9d0c7a6f3
@ -7,8 +7,8 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, DirecTV
|
||||
* contact: Eric Hu <ehu@directv.com>
|
||||
* Copyright (C) 2010, DirecTV, Contact: Eric Hu <ehu@directv.com>
|
||||
* Copyright (C) 2010 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -59,14 +59,15 @@ int Curl_axtls_random(struct SessionHandle *data,
|
||||
#define curlssl_close_all Curl_axtls_close_all
|
||||
#define curlssl_close Curl_axtls_close
|
||||
#define curlssl_shutdown(x,y) Curl_axtls_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_axtls_version
|
||||
#define curlssl_check_cxn(x) Curl_axtls_check_cxn(x)
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
|
||||
#define curlssl_random(x,y,z) Curl_axtls_random(x,y,z)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS
|
||||
|
||||
#endif /* USE_AXTLS */
|
||||
#endif /* HEADER_CURL_AXTLS_H */
|
||||
|
||||
|
@ -61,9 +61,9 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
|
||||
#define curlssl_close_all Curl_darwinssl_close_all
|
||||
#define curlssl_close Curl_darwinssl_close
|
||||
#define curlssl_shutdown(x,y) 0
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_darwinssl_version
|
||||
#define curlssl_check_cxn Curl_darwinssl_check_cxn
|
||||
#define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y)
|
||||
|
@ -102,11 +102,11 @@ int Curl_schannel_random(unsigned char *entropy, size_t length);
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_schannel_close
|
||||
#define curlssl_shutdown Curl_schannel_shutdown
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_schannel_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending Curl_schannel_data_pending
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_SCHANNEL
|
||||
#define curlssl_random(x,y,z) ((void)x, Curl_schannel_random(y,z))
|
||||
|
@ -56,11 +56,11 @@ int Curl_cyassl_random(struct SessionHandle *data,
|
||||
#define curlssl_close_all Curl_cyassl_close_all
|
||||
#define curlssl_close Curl_cyassl_close
|
||||
#define curlssl_shutdown(x,y) Curl_cyassl_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_cyassl_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending(x,y) Curl_cyassl_data_pending(x,y)
|
||||
#define curlssl_random(x,y,z) Curl_cyassl_random(x,y,z)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_CYASSL
|
||||
|
@ -62,12 +62,12 @@ void Curl_gtls_md5sum(unsigned char *tmp, /* input */
|
||||
#define curlssl_close_all Curl_gtls_close_all
|
||||
#define curlssl_close Curl_gtls_close
|
||||
#define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_gtls_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
|
||||
#define curlssl_random(x,y,z) Curl_gtls_random(x,y,z)
|
||||
#define curlssl_md5sum(a,b,c,d) Curl_gtls_md5sum(a,b,c,d)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
|
||||
|
@ -77,13 +77,13 @@ void Curl_nss_md5sum(unsigned char *tmp, /* input */
|
||||
#define curlssl_close_all Curl_nss_close_all
|
||||
#define curlssl_close Curl_nss_close
|
||||
/* NSS has no shutdown function provided and thus always fail */
|
||||
#define curlssl_shutdown(x,y) (x=x, y=y, 1)
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_shutdown(x,y) ((void)x, (void)y, 1)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_nss_version
|
||||
#define curlssl_check_cxn(x) Curl_nss_check_cxn(x)
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
|
||||
#define curlssl_random(x,y,z) Curl_nss_random(x,y,z)
|
||||
#define curlssl_md5sum(a,b,c,d) Curl_nss_md5sum(a,b,c,d)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_NSS
|
||||
|
@ -8,7 +8,7 @@
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
|
||||
* Copyright (C) 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2012 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -60,18 +60,18 @@ int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex);
|
||||
#define curlssl_close_all Curl_polarssl_close_all
|
||||
#define curlssl_close Curl_polarssl_close
|
||||
#define curlssl_shutdown(x,y) 0
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_polarssl_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_POLARSSL
|
||||
|
||||
/* This might cause libcurl to use a weeker random!
|
||||
TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that
|
||||
*/
|
||||
#define curlssl_random(x,y,z) (x=x, y=y, z=z, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_random(x,y,z) ((void)x, (void)y, (void)z, CURLE_NOT_BUILT_IN)
|
||||
|
||||
#endif /* USE_POLARSSL */
|
||||
#endif /* HEADER_CURL_POLARSSL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user