diff --git a/src/cls/lock/cls_lock_ops.cc b/src/cls/lock/cls_lock_ops.cc index 10d00590093..0edeaeac339 100644 --- a/src/cls/lock/cls_lock_ops.cc +++ b/src/cls/lock/cls_lock_ops.cc @@ -21,7 +21,7 @@ using namespace rados::cls::lock; static void generate_lock_id(locker_id_t& i, int n, const string& cookie) { - i.locker = entity_name_t(entity_name_t::CLIENT(n)); + i.locker = entity_name_t::CLIENT(n); i.cookie = cookie; } @@ -77,7 +77,7 @@ void cls_lock_break_op::generate_test_instances(list& o) cls_lock_break_op *i = new cls_lock_break_op; i->name = "name"; i->cookie = "cookie"; - i->locker = entity_name_t(entity_name_t::CLIENT(1)); + i->locker = entity_name_t::CLIENT(1); o.push_back(i); o.push_back(new cls_lock_break_op); } diff --git a/src/cls/lock/cls_lock_types.cc b/src/cls/lock/cls_lock_types.cc index 38a0d93df46..d7691e08b75 100644 --- a/src/cls/lock/cls_lock_types.cc +++ b/src/cls/lock/cls_lock_types.cc @@ -20,7 +20,7 @@ using namespace rados::cls::lock; static void generate_lock_id(locker_id_t& i, int n, const string& cookie) { - i.locker = entity_name_t(entity_name_t::CLIENT(n)); + i.locker = entity_name_t::CLIENT(n); i.cookie = cookie; } diff --git a/src/common/Finisher.h b/src/common/Finisher.h index e1a4519c71c..96a8a78ac5a 100644 --- a/src/common/Finisher.h +++ b/src/common/Finisher.h @@ -62,7 +62,7 @@ class Finisher { struct FinisherThread : public Thread { Finisher *fin; explicit FinisherThread(Finisher *f) : fin(f) {} - void* entry() override { return (void*)fin->finisher_thread_entry(); } + void* entry() override { return fin->finisher_thread_entry(); } } finisher_thread; public: diff --git a/src/include/utime.h b/src/include/utime.h index 732eaebcdff..e0a44522f42 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -79,7 +79,7 @@ public: } void set_from_double(double d) { tv.tv_sec = (__u32)trunc(d); - tv.tv_nsec = (__u32)((d - (double)tv.tv_sec) * (double)1000000000.0); + tv.tv_nsec = (__u32)((d - (double)tv.tv_sec) * 1000000000.0); } real_time to_real_time() const { @@ -404,7 +404,7 @@ inline utime_t& operator+=(utime_t& l, const utime_t& r) { } inline utime_t& operator+=(utime_t& l, double f) { double fs = trunc(f); - double ns = (f - fs) * (double)1000000000.0; + double ns = (f - fs) * 1000000000.0; l.sec_ref() += (long)fs; l.nsec_ref() += (long)ns; l.normalize(); @@ -427,7 +427,7 @@ inline utime_t& operator-=(utime_t& l, const utime_t& r) { } inline utime_t& operator-=(utime_t& l, double f) { double fs = trunc(f); - double ns = (f - fs) * (double)1000000000.0; + double ns = (f - fs) * 1000000000.0; l.sec_ref() -= (long)fs; long nsl = (long)ns; if (nsl) { diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index 34e1ffa9239..15ed6eeb2d3 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -351,7 +351,7 @@ int FileJournal::create() goto free_buf; } - needed_space = ((int64_t)cct->_conf->osd_max_write_size) << 20; + needed_space = cct->_conf->osd_max_write_size << 20; needed_space += (2 * sizeof(entry_header_t)) + get_top(); if (header.max_size - header.start < needed_space) { derr << "FileJournal::create: OSD journal is not large enough to hold " diff --git a/src/osd/HitSet.h b/src/osd/HitSet.h index 0f8bc9a60b2..4a578f7824d 100644 --- a/src/osd/HitSet.h +++ b/src/osd/HitSet.h @@ -353,7 +353,7 @@ public: return (double)fpp_micro / 1000000.0; } void set_fpp(double f) { - fpp_micro = (unsigned)(llrintl(f * (double)1000000.0)); + fpp_micro = (unsigned)(llrintl(f * 1000000.0)); } void encode(bufferlist& bl) const override { @@ -424,7 +424,7 @@ public: } void seal() override { // aim for a density of .5 (50% of bit set) - double pc = (double)bloom.density() * 2.0; + double pc = bloom.density() * 2.0; if (pc < 1.0) bloom.compress(pc); } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index b4a3495d8d1..2fc2f161745 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -1159,7 +1159,7 @@ public: void get_pool_ids_by_rule(int rule_id, set *pool_ids) const { assert(pool_ids); for (auto &p: pools) { - if ((int)p.second.get_crush_rule() == rule_id) { + if (p.second.get_crush_rule() == rule_id) { pool_ids->insert(p.first); } } diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 2f54b10eee7..c9ff9efa4dd 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2097,7 +2097,7 @@ void Objecter::_linger_ops_resend(map& lresend, op->put(); lresend.erase(lresend.begin()); } - ul = unique_lock(sul.release_to_unique()); + ul = sul.release_to_unique(); } void Objecter::start_tick()