Fixes Codacy/CppCheck warnings.
Closes
BIO *cbio = BIO_new_mem_buf(mypem, sizeof(mypem));
X509_STORE *cts = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
X509_INFO *itmp;
- int i, count = 0;
+ int i;
STACK_OF(X509_INFO) *inf;
(void)curl;
(void)parm;
itmp = sk_X509_INFO_value(inf, i);
if(itmp->x509) {
X509_STORE_add_cert(cts, itmp->x509);
- count++;
}
if(itmp->crl) {
X509_STORE_add_crl(cts, itmp->crl);
- count++;
}
}
void *my_thread(void *ptr)
{
CURL *curl;
- CURLcode res;
FILE *outfile;
gchar *url = ptr;
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
- res = curl_easy_perform(curl);
+ curl_easy_perform(curl);
fclose(outfile);
/* always cleanup */
BIO_printf(p.errorbio, "%d %s %d\n", __LINE__, "curl_easy_perform",
res = curl_easy_perform(p.curl));
{
- int result = curl_easy_getinfo(p.curl, CURLINFO_CONTENT_TYPE, &response);
+ curl_easy_getinfo(p.curl, CURLINFO_CONTENT_TYPE, &response);
if(mimetypeaccept && p.verbose) {
if(!strcmp(mimetypeaccept, response))
BIO_printf(p.errorbio, "the response has a correct mimetype : %s\n",
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
{
struct itimerspec its;
- CURLMcode rc;
fprintf(MSG_OUT, "multi_timer_cb: Setting timeout to %ld ms\n", timeout_ms);
void *data)
{
size_t realsize = size * nmemb;
- ConnInfo *conn _Unused = (ConnInfo*) data;
+ (void)_Unused;
+ (void)data;
return realsize;
}
int main(int argc, char **argv)
{
GlobalInfo g;
- CURLMcode rc;
(void)argc;
(void)argv;
int main(int argc, char **argv)
{
GlobalInfo *g;
- CURLMcode rc;
GMainLoop*gmain;
int fd;
GIOChannel* ch;
void *data)
{
size_t realsize = size * nmemb;
- ConnInfo *conn _Unused = (ConnInfo*) data;
+ (void)_Unused;
+ (void)data;
return realsize;
}
{
pthread_t tid[NUMT];
int i;
- int error;
/* Must initialize libcurl before any threads are started */
curl_global_init(CURL_GLOBAL_ALL);
for(i = 0; i< NUMT; i++) {
- error = pthread_create(&tid[i],
- NULL, /* default attributes please */
- pull_one_url,
- (void *)urls[i]);
+ int error = pthread_create(&tid[i],
+ NULL, /* default attributes please */
+ pull_one_url,
+ (void *)urls[i]);
if(0 != error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
/* now wait for all threads to terminate */
for(i = 0; i< NUMT; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}
int main(void)
{
CURL *curl;
- CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
my_conv_from_utf8_to_ebcdic);
- res = curl_easy_perform(curl);
+ curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
void *pull_one_url(void *NaN)
{
CURL *curl;
- CURLcode res;
gchar *http;
FILE *outfile;
j++; /* critical line */
pthread_mutex_unlock(&lock);
- res = curl_easy_perform(curl);
+ curl_easy_perform(curl);
fclose(outfile);
printf("fclose\n");
{
pthread_t tid[NUMT];
int i;
- int error;
/* Make sure I don't create more threads than urls. */
for(i = 0; i < NUMT && i < num_urls ; i++) {
- error = pthread_create(&tid[i],
- NULL, /* default attributes please */
- pull_one_url,
- NULL);
+ int error = pthread_create(&tid[i],
+ NULL, /* default attributes please */
+ pull_one_url,
+ NULL);
if(0 != error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
/* Wait for all threads to terminate. */
for(i = 0; i < NUMT && i < num_urls; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}
{
pthread_t tid[NUM_THREADS];
int i;
- int error;
CURLSH *share;
struct initurl url[NUM_THREADS];
init_locks();
for(i = 0; i< NUM_THREADS; i++) {
+ int error;
url[i].url = URL;
url[i].share = share;
url[i].threadno = i;
/* now wait for all threads to terminate */
for(i = 0; i< NUM_THREADS; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}
{
pthread_t tid[NUMT];
int i;
- int error;
(void)argc; /* we don't use any arguments in this example */
(void)argv;
init_locks();
for(i = 0; i< NUMT; i++) {
- error = pthread_create(&tid[i],
- NULL, /* default attributes please */
- pull_one_url,
- (void *)urls[i]);
+ int error = pthread_create(&tid[i],
+ NULL, /* default attributes please */
+ pull_one_url,
+ (void *)urls[i]);
if(0 != error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
/* now wait for all threads to terminate */
for(i = 0; i< NUMT; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}