Casting errors, failures on debian jaunty
authorroot <root@domU-12-31-39-07-65-53>
Thu, 6 Aug 2009 01:07:37 +0000 (01:07 +0000)
committerroot <root@domU-12-31-39-07-65-53>
Thu, 6 Aug 2009 01:07:37 +0000 (01:07 +0000)
clients/execute.c
clients/generator.c
clients/memstat.c

index a0e31ee9d51eab651a4e08cd269c2dc993ba15b7..7255d37ede3522dcc15a97a239aed387c898d1fb 100644 (file)
@@ -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);
index cd1a17bfe71059fceb49fff382b7975220284b35..5bce0301ab6ae848f9315ea5b85c186210c8f30a 100644 (file)
@@ -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;
index 27c34a41c2caf4ad048c3bb4f8320cfe5950142a..952f091f931bc343d21ba7ddffa092f8411676c7 100644 (file)
@@ -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;
       }