mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 00:03:52 +02:00
Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or of a block file (which is never now more than a megabyte and so could be fit in memory all at once), or a part thereof.
This commit is contained in:
@@ -48,7 +48,7 @@ const wxChar *GetSampleFormatStr(sampleFormat format);
|
||||
// Allocating/Freeing Samples
|
||||
//
|
||||
|
||||
AUDACITY_DLL_API samplePtr NewSamples(int count, sampleFormat format);
|
||||
AUDACITY_DLL_API samplePtr NewSamples(size_t count, sampleFormat format);
|
||||
AUDACITY_DLL_API void DeleteSamples(samplePtr p);
|
||||
|
||||
// RAII version of above
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
SampleBuffer()
|
||||
: mPtr(0)
|
||||
{}
|
||||
SampleBuffer(int count, sampleFormat format)
|
||||
SampleBuffer(size_t count, sampleFormat format)
|
||||
: mPtr(NewSamples(count, format))
|
||||
{}
|
||||
~SampleBuffer()
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
}
|
||||
|
||||
// WARNING! May not preserve contents.
|
||||
SampleBuffer &Allocate(int count, sampleFormat format)
|
||||
SampleBuffer &Allocate(size_t count, sampleFormat format)
|
||||
{
|
||||
Free();
|
||||
mPtr = NewSamples(count, format);
|
||||
@@ -96,12 +96,12 @@ public:
|
||||
, mCount(0)
|
||||
{}
|
||||
|
||||
GrowableSampleBuffer(int count, sampleFormat format)
|
||||
GrowableSampleBuffer(size_t count, sampleFormat format)
|
||||
: SampleBuffer(count, format)
|
||||
, mCount(count)
|
||||
{}
|
||||
|
||||
GrowableSampleBuffer &Resize(int count, sampleFormat format)
|
||||
GrowableSampleBuffer &Resize(size_t count, sampleFormat format)
|
||||
{
|
||||
if (!ptr() || mCount < count) {
|
||||
Allocate(count, format);
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
using SampleBuffer::ptr;
|
||||
|
||||
private:
|
||||
int mCount;
|
||||
size_t mCount;
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user