From: Adam C. Emerson Date: Fri, 17 Jul 2020 06:12:38 +0000 (-0400) Subject: rbd_mirror: Remove unneded implicit conversions X-Git-Tag: v16.1.0~1661^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37961b07c4828fa2678f11c1839768f534a3e2c7;p=ceph.git rbd_mirror: Remove unneded implicit conversions Since we're comparing to uint64_ts and storing in a uint64_t, just have the variable be a uint64_t. Signed-off-by: Adam C. Emerson --- diff --git a/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc b/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc index 216a2fa2caf96..eb99d5addbd7d 100644 --- a/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc +++ b/src/tools/rbd_mirror/image_replayer/journal/ReplayStatusFormatter.cc @@ -263,14 +263,13 @@ void ReplayStatusFormatter::format(std::string *description) { root_obj["entries_per_second"] = round_to_two_places(entries_per_second); if (m_entries_behind_master > 0 && entries_per_second > 0) { - auto seconds_until_synced = round_to_two_places( + std::uint64_t seconds_until_synced = round_to_two_places( m_entries_behind_master / entries_per_second); if (seconds_until_synced >= std::numeric_limits::max()) { seconds_until_synced = std::numeric_limits::max(); } - root_obj["seconds_until_synced"] = static_cast( - seconds_until_synced); + root_obj["seconds_until_synced"] = seconds_until_synced; } *description = json_spirit::write( diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index 6c4d842f1fd5e..d2c8ee27278e7 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -273,14 +273,13 @@ bool Replayer::get_replay_status(std::string* description, auto pending_bytes = bytes_per_snapshot * m_pending_snapshots; if (bytes_per_second > 0 && m_pending_snapshots > 0) { - auto seconds_until_synced = round_to_two_places( + std::uint64_t seconds_until_synced = round_to_two_places( pending_bytes / bytes_per_second); if (seconds_until_synced >= std::numeric_limits::max()) { seconds_until_synced = std::numeric_limits::max(); } - root_obj["seconds_until_synced"] = static_cast( - seconds_until_synced); + root_obj["seconds_until_synced"] = seconds_until_synced; } *description = json_spirit::write(