uint32_t flags;
unsigned int fetch_key;
- fetch_key= (unsigned int)(random() % number_of);
+ fetch_key= (unsigned int)random() % number_of;
value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length,
&value_length, &flags, &rc);
pairs_st *pairs_generate(uint64_t number_of, size_t value_length)
{
unsigned int x;
- pairs_st *pairs;
-
- pairs= (pairs_st*)calloc(number_of + 1, sizeof(pairs_st));
+ pairs_st *pairs= 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)num_of_tests;
if (elapsed_time > slowest_time)
{
- slowest_server= x;
+ slowest_server= (long)x;
slowest_time= elapsed_time;
}
static memcached_return binary_incr_decr(memcached_st *ptr, uint8_t cmd,
const char *key, size_t key_length,
uint64_t offset, uint64_t initial,
- time_t expiration,
+ uint32_t expiration,
uint64_t *value)
{
unsigned int server_key;
LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_START();
if (ptr->flags & MEM_BINARY_PROTOCOL)
rc= binary_incr_decr(ptr, PROTOCOL_BINARY_CMD_INCREMENT, key,
- key_length, offset, initial, expiration, value);
+ key_length, offset, initial, (uint32_t)expiration,
+ value);
else
rc= MEMCACHED_PROTOCOL_ERROR;
LIBMEMCACHED_MEMCACHED_DECREMENT_WITH_INITIAL_START();
if (ptr->flags & MEM_BINARY_PROTOCOL)
rc= binary_incr_decr(ptr, PROTOCOL_BINARY_CMD_DECREMENT, key,
- key_length, offset, initial, expiration, value);
+ key_length, offset, initial, (uint32_t)expiration,
+ value);
else
rc= MEMCACHED_PROTOCOL_ERROR;
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout);
- timeout= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
+ timeout= (size_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
assert(timeout == 100);