X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_get.c;h=f00cfafbc261b94fa26ce27f838ebba2e5811f6a;hb=ec47ede7496f74d26369c3ec63430b688ad84006;hp=0209b283ab1129ec5b53347e91d1420ca2366e36;hpb=29db6c77e126d9ae0c416ad76402fdbef7372cdb;p=m6w6%2Flibmemcached diff --git a/libmemcached/memcached_get.c b/libmemcached/memcached_get.c index 0209b283..f00cfafb 100644 --- a/libmemcached/memcached_get.c +++ b/libmemcached/memcached_get.c @@ -37,7 +37,7 @@ char *memcached_get_by_key(memcached_st *ptr, *error= memcached_mget_by_key(ptr, master_key, master_key_length, - (char **)&key, &key_length, 1); + (const char **)&key, &key_length, 1); value= memcached_fetch(ptr, NULL, NULL, value_length, flags, error); @@ -102,8 +102,8 @@ char *memcached_get_by_key(memcached_st *ptr, } memcached_return memcached_mget(memcached_st *ptr, - char **keys, size_t *key_length, - unsigned int number_of_keys) + const char **keys, size_t *key_length, + size_t number_of_keys) { return memcached_mget_by_key(ptr, NULL, 0, keys, key_length, number_of_keys); } @@ -111,19 +111,19 @@ memcached_return memcached_mget(memcached_st *ptr, static memcached_return binary_mget_by_key(memcached_st *ptr, unsigned int master_server_key, bool is_master_key_set, - char **keys, size_t *key_length, - unsigned int number_of_keys); + const char **keys, size_t *key_length, + size_t number_of_keys); memcached_return memcached_mget_by_key(memcached_st *ptr, const char *master_key, size_t master_key_length, - char **keys, + const char **keys, size_t *key_length, - unsigned int number_of_keys) + size_t number_of_keys) { unsigned int x; memcached_return rc= MEMCACHED_NOTFOUND; - char *get_command= "get "; + const char *get_command= "get "; uint8_t get_command_length= 4; unsigned int master_server_key= (unsigned int)-1; /* 0 is a valid server id! */ bool is_master_key_set= false; @@ -145,7 +145,7 @@ memcached_return memcached_mget_by_key(memcached_st *ptr, if (master_key && master_key_length) { - if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((char **)&master_key, &master_key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) + if ((ptr->flags & MEM_VERIFY_KEY) && (memcached_key_test((const char **)&master_key, &master_key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)) return MEMCACHED_BAD_KEY_PROVIDED; master_server_key= memcached_generate_hash(ptr, master_key, master_key_length); is_master_key_set= true; @@ -259,8 +259,8 @@ memcached_return memcached_mget_by_key(memcached_st *ptr, static memcached_return simple_binary_mget(memcached_st *ptr, unsigned int master_server_key, bool is_master_key_set, - char **keys, size_t *key_length, - unsigned int number_of_keys) + const char **keys, size_t *key_length, + size_t number_of_keys) { memcached_return rc= MEMCACHED_NOTFOUND; uint32_t x; @@ -360,19 +360,19 @@ static memcached_return simple_binary_mget(memcached_st *ptr, static memcached_return replication_binary_mget(memcached_st *ptr, uint32_t* hash, bool* dead_servers, - char **keys, size_t *key_length, - unsigned int number_of_keys) + const char **keys, size_t *key_length, + size_t number_of_keys) { memcached_return rc= MEMCACHED_NOTFOUND; uint32_t x; int flush= number_of_keys == 1; - for (int replica = 0; replica <= ptr->number_of_replicas; ++replica) + for (uint32_t replica= 0; replica <= ptr->number_of_replicas; ++replica) { bool success= true; - for (uint32_t x= 0; x < number_of_keys; ++x) + for (x= 0; x < number_of_keys; ++x) { if (hash[x] == ptr->number_of_hosts) continue; /* Already successfully sent */ @@ -443,7 +443,7 @@ static memcached_return replication_binary_mget(memcached_st *ptr, memcached_server_response_increment(&ptr->hosts[x]); /* mark all of the messages bound for this server as sent! */ - for (uint32_t x= 0; x < number_of_keys; ++x) + for (x= 0; x < number_of_keys; ++x) if (hash[x] == x) hash[x]= ptr->number_of_hosts; } @@ -459,8 +459,8 @@ static memcached_return replication_binary_mget(memcached_st *ptr, static memcached_return binary_mget_by_key(memcached_st *ptr, unsigned int master_server_key, bool is_master_key_set, - char **keys, size_t *key_length, - unsigned int number_of_keys) + const char **keys, size_t *key_length, + size_t number_of_keys) { memcached_return rc;