clang-tidy: Enable bugprone-narrowing-conversions
Modified code to address issues flagged by this check.
Tested: Build and unit tests passed successfully.
Change-Id: Idd5e3701725a833324535d29f0bfffb3ba180e88
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/dump_manager_bmc.cpp b/dump_manager_bmc.cpp
index a6c64d6..a3402c1 100644
--- a/dump_manager_bmc.cpp
+++ b/dump_manager_bmc.cpp
@@ -309,7 +309,8 @@
{
if (!std::filesystem::is_directory(p))
{
- size += std::ceil(std::filesystem::file_size(p) / 1024.0);
+ std::uintmax_t fileSize = std::filesystem::file_size(p);
+ size += std::ceil(static_cast<double>(fileSize) / 1024.0);
}
}
return size;