#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)
int i;
STACK_OF(X509_INFO) *inf;
- (void)curl; /* avoid warnings */
- (void)pointer; /* avoid warnings */
+ (void)curl;
+ (void)pointer;
if(!cts || !cbio) {
return rv;
{
/* 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);
}
{
struct data *config = (struct data *)userp;
const char *text;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
switch(type) {
case CURLINFO_TEXT:
const char *text;
struct transfer *t = (struct transfer *)userp;
unsigned int num = t->num;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
switch(type) {
case CURLINFO_TEXT:
{
char *headp;
int *transfers = (int *)userp;
- (void)parent; /* we have no use for this */
- (void)num_headers; /* unused */
+ (void)parent;
+ (void)num_headers;
if(pushindex == MAX_FILES)
/* cannot fit anymore */
void *userp)
{
const char *text;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
(void)userp;
switch(type) {
case CURLINFO_TEXT:
FILE *out;
static unsigned int count = 0;
- (void)parent; /* we have no use for this */
+ (void)parent;
curl_msnprintf(filename, 128, "push%u", count++);
struct timeval tv;
time_t secs;
struct tm *now;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
gettimeofday(&tv, NULL);
if(!known_offset) {
const char *text;
(void)userp;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
switch(type) {
case CURLINFO_TEXT:
{
pthread_t tid[NUMT];
int i;
- (void)argc; /* we do not use any arguments in this example */
+ (void)argc;
(void)argv;
/* Must initialize libcurl before any threads are started */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"
"-----END RSA PRIVATE KEY-----\n";
- (void)curl; /* avoid warnings */
- (void)pointer; /* avoid warnings */
+ (void)curl;
+ (void)pointer;
/* get a BIO */
bio = BIO_new_mem_buf((char *)mypem, -1);
void *clientp)
{
const char *text;
- (void)handle; /* prevent compiler warning */
+ (void)handle;
(void)clientp;
switch(type) {
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;
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;
}
CURLcode result = CURLE_OK;
ssize_t nread;
- (void)sockindex; /* unused */
+ (void)sockindex;
*pnread = 0;
if(!r)
return CURLE_FAILED_INIT;
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;
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);
struct connectdata *conn,
bool dead_connection)
{
- (void)dead_connection; /* not used */
+ (void)dead_connection;
(void)conn;
return file_done(data, CURLE_OK, FALSE);
}
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.
{
statusline result = STATUS_BAD;
statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN;
- (void)data; /* unused */
+ (void)data;
if(checkprefixmax("RTSP/", s, len))
result = onmatch;
int imapcode,
imapstate instate)
{
- (void)instate; /* no use for this yet */
+ (void)instate;
if(imapcode == IMAP_RESP_PREAUTH) {
/* PREAUTH */
struct connectdata *conn = data->conn;
const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf);
- (void)instate; /* no use for this yet */
+ (void)instate;
/* Do we have an untagged response? */
if(imapcode == '*') {
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
/* Pipelining in response is forbidden. */
if(imapc->pp.overflow)
CURLcode result = CURLE_OK;
saslprogress progress;
- (void)instate; /* no use for this yet */
+ (void)instate;
result = Curl_sasl_continue(&imapc->sasl, data, imapcode, &progress);
if(!result)
imapstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(imapcode != IMAP_RESP_OK) {
failf(data, "Access denied. %c", imapcode);
char *line = curlx_dyn_ptr(&imapc->pp.recvbuf);
size_t len = imapc->pp.nfinal;
- (void)instate; /* No use for this yet */
+ (void)instate;
if(imapcode == '*')
result = Curl_client_write(data, CLIENTWRITE_BODY, line, len);
CURLcode result = CURLE_OK;
const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf);
- (void)instate; /* no use for this yet */
+ (void)instate;
if(imapcode == '*') {
/* See if this is an UIDVALIDITY response */
bool parsed = FALSE;
curl_off_t size = 0;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(imapcode != '*') {
Curl_pgrsSetDownloadSize(data, -1);
{
CURLcode result = CURLE_OK;
- (void)instate; /* No use for this yet */
+ (void)instate;
if(imapcode != IMAP_RESP_OK)
result = CURLE_WEIRD_SERVER_REPLY;
imapstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* No use for this yet */
+ (void)instate;
if(imapcode != '+') {
result = CURLE_UPLOAD_FAILED;
{
CURLcode result = CURLE_OK;
- (void)instate; /* No use for this yet */
+ (void)instate;
if(imapcode != IMAP_RESP_OK)
result = CURLE_UPLOAD_FAILED;
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;
ftp_code = -1;
}
- (void)nread; /* Unused */
+ (void)nread;
return ftp_code;
}
const void *buffer, size_t len, bool eos,
size_t *pnwritten)
{
- (void)eos; /* unused */
+ (void)eos;
return sec_write(data, sockindex, buffer, len, pnwritten);
}
{
curl_mimepart *part = (curl_mimepart *) instream;
size_t sz = curlx_sotouz(part->datasize - part->state.offset);
- (void)size; /* Always 1.*/
+ (void)size; /* Always 1 */
if(!nitems)
return STOP_FILLING;
{
curl_mime *mime = (curl_mime *) instream;
size_t cursize = 0;
- (void)size; /* Always 1. */
+ (void)size; /* Always 1 */
while(nitems) {
size_t sz = 0;
size_t ret;
bool hasread;
- (void)size; /* Always 1. */
+ (void)size; /* Always 1 */
/* If `nitems` is <= 4, some encoders will return STOP_FILLING without
* adding any data and this loops infinitely. */
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;
if(!data->set.no_signal)
signal(SIGPIPE, data->state.prev_signal);
#else
- (void)data; /* unused parameter */
+ (void)data;
#endif
}
const char *line;
size_t len;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3c)
return CURLE_FAILED_INIT;
const char *line;
size_t len;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3c)
return CURLE_FAILED_INIT;
{
struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN);
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3c)
return CURLE_FAILED_INIT;
struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN);
saslprogress progress;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3c)
return CURLE_FAILED_INIT;
pop3state instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(pop3code != '+') {
failf(data, "Authentication failed: %d", pop3code);
CURLcode result = CURLE_OK;
struct connectdata *conn = data->conn;
struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN);
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3c)
return CURLE_FAILED_INIT;
pop3state instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(pop3code != '+') {
failf(data, "Access denied. %c", pop3code);
struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN);
struct pingpong *pp;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(!pop3 || !pop3c)
return CURLE_FAILED_INIT;
smtpstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode/100 != 2) {
failf(data, "Got unexpected smtp-server response: %d", smtpcode);
smtpstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
/* Pipelining in response is forbidden. */
if(smtpc->pp.overflow)
const char *line = curlx_dyn_ptr(&smtpc->pp.recvbuf);
size_t len = smtpc->pp.nfinal;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode/100 != 2 && smtpcode != 1) {
if(data->set.use_ssl <= CURLUSESSL_TRY
smtpstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode/100 != 2) {
failf(data, "Remote access denied: %d", smtpcode);
CURLcode result = CURLE_OK;
saslprogress progress;
- (void)instate; /* no use for this yet */
+ (void)instate;
result = Curl_sasl_continue(&smtpc->sasl, data, smtpcode, &progress);
if(!result)
char *line = curlx_dyn_ptr(&smtpc->pp.recvbuf);
size_t len = smtpc->pp.nfinal;
- (void)instate; /* no use for this yet */
+ (void)instate;
if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) ||
(!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) {
smtpstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode/100 != 2) {
failf(data, "MAIL failed: %d", smtpcode);
bool is_smtp_err = FALSE;
bool is_smtp_blocking_err = FALSE;
- (void)instate; /* no use for this yet */
+ (void)instate;
is_smtp_err = (smtpcode/100 != 2);
smtpstate instate)
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode != 354) {
failf(data, "DATA failed: %d", smtpcode);
{
CURLcode result = CURLE_OK;
- (void)instate; /* no use for this yet */
+ (void)instate;
if(smtpcode != 250)
result = CURLE_WEIRD_SERVER_REPLY;
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;
}
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;
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));
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;
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);
}
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);
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
}
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;
char idsbuf[60];
curl_off_t xfer_id, conn_id;
- (void)handle; /* not used */
+ (void)handle;
(void)userdata;
if(global->tracetime) {
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) {
static unsigned int count = 0;
int rv;
- (void)parent; /* we have no use for this */
+ (void)parent;
curl_msnprintf(filename, sizeof(filename) - 1, "push%u", count++);
/* here's a new stream, save it in a new file for each new push */
struct curl_slist *slist = NULL;
size_t i;
char target_url[256];
- (void)URL; /* URL is setup in the code */
+ (void)URL;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
curl_mfprintf(stderr, "curl_global_init() failed\n");
struct cb_data *data = (struct cb_data *)userp;
size_t totalsize = nmemb * size;
- /* unused parameter */
(void)ptr;
/* all response headers have been received */
int outlen = 0;
char *raw;
- (void)URL; /* we don't use this */
+ (void)URL;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
curl_mfprintf(stderr, "curl_global_init() failed\n");
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);
{
bool has_utf8 = !!getenv("CURL_TEST_HAVE_CODESET_UTF8");
- (void)URL; /* not used */
+ (void)URL;
if(urldup())
return (CURLcode)11;
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;
}
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;
}
CURLcode res;
CURL *curl;
- (void)URL; /* we don't use this */
+ (void)URL;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
curl_mfprintf(stderr, "curl_global_init() failed\n");
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);
{
struct t530_ReadWriteSockets *sockets = userp;
- (void)easy; /* unused */
- (void)socketp; /* unused */
+ (void)easy;
+ (void)socketp;
t530_ctx.socket_calls++;
t530_msg("-> CURLMOPT_SOCKETFUNCTION");
{
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) {
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 */
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 */
static CURLcode test_lib557(const char *URL)
{
int errors = 0;
- (void)URL; /* not used */
+ (void)URL;
#ifdef HAVE_SETLOCALE
/*
char *ptr = NULL;
int asize;
- (void)URL; /* we don't use this */
+ (void)URL;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
curl_mfprintf(stderr, "curl_global_init() failed\n");
{
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)
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();
{
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");
{
struct curltime *timeout = userp;
- (void)multi; /* unused */
+ (void)multi;
if(timeout_ms != -1) {
*timeout = curlx_now();
timeout->tv_usec += (int)timeout_ms * 1000;
struct t668_WriteThis *pooh = (struct t668_WriteThis *)userp;
size_t len = strlen(pooh->readptr);
- (void)size; /* Always 1.*/
+ (void)size; /* Always 1 */
if(len > nmemb)
len = nmemb;
{
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) {
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++;
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;
}
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);
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) {
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;
}