diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c index 410a0f70ce..40fa50fe83 100644 --- a/CMake/CurlTests.c +++ b/CMake/CurlTests.c @@ -87,7 +87,7 @@ int main(void) #elif defined(HAVE_GETHOSTBYNAME_R_5) || \ defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop); - (void)hp; /* not used for test */ + (void)hp; (void)h_errnop; #elif defined(HAVE_GETHOSTBYNAME_R_6) || \ defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT) diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index fc40814696..264c514ba4 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -56,8 +56,8 @@ static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data) { /* we are not interested in the downloaded bytes itself, so we only return the size we would have saved ... */ - (void)ptr; /* unused */ - (void)data; /* unused */ + (void)ptr; + (void)data; return (size_t)(size * nmemb); } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 426caf82d5..7cf1ed2a5c 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1444,7 +1444,7 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, size_t orig_len = len; CURLcode result = CURLE_OK; - (void)eos; /* unused */ + (void)eos; *pnwritten = 0; fdsave = cf->conn->sock[cf->sockindex]; cf->conn->sock[cf->sockindex] = ctx->sock; diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index b178dff845..baee79fbee 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -307,9 +307,9 @@ static CURLcode rtmp_do(struct Curl_easy *data, bool *done) static CURLcode rtmp_done(struct Curl_easy *data, CURLcode status, bool premature) { - (void)data; /* unused */ - (void)status; /* unused */ - (void)premature; /* unused */ + (void)data; + (void)status; + (void)premature; return CURLE_OK; } @@ -334,7 +334,7 @@ static CURLcode rtmp_recv(struct Curl_easy *data, int sockindex, char *buf, CURLcode result = CURLE_OK; ssize_t nread; - (void)sockindex; /* unused */ + (void)sockindex; *pnread = 0; if(!r) return CURLE_FAILED_INIT; @@ -362,8 +362,8 @@ static CURLcode rtmp_send(struct Curl_easy *data, int sockindex, RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN); ssize_t nwritten; - (void)sockindex; /* unused */ - (void)eos; /* unused */ + (void)sockindex; + (void)eos; *pnwritten = 0; if(!r) return CURLE_FAILED_INIT; diff --git a/lib/file.c b/lib/file.c index 0b44d2257d..749759653d 100644 --- a/lib/file.c +++ b/lib/file.c @@ -292,8 +292,8 @@ static CURLcode file_done(struct Curl_easy *data, CURLcode status, bool premature) { struct FILEPROTO *file = Curl_meta_get(data, CURL_META_FILE_EASY); - (void)status; /* not used */ - (void)premature; /* not used */ + (void)status; + (void)premature; if(file) file_cleanup(file); @@ -305,7 +305,7 @@ static CURLcode file_disconnect(struct Curl_easy *data, struct connectdata *conn, bool dead_connection) { - (void)dead_connection; /* not used */ + (void)dead_connection; (void)conn; return file_done(data, CURLE_OK, FALSE); } diff --git a/lib/hostip.c b/lib/hostip.c index dfff9d61da..2d122fb999 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -1136,14 +1136,14 @@ CURLcode Curl_resolv_timeout(struct Curl_easy *data, Curl_resolve_test_delay(); #endif -#else /* USE_ALARM_TIMEOUT */ +#else /* !USE_ALARM_TIMEOUT */ #ifndef CURLRES_ASYNCH if(timeoutms) infof(data, "timeout on name lookup is not supported"); #else - (void)timeoutms; /* timeoutms not used with an async resolver */ + (void)timeoutms; #endif -#endif /* else USE_ALARM_TIMEOUT */ +#endif /* USE_ALARM_TIMEOUT */ /* Perform the actual name resolution. This might be interrupted by an * alarm if it takes too long. diff --git a/lib/http.c b/lib/http.c index bcbe6e9e75..7812cbd0aa 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2995,7 +2995,7 @@ checkrtspprefix(struct Curl_easy *data, { statusline result = STATUS_BAD; statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN; - (void)data; /* unused */ + (void)data; if(checkprefixmax("RTSP/", s, len)) result = onmatch; diff --git a/lib/krb5.c b/lib/krb5.c index 40243bddb5..78c2a4ff53 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -130,7 +130,7 @@ krb5_init(void *app_data) static int krb5_check_prot(void *app_data, int level) { - (void)app_data; /* unused */ + (void)app_data; if(level == PROT_CONFIDENTIAL) return -1; return 0; @@ -470,7 +470,7 @@ static int ftp_send_command(struct Curl_easy *data, const char *message, ...) ftp_code = -1; } - (void)nread; /* Unused */ + (void)nread; return ftp_code; } @@ -703,7 +703,7 @@ static CURLcode sec_send(struct Curl_easy *data, int sockindex, const void *buffer, size_t len, bool eos, size_t *pnwritten) { - (void)eos; /* unused */ + (void)eos; return sec_write(data, sockindex, buffer, len, pnwritten); } diff --git a/lib/multi.c b/lib/multi.c index 1c09b14b6b..906ccf66b5 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1161,7 +1161,7 @@ CURLMcode curl_multi_fdset(CURLM *m, struct Curl_multi *multi = m; struct easy_pollset ps; unsigned int i, mid; - (void)exc_fd_set; /* not used */ + (void)exc_fd_set; if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -1860,7 +1860,7 @@ static void multi_posttransfer(struct Curl_easy *data) if(!data->set.no_signal) signal(SIGPIPE, data->state.prev_signal); #else - (void)data; /* unused parameter */ + (void)data; #endif } diff --git a/lib/telnet.c b/lib/telnet.c index 731789e463..cc827c1b3e 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1287,8 +1287,8 @@ static CURLcode send_telnet_data(struct Curl_easy *data, static CURLcode telnet_done(struct Curl_easy *data, CURLcode status, bool premature) { - (void)status; /* unused */ - (void)premature; /* not used */ + (void)status; + (void)premature; Curl_meta_remove(data, CURL_META_TELNET_EASY); return CURLE_OK; } diff --git a/lib/tftp.c b/lib/tftp.c index 6a9f964a07..4c2fadc2ca 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -1061,8 +1061,8 @@ static CURLcode tftp_done(struct Curl_easy *data, CURLcode status, struct connectdata *conn = data->conn; struct tftp_conn *state = Curl_conn_meta_get(conn, CURL_META_TFTP_CONN); - (void)status; /* unused */ - (void)premature; /* not used */ + (void)status; + (void)premature; if(Curl_pgrsDone(data)) return CURLE_ABORTED_BY_CALLBACK; diff --git a/lib/version.c b/lib/version.c index aeb133ec73..a2d4867200 100644 --- a/lib/version.c +++ b/lib/version.c @@ -624,7 +624,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp) static char zstd_buffer[80]; #endif - (void)stamp; /* avoid compiler warnings, we do not use this */ + (void)stamp; #ifdef USE_SSL Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 2898a70f0a..695532ff85 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -2840,7 +2840,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, bool premature) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); - (void)premature; /* not used */ + (void)premature; if(!sshc) return CURLE_FAILED_INIT; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 13f374564f..5dfc377ec1 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -276,19 +276,19 @@ static CURLcode libssh2_session_error_to_CURLE(int err) static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc) { - (void)abstract; /* arg not used */ + (void)abstract; return Curl_cmalloc(count); } static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc) { - (void)abstract; /* arg not used */ + (void)abstract; return Curl_crealloc(ptr, count); } static LIBSSH2_FREE_FUNC(my_libssh2_free) { - (void)abstract; /* arg not used */ + (void)abstract; if(ptr) /* ssh2 agent sometimes call free with null ptr */ Curl_cfree(ptr); } @@ -3732,7 +3732,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, bool premature) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); - (void)premature; /* not used */ + (void)premature; if(sshc && !status) myssh_state(data, sshc, SSH_SCP_DONE); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 5971d9a358..a49203ab07 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5517,9 +5517,9 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, return CURLE_OK; #else /* No X509_get_signature_nid support */ - (void)data; /* unused */ - (void)sockindex; /* unused */ - (void)binding; /* unused */ + (void)data; + (void)sockindex; + (void)binding; return CURLE_OK; #endif } diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index ea06d31ab0..6bd4805cea 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1459,7 +1459,7 @@ static bool cert_counter_callback(const CERT_CONTEXT *ccert_context, bool reverse_order, void *certs_count) { - (void)reverse_order; /* unused */ + (void)reverse_order; if(valid_cert_encoding(ccert_context)) (*(int *)certs_count)++; return TRUE; diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c index 0b36236ab7..6a587cc1cc 100644 --- a/src/tool_cb_dbg.c +++ b/src/tool_cb_dbg.c @@ -91,7 +91,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, char idsbuf[60]; curl_off_t xfer_id, conn_id; - (void)handle; /* not used */ + (void)handle; (void)userdata; if(global->tracetime) { diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 5b8ba62a56..0a3e9ef0ee 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -146,10 +146,10 @@ int tool_readbusy_cb(void *clientp, struct OperationConfig *config = per->config; static curl_off_t ulprev; - (void)dltotal; /* unused */ - (void)dlnow; /* unused */ - (void)ultotal; /* unused */ - (void)ulnow; /* unused */ + (void)dltotal; + (void)dlnow; + (void)ultotal; + (void)ulnow; if(config->readbusy) { if(ulprev == ulnow) { diff --git a/tests/libtest/lib1533.c b/tests/libtest/lib1533.c index 15256deaf0..ff5c83cc82 100644 --- a/tests/libtest/lib1533.c +++ b/tests/libtest/lib1533.c @@ -77,7 +77,6 @@ static size_t t1533_write_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct cb_data *data = (struct cb_data *)userp; size_t totalsize = nmemb * size; - /* unused parameter */ (void)ptr; /* all response headers have been received */ diff --git a/tests/libtest/lib1550.c b/tests/libtest/lib1550.c index 6fedbf6884..11583aec47 100644 --- a/tests/libtest/lib1550.c +++ b/tests/libtest/lib1550.c @@ -38,7 +38,7 @@ static CURLcode test_lib1550(const char *URL) global_init(CURL_GLOBAL_ALL); handle = curl_multi_init(); - (void)URL; /* unused */ + (void)URL; curl_multi_setopt(handle, CURLMOPT_PIPELINING_SERVER_BL, bl_servers); curl_multi_setopt(handle, CURLMOPT_PIPELINING_SITE_BL, bl_sites); diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 99112389fe..1973d8a916 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -2036,7 +2036,7 @@ static CURLcode test_lib1560(const char *URL) { bool has_utf8 = !!getenv("CURL_TEST_HAVE_CODESET_UTF8"); - (void)URL; /* not used */ + (void)URL; if(urldup()) return (CURLcode)11; diff --git a/tests/libtest/lib1971.c b/tests/libtest/lib1971.c index 03b254c1c5..bc25226bde 100644 --- a/tests/libtest/lib1971.c +++ b/tests/libtest/lib1971.c @@ -27,10 +27,10 @@ static size_t t1971_read_cb(char *ptr, size_t size, size_t nitems, void *userp) { - (void)ptr; /* unused */ - (void)size; /* unused */ - (void)nitems; /* unused */ - (void)userp; /* unused */ + (void)ptr; + (void)size; + (void)nitems; + (void)userp; return 0; } diff --git a/tests/libtest/lib1975.c b/tests/libtest/lib1975.c index 95db9ae58d..d6c05a1251 100644 --- a/tests/libtest/lib1975.c +++ b/tests/libtest/lib1975.c @@ -27,10 +27,10 @@ static size_t t1975_read_cb(char *ptr, size_t size, size_t nitems, void *userp) { - (void)ptr; /* unused */ - (void)size; /* unused */ - (void)nitems; /* unused */ - (void)userp; /* unused */ + (void)ptr; + (void)size; + (void)nitems; + (void)userp; return 0; } diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index cf1a14d31c..85950dd866 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -164,7 +164,7 @@ static CURLcode test_lib517(const char *URL) int i; int error = 0; - (void)URL; /* not used */ + (void)URL; for(i = 0; dates[i].input; i++) { time_t out = curl_getdate(dates[i].input, NULL); diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index e6fe6ceff0..7d8cc3cbcb 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -136,8 +136,8 @@ static int t530_curlSocketCallback(CURL *easy, curl_socket_t s, int action, { struct t530_ReadWriteSockets *sockets = userp; - (void)easy; /* unused */ - (void)socketp; /* unused */ + (void)easy; + (void)socketp; t530_ctx.socket_calls++; t530_msg("-> CURLMOPT_SOCKETFUNCTION"); @@ -169,7 +169,7 @@ static int t530_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) { struct curltime *timeout = userp; - (void)multi; /* unused */ + (void)multi; t530_ctx.timer_calls++; t530_msg("-> CURLMOPT_TIMERFUNCTION"); if(t530_ctx.timer_calls == t530_ctx.max_timer_calls) { diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index e3597d6d3e..6114d57aab 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -56,7 +56,7 @@ static size_t t547_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) static curlioerr t547_ioctl_callback(CURL *handle, int cmd, void *clientp) { int *counter = (int *)clientp; - (void)handle; /* unused */ + (void)handle; if(cmd == CURLIOCMD_RESTARTREAD) { curl_mfprintf(stderr, "REWIND!\n"); *counter = 0; /* clear counter to make the read callback restart */ diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 30438bafa9..fe3b692117 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -60,7 +60,7 @@ static size_t t555_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp) static curlioerr t555_ioctl_callback(CURL *handle, int cmd, void *clientp) { int *counter = (int *)clientp; - (void)handle; /* unused */ + (void)handle; if(cmd == CURLIOCMD_RESTARTREAD) { curl_mfprintf(stderr, "REWIND!\n"); *counter = 0; /* clear counter to make the read callback restart */ diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 61b051a43c..dd0e2e7c4d 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1535,7 +1535,7 @@ static int test_return_codes(void) static CURLcode test_lib557(const char *URL) { int errors = 0; - (void)URL; /* not used */ + (void)URL; #ifdef HAVE_SETLOCALE /* diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c index 5b46c8e622..a15c9a4f81 100644 --- a/tests/libtest/lib578.c +++ b/tests/libtest/lib578.c @@ -35,9 +35,9 @@ static int t578_progress_callback(void *clientp, double dltotal, double dlnow, { FILE *moo = fopen(libtest_arg2, "wb"); - (void)clientp; /* UNUSED */ - (void)dltotal; /* UNUSED */ - (void)dlnow; /* UNUSED */ + (void)clientp; + (void)dltotal; + (void)dlnow; if(moo) { if((size_t)ultotal == data_size && (size_t)ulnow == data_size) diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index 4f6b67e540..76ecefe4ec 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -48,9 +48,9 @@ static void progress_final_report(void) static int t579_progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { - (void)clientp; /* UNUSED */ - (void)dltotal; /* UNUSED */ - (void)dlnow; /* UNUSED */ + (void)clientp; + (void)dltotal; + (void)dlnow; if(started && ulnow <= 0.0 && last_ul) { progress_final_report(); diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index 8ca87d459d..70a9ab65dc 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -97,8 +97,8 @@ static int t582_curlSocketCallback(CURL *easy, curl_socket_t s, int action, { struct t582_ReadWriteSockets *sockets = userp; - (void)easy; /* unused */ - (void)socketp; /* unused */ + (void)easy; + (void)socketp; if(action == CURL_POLL_IN || action == CURL_POLL_INOUT) t582_addFd(&sockets->read, s, "read"); @@ -121,7 +121,7 @@ static int t582_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) { struct curltime *timeout = userp; - (void)multi; /* unused */ + (void)multi; if(timeout_ms != -1) { *timeout = curlx_now(); timeout->tv_usec += (int)timeout_ms * 1000; diff --git a/tests/libtest/lib758.c b/tests/libtest/lib758.c index f98309f247..e9fe4ea2c9 100644 --- a/tests/libtest/lib758.c +++ b/tests/libtest/lib758.c @@ -184,7 +184,7 @@ static int t758_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) { struct curltime *timeout = userp; - (void)multi; /* unused */ + (void)multi; t758_ctx.timer_calls++; t758_msg("-> CURLMOPT_TIMERFUNCTION"); if(t758_ctx.timer_calls == t758_ctx.max_timer_calls) { @@ -204,7 +204,7 @@ static int t758_curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) static int t758_cert_verify_callback(X509_STORE_CTX *ctx, void *arg) { SSL * ssl; - (void)arg; /* unused */ + (void)arg; ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); t758_ctx.number_of_cert_verify_callbacks++; @@ -227,7 +227,7 @@ static CURLcode t758_set_ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *clientp) { SSL_CTX *ctx = (SSL_CTX *) ssl_ctx; - (void)curl; /* unused */ + (void)curl; SSL_CTX_set_cert_verify_callback(ctx, t758_cert_verify_callback, clientp); return CURLE_OK; } diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index 23782d74ca..e0a7d157d8 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -352,7 +352,7 @@ static CURLcode test_lib1521(const char *URL) struct curl_tlssessioninfo *tlssession; struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0}; CURLcode res = CURLE_OK; - (void)URL; /* not used */ + (void)URL; global_init(CURL_GLOBAL_ALL); easy_init(dep); easy_init(curl); diff --git a/tests/libtest/testtrace.c b/tests/libtest/testtrace.c index b221f38cd0..8aa377fb0c 100644 --- a/tests/libtest/testtrace.c +++ b/tests/libtest/testtrace.c @@ -166,7 +166,7 @@ int cli_debug_cb(CURL *handle, curl_infotype type, char idsbuf[60]; curl_off_t xfer_id, conn_id; - (void)handle; /* not used */ + (void)handle; (void)userp; if(!curl_easy_getinfo(handle, CURLINFO_XFER_ID, &xfer_id) && xfer_id >= 0) { diff --git a/tests/unit/unit1603.c b/tests/unit/unit1603.c index f6e39dc688..d59b458d57 100644 --- a/tests/unit/unit1603.c +++ b/tests/unit/unit1603.c @@ -32,16 +32,16 @@ static const size_t slots = 3; static void t1603_mydtor(void *p) { /* Data are statically allocated */ - (void)p; /* unused */ + (void)p; } static size_t elem_dtor_calls; static void my_elem_dtor(void *key, size_t key_len, void *p) { - (void)p; /* unused */ - (void)key; /* unused */ - (void)key_len; /* unused */ + (void)p; + (void)key; + (void)key_len; ++elem_dtor_calls; }