Explicitly cast values of different types

In case the warning -Werror=conversion is active with GCC, the warnings
about "conversion from A to B may change value" lead to a compilation
error. This explicitly convert the values to address these warnings.
This commit is contained in:
Sven Fischer authored and Martin Hořeňovský committed 2024-10-14 21:37:35 +02:00
1 parent 69d62abc9a
commit 0b2af56271
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ namespace Catch {
return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
}
auto Timer::getElapsedSeconds() const -> double {
return getElapsedMicroseconds()/1000000.0;
return static_cast<double>(getElapsedMicroseconds())/1000000.0;
}