common: Resolve C4267 warning on MSVC

Also removes Timer::GetDoubleTime() as it is unused.
This commit is contained in:
Morph
2022-05-12 00:23:23 -04:00
parent 46c6e5c4c0
commit 1cc1c33a15
6 changed files with 7 additions and 28 deletions

View File

@ -10,7 +10,7 @@ namespace Common {
template <typename T>
[[nodiscard]] constexpr T AlignUp(T value, std::size_t size) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
auto mod{value % size};
auto mod{static_cast<T>(value % size)};
value -= mod;
return static_cast<T>(mod == T{0} ? value : value + size);
}