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:
Josh Blum
2017-11-25 16:06:08 -06:00
parent 40890e46ab
commit 3f5e373ee4
27 changed files with 94 additions and 94 deletions

View File

@@ -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;