From: root Date: Thu, 6 Aug 2009 01:07:37 +0000 (+0000) Subject: Casting errors, failures on debian jaunty X-Git-Tag: 0.34~25^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=efa17fea71b96f27c95c1662cf03b3d5141d5a53;p=awesomized%2Flibmemcached Casting errors, failures on debian jaunty --- diff --git a/clients/execute.c b/clients/execute.c index a0e31ee9..7255d37e 100644 --- a/clients/execute.c +++ b/clients/execute.c @@ -46,7 +46,7 @@ unsigned int execute_get(memcached_st *memc, pairs_st *pairs, unsigned int numbe uint32_t flags; unsigned int fetch_key; - fetch_key= (unsigned int)(random() % number_of); + fetch_key= (unsigned int)((unsigned int)random() % number_of); value= memcached_get(memc, pairs[fetch_key].key, pairs[fetch_key].key_length, &value_length, &flags, &rc); diff --git a/clients/generator.c b/clients/generator.c index cd1a17bf..5bce0301 100644 --- a/clients/generator.c +++ b/clients/generator.c @@ -49,7 +49,7 @@ 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= (pairs_st*)calloc((size_t)number_of + 1, sizeof(pairs_st)); if (!pairs) goto error; diff --git a/clients/memstat.c b/clients/memstat.c index 27c34a41..952f091f 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -168,12 +168,12 @@ static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat, } gettimeofday(&end_time, NULL); - elapsed_time= timedif(end_time, start_time); - elapsed_time /= num_of_tests; + elapsed_time= (long) timedif(end_time, start_time); + elapsed_time /= (long) num_of_tests; if (elapsed_time > slowest_time) { - slowest_server= x; + slowest_server= (long) x; slowest_time= elapsed_time; }