break;
default:
- for (size_t x= 0; x < host_index; ++x)
+ for (ptrdiff_t x= 0; x < host_index; ++x)
{
if (fds[x].revents & POLLIN)
{
// we just check the size of the key
if (memc.flags.verify_key == false or memc.flags.binary_protocol == true)
{
- for (uint32_t x= 0; x < number_of_keys; x++)
+ for (size_t x= 0; x < number_of_keys; x++)
{
// We should set binary key, but the memcached server is broken for
// longer keys at the moment.
return MEMCACHED_SUCCESS;
}
- for (uint32_t x= 0; x < number_of_keys; x++)
+ for (size_t x= 0; x < number_of_keys; x++)
{
memcached_return_t rc= memcached_validate_key_length(*(key_length + x), false);
if (memcached_failed(rc))
char *key= result->item_key;
result->key_length= 0;
- for (size_t prefix_length= memcached_array_size(instance->root->_namespace); !(iscntrl(*string_ptr) || isspace(*string_ptr)) ; string_ptr++)
+ for (ptrdiff_t prefix_length= memcached_array_size(instance->root->_namespace); !(iscntrl(*string_ptr) || isspace(*string_ptr)) ; string_ptr++)
{
if (prefix_length == 0)
{
* into the list, but if we don't know the ID we don't know how to handle
* the context...
*/
- size_t total= 0;
+ ptrdiff_t total= 0;
while (source->sasl.callbacks[total].id != SASL_CB_LIST_END)
{
memcpy(callbacks, source->sasl.callbacks, (total + 1) * sizeof(sasl_callback_t));
/* Now update the context... */
- for (size_t x= 0; x < total; ++x)
+ for (ptrdiff_t x= 0; x < total; ++x)
{
if (callbacks[x].id == SASL_CB_USER || callbacks[x].id == SASL_CB_AUTHNAME)
{
if (callbacks[x].context == NULL)
{
/* Failed to allocate memory, clean up previously allocated memory */
- for (size_t y= 0; y < x; ++y)
+ for (ptrdiff_t y= 0; y < x; ++y)
{
libmemcached_free(clone, clone->sasl.callbacks[y].context);
}
if (n == NULL)
{
/* Failed to allocate memory, clean up previously allocated memory */
- for (size_t y= 0; y < x; ++y)
+ for (ptrdiff_t y= 0; y < x; ++y)
{
libmemcached_free(clone, clone->sasl.callbacks[y].context);
}
global_pairs= pairs_generate(GLOBAL_COUNT, 400);
global_count= GLOBAL_COUNT;
- for (size_t x= 0; x < global_count; x++)
+ for (ptrdiff_t x= 0; x < global_count; x++)
{
global_keys[x]= global_pairs[x].key;
global_keys_length[x]= global_pairs[x].key_length;
static test_return_t drizzle(memcached_st *memc)
{
infinite:
- for (size_t x= 0; x < TEST_COUNTER; x++)
+ for (ptrdiff_t x= 0; x < TEST_COUNTER; x++)
{
memcached_return_t rc;
char *return_value;
static test_return_t many_adds(memcached_st *memc)
{
test_true(memc);
- for (size_t x= 0; x < TEST_COUNTER; x++)
+ for (ptrdiff_t x= 0; x < TEST_COUNTER; x++)
{
test_compare_got(TEST_SUCCESS, add_test(memc), x);
}
{
benchmark_state.create_init= true;
- for (size_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
+ for (ptrdiff_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
{
memcached_st *ptr;
ptr= memcached_create(&benchmark_state.create[x]);
{
benchmark_state.clone_init= true;
- for (size_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
+ for (ptrdiff_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
{
- memcached_st *ptr;
- ptr= memcached_clone(&benchmark_state.clone[x], memc);
+ memcached_st *ptr= memcached_clone(&benchmark_state.clone[x], memc);
test_true(ptr);
}
static test_return_t post_allocate(memcached_st *)
{
- for (size_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
+ for (ptrdiff_t x= 0; x < BENCHMARK_TEST_LOOP; x++)
{
if (benchmark_state.create_init)
{
/*
This would not work if there were only two hosts.
*/
- for (size_t x= 0; x < 99; x++)
+ for (ptrdiff_t x= 0; x < 99; x++)
{
memcached_autoeject(memc);
uint32_t server_idx= memcached_generate_hash(memc, ketama_test_cases[x].key, strlen(ketama_test_cases[x].key));
memc->ketama.next_distribution_rebuild= time(NULL) - 1;
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION,
memc->distribution);
- for (size_t x= 0; x < 99; x++)
+ for (ptrdiff_t x= 0; x < 99; x++)
{
uint32_t server_idx = memcached_generate_hash(memc, ketama_test_cases[x].key, strlen(ketama_test_cases[x].key));
// We re-use instance from above.
time_t(0), uint32_t(0)));
}
- for (size_t loop= 0; loop < 20; loop++)
+ for (ptrdiff_t loop= 0; loop < 20; loop++)
{
if (random() %2)
{
test_return_t block_add_regression(memcached_st *memc)
{
/* First add all of the items.. */
- for (size_t x= 0; x < REGRESSION_BINARY_VS_BLOCK_COUNT; ++x)
+ for (ptrdiff_t x= 0; x < REGRESSION_BINARY_VS_BLOCK_COUNT; ++x)
{
char blob[1024] = {0};
libtest::vchar_t value;
value.reserve(18000);
- for (size_t x= 0; x < 18000; x++)
+ for (ptrdiff_t x= 0; x < 18000; x++)
{
value.push_back((char) (x % 127));
}