Permalink
Browse files

Fix compile warnings from gcc 4.6.1

Change-Id: Idac70d4f2a4d8b8d8de23b3184b28a068c676f1f
  • Loading branch information...
1 parent 2cd40dc commit 2f7672245f06d8dbdd68def76e6cba747fc8645c @trondn committed Sep 16, 2011
Showing with 14 additions and 27 deletions.
  1. +2 −6 clients/ms_conn.c
  2. +3 −4 tests/hash_plus.cc
  3. +2 −5 tests/hashkit_functions.c
  4. +6 −10 tests/mem_functions.c
  5. +1 −2 tests/test.c
View
@@ -731,7 +731,6 @@ static int ms_new_socket(struct addrinfo *ai)
static void ms_maximize_sndbuf(const int sfd)
{
socklen_t intsize= sizeof(int);
- unsigned int last_good= 0;
unsigned int min, max, avg;
unsigned int old_size;
@@ -751,7 +750,6 @@ static void ms_maximize_sndbuf(const int sfd)
avg= ((unsigned int)(min + max)) / 2;
if (setsockopt(sfd, SOL_SOCKET, SO_SNDBUF, (void *)&avg, intsize) == 0)
{
- last_good= avg;
min= avg + 1;
}
else
@@ -1430,7 +1428,6 @@ static int ms_sort_udp_packet(ms_conn_t *c, char *buf, int rbytes)
int wbytes= 0;
uint16_t req_id= 0;
uint16_t seq_num= 0;
- uint16_t packets= 0;
unsigned char *header= NULL;
/* no enough data */
@@ -1462,7 +1459,6 @@ static int ms_sort_udp_packet(ms_conn_t *c, char *buf, int rbytes)
req_id= (uint16_t)HEADER_TO_REQID(header);
assert(req_id == c->request_id % (1 << 16));
- packets= (uint16_t)HEADER_TO_PACKETS(header);
assert(c->packets == HEADER_TO_PACKETS(header));
seq_num= (uint16_t)HEADER_TO_SEQNUM(header);
@@ -3113,7 +3109,7 @@ static int ms_build_ascii_write_buf_mlget(ms_conn_t *c)
*/
int ms_mcd_mlget(ms_conn_t *c)
{
- ms_task_item_t *item;
+ /* ms_task_item_t *item; */
assert(c != NULL);
assert(c->mlget_task.mlget_num >= 1);
@@ -3155,7 +3151,7 @@ int ms_mcd_mlget(ms_conn_t *c)
/* decrease operation time of each item */
for (int i= 0; i < c->mlget_task.mlget_num; i++)
{
- item= c->mlget_task.mlget_item[i].item;
+ /* item= c->mlget_task.mlget_item[i].item; */
atomic_add_size(&ms_stats.cmd_get, 1);
}
View
@@ -60,18 +60,17 @@ static test_return_t assign_test(void *obj)
static test_return_t digest_test(void *obj)
{
Hashkit hashk;
- uint32_t value;
(void)obj;
- value= hashk.digest("Foo", sizeof("Foo"));
+ hashk.digest("Foo", sizeof("Foo"));
return TEST_SUCCESS;
}
static test_return_t set_function_test(void *obj)
{
Hashkit hashk;
- hashkit_hash_algorithm_t algo_list[]= {
+ hashkit_hash_algorithm_t algo_list[]= {
HASHKIT_HASH_DEFAULT,
HASHKIT_HASH_MD5,
HASHKIT_HASH_CRC,
@@ -171,7 +170,7 @@ static test_return_t compare_function_test(void *obj)
(void)obj;
b= a;
-
+
test_true(a == b);
b.set_function(HASHKIT_HASH_MURMUR);
@@ -317,8 +317,7 @@ test_st allocation[]= {
static test_return_t hashkit_digest_test(hashkit_st *hashk)
{
- uint32_t value;
- value= hashkit_digest(hashk, "a", sizeof("a"));
+ hashkit_digest(hashk, "a", sizeof("a"));
return TEST_SUCCESS;
}
@@ -510,11 +509,9 @@ test_st hashkit_st_functions[] ={
static test_return_t libhashkit_digest_test(hashkit_st *hashk)
{
- uint32_t value;
-
(void)hashk;
- value= libhashkit_digest("a", sizeof("a"), HASHKIT_HASH_DEFAULT);
+ libhashkit_digest("a", sizeof("a"), HASHKIT_HASH_DEFAULT);
return TEST_SUCCESS;
}
View
@@ -205,7 +205,6 @@ static memcached_return_t server_print_callback(const memcached_st *ptr,
static test_return_t memcached_server_remove_test(memcached_st *ptr)
{
- memcached_return_t rc;
memcached_st local_memc;
memcached_st *memc;
memcached_server_st *servers;
@@ -218,7 +217,7 @@ static test_return_t memcached_server_remove_test(memcached_st *ptr)
servers= memcached_servers_parse(server_string);
- rc= memcached_server_push(memc, servers);
+ memcached_server_push(memc, servers);
memcached_server_list_free(servers);
callbacks[0]= server_print_callback;
@@ -1245,7 +1244,6 @@ static test_return_t mget_end(memcached_st *memc)
/* Do not copy the style of this code, I just access hosts to testthis function */
static test_return_t stats_servername_test(memcached_st *memc)
{
- memcached_return_t rc;
memcached_stat_st memc_stat;
memcached_server_instance_st instance=
memcached_server_instance_by_position(memc, 0);
@@ -1254,9 +1252,9 @@ static test_return_t stats_servername_test(memcached_st *memc)
if (memcached_get_sasl_callbacks(memc) != NULL)
return TEST_SKIPPED;
#endif
- rc= memcached_stat_servername(&memc_stat, NULL,
- memcached_server_name(instance),
- memcached_server_port(instance));
+ memcached_stat_servername(&memc_stat, NULL,
+ memcached_server_name(instance),
+ memcached_server_port(instance));
return TEST_SUCCESS;
}
@@ -2596,7 +2594,6 @@ static test_return_t user_supplied_bug11(memcached_st *memc)
size_t value_length= 512;
unsigned int x;
size_t key_len= 3;
- memcached_return_t rc;
unsigned int set= 1;
int32_t timeout;
memcached_st *mclone= memcached_clone(NULL, memc);
@@ -2618,7 +2615,7 @@ static test_return_t user_supplied_bug11(memcached_st *memc)
for (x= 1; x <= 100000; ++x)
{
- rc= memcached_set(mclone, key, key_len,value, value_length, 0, 0);
+ memcached_set(mclone, key, key_len,value, value_length, 0, 0);
}
free(value);
@@ -2859,7 +2856,6 @@ static test_return_t user_supplied_bug17(memcached_st *memc)
static test_return_t user_supplied_bug19(memcached_st *not_used)
{
memcached_st *memc;
- const memcached_server_st *server;
memcached_return_t res;
(void)not_used;
@@ -2868,7 +2864,7 @@ static test_return_t user_supplied_bug19(memcached_st *not_used)
memcached_server_add_with_weight(memc, "localhost", 11311, 100);
memcached_server_add_with_weight(memc, "localhost", 11312, 100);
- server= memcached_server_by_key(memc, "a", 1, &res);
+ memcached_server_by_key(memc, "a", 1, &res);
memcached_free(memc);
View
@@ -142,7 +142,6 @@ static collection_st *init_world(world_st *world)
int main(int argc, char *argv[])
{
test_return_t return_code;
- unsigned int x;
char *collection_to_run= NULL;
char *wildcard= NULL;
world_st world;
@@ -229,7 +228,7 @@ int main(int argc, char *argv[])
}
- for (x= 0; run->name; run++)
+ for ( ; run->name; run++)
{
struct timeval start_time, end_time;
long int load_time= 0;

0 comments on commit 2f76722

Please sign in to comment.