uint32_t flags;
unsigned int fetch_key;
- fetch_key= (unsigned int)(random() % number_of);
+ fetch_key= (unsigned int)((unsigned int)random() % number_of);
value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length,
&value_length, &flags, &rc);
unsigned int x;
pairs_st *pairs;
- pairs= (pairs_st*)calloc(number_of + 1, sizeof(pairs_st));
+ pairs= (pairs_st*)calloc((size_t)number_of + 1, sizeof(pairs_st));
if (!pairs)
goto error;
}
gettimeofday(&end_time, NULL);
- elapsed_time= timedif(end_time, start_time);
- elapsed_time /= num_of_tests;
+ elapsed_time= (long) timedif(end_time, start_time);
+ elapsed_time /= (long) num_of_tests;
if (elapsed_time > slowest_time)
{
- slowest_server= x;
+ slowest_server= (long) x;
slowest_time= elapsed_time;
}