]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osdc: Silence implicit conversion warning
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 06:56:50 +0000 (02:56 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 18:18:17 +0000 (14:18 -0400)
By converting explicitly.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/test/osdc/object_cacher_stress.cc

index 065ea8c453f64c95cd94ab4020375d0fcb2934db..371117ef6f2c22112c4c1a2656d3399137ade7fb 100644 (file)
@@ -93,7 +93,7 @@ int stress_test(uint64_t num_ops, uint64_t num_objs,
     // no zero-length operations
     uint64_t length = random() % (std::max<uint64_t>(max_len - 1, 1)) + 1;
     std::string oid = "test" + stringify(random() % num_objs);
-    bool is_read = random() < percent_reads * RAND_MAX;
+    bool is_read = random() < percent_reads * float(RAND_MAX);
     std::shared_ptr<op_data> op(new op_data(oid, offset, length, is_read));
     ops.push_back(op);
     std::cout << "op " << i << " " << (is_read ? "read" : "write")