Pass uint64_t literal to std::max

On 32-bit system, uint64_t is typedef to unsigned long long.
On 64-bit system, uint64_t is typedef to unsigned long.

unsigned long and unsigned long long are distinctly
separate types, which causes std::max template to fail.
This commit is contained in:
James R 2023-01-04 18:27:22 -08:00
parent 4a7463d134
commit d2569dc3af

View file

@ -271,7 +271,8 @@ public:
gain_ = from;
gain_target_ = to;
// Gain samples target must always be at least 1 to avoid a div-by-zero.
gain_samples_target_ = std::max(static_cast<uint64_t>(seconds * 44100.f), 1ULL);
gain_samples_target_ = std::max(
static_cast<uint64_t>(seconds * 44100.f), UINT64_C(1)); // UINT64_C generates a uint64_t literal
gain_samples_ = 0;
}