mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-03 23:14:16 +01:00
replace off_t with size_t to match system pointer size
I was having an issue with size of off_t on a multi-gigabit file. This may have been related to long being a signed 32 bits on MSVC. But I think there is good reason to use size_t here in general: https://stackoverflow.com/questions/10634629/what-are-the-usage-differences-between-size-t-and-off-t
This commit is contained in:
@@ -34,10 +34,10 @@ SampleBuffer<Tin, Tout>::~SampleBuffer()
|
||||
}
|
||||
|
||||
template <typename Tin, typename Tout>
|
||||
std::unique_ptr<Tout[]> SampleBuffer<Tin, Tout>::getSamples(off_t start, off_t length)
|
||||
std::unique_ptr<Tout[]> SampleBuffer<Tin, Tout>::getSamples(size_t start, size_t length)
|
||||
{
|
||||
// TODO: base this on the actual history required
|
||||
auto history = std::min(start, (off_t)256);
|
||||
auto history = std::min(start, (size_t)256);
|
||||
auto samples = src->getSamples(start - history, length + history);
|
||||
if (samples == nullptr)
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user