Permalink
Browse files

Merge pull request #1 from avsej/master

Fix gcc 4.6.1 warnings
  • Loading branch information...
2 parents 2cd40dc + fc4e34f commit ca739a890349ac36dc79447e37da7caa9ae819f5 @alk alk committed Nov 1, 2011
Showing with 39 additions and 40 deletions.
  1. +2 −6 clients/ms_conn.c
  2. +3 −3 clients/utilities.c
  3. +16 −4 example/storage_innodb.c
  4. +6 −6 libmemcached/sasl.c
  5. +3 −4 tests/hash_plus.cc
  6. +2 −5 tests/hashkit_functions.c
  7. +6 −10 tests/mem_functions.c
  8. +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
@@ -175,11 +175,11 @@ static int get_password(sasl_conn_t *conn, void *context, int id,
/* callbacks we support */
static sasl_callback_t sasl_callbacks[] = {
{
- SASL_CB_USER, &get_username, NULL
+ SASL_CB_USER, (int (*)(void))get_username, NULL
}, {
- SASL_CB_AUTHNAME, &get_username, NULL
+ SASL_CB_AUTHNAME, (int (*)(void))get_username, NULL
}, {
- SASL_CB_PASS, &get_password, NULL
+ SASL_CB_PASS, (int (*)(void))get_password, NULL
}, {
SASL_CB_LIST_END, NULL, NULL
}
View
@@ -129,9 +129,12 @@ static bool do_put_item(ib_trx_t trx, struct item* item)
if (tuple != NULL)
ib_tuple_delete(tuple);
- ib_err_t currsor_error;
if (cursor != NULL)
- currsor_error= ib_cursor_close(cursor);
+ {
+ ib_err_t cursor_error;
+ cursor_error= ib_cursor_close(cursor);
+ (void) cursor_error;
+ }
return retval;
}
@@ -184,9 +187,12 @@ static bool do_locate_item(ib_trx_t trx,
if (tuple != NULL)
ib_tuple_delete(tuple);
- ib_err_t cursor_error;
if (*cursor != NULL)
+ {
+ ib_err_t cursor_error;
cursor_error= ib_cursor_close(*cursor);
+ (void) cursor_error;
+ }
*cursor= NULL;
@@ -257,9 +263,12 @@ static struct item* do_get_item(ib_trx_t trx, const void* key, size_t nkey)
if (tuple != NULL)
ib_tuple_delete(tuple);
- ib_err_t cursor_error;
if (cursor != NULL)
+ {
+ ib_err_t cursor_error;
cursor_error= ib_cursor_close(cursor);
+ (void) cursor_error;
+ }
return retval;
}
@@ -290,6 +299,7 @@ static bool do_delete_item(ib_trx_t trx, const void* key, size_t nkey) {
{
ib_err_t cursor_error;
cursor_error= ib_cursor_close(cursor);
+ (void) cursor_error;
}
return retval;
@@ -498,6 +508,7 @@ void flush(uint32_t when __attribute__((unused)))
}
ib_err_t cursor_error;
cursor_error= ib_cursor_close(cursor);
+ (void)cursor_error;
cursor= NULL;
checked(ib_trx_commit(transaction));
return;
@@ -506,6 +517,7 @@ void flush(uint32_t when __attribute__((unused)))
if (cursor != NULL)
{
cursor_error= ib_cursor_close(cursor);
+ (void)cursor_error;
}
ib_err_t error= ib_trx_rollback(transaction);
View
@@ -239,13 +239,13 @@ memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr,
strcpy((void*)secret->data, password);
cb[0].id= SASL_CB_USER;
- cb[0].proc= get_username;
+ cb[0].proc= (int (*)(void))get_username;
cb[0].context= strcpy(name, username);
cb[1].id= SASL_CB_AUTHNAME;
- cb[1].proc= get_username;
+ cb[1].proc= (int (*)(void))get_username;
cb[1].context= name;
cb[2].id= SASL_CB_PASS;
- cb[2].proc= get_password;
+ cb[2].proc= (int (*)(void))get_password;
cb[2].context= secret;
cb[3].id= SASL_CB_LIST_END;
@@ -285,11 +285,11 @@ memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st
/* Hopefully we are using our own callback mechanisms.. */
if (source->sasl.callbacks[0].id == SASL_CB_USER &&
- source->sasl.callbacks[0].proc == get_username &&
+ source->sasl.callbacks[0].proc == (int (*)(void))get_username &&
source->sasl.callbacks[1].id == SASL_CB_AUTHNAME &&
- source->sasl.callbacks[1].proc == get_username &&
+ source->sasl.callbacks[1].proc == (int (*)(void))get_username &&
source->sasl.callbacks[2].id == SASL_CB_PASS &&
- source->sasl.callbacks[2].proc == get_password &&
+ source->sasl.callbacks[2].proc == (int (*)(void))get_password &&
source->sasl.callbacks[3].id == SASL_CB_LIST_END)
{
sasl_secret_t *secret= source->sasl.callbacks[2].context;
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 ca739a8

Please sign in to comment.