mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a template to allow the HeapBlock class to be given signed ints or other types that are not size_t for its size parameters
This commit is contained in:
parent
13ccdf9411
commit
369d59f656
32 changed files with 189 additions and 199 deletions
|
|
@ -44,7 +44,7 @@ BufferedInputStream::BufferedInputStream (InputStream* sourceStream, int size, b
|
|||
position (sourceStream->getPosition()),
|
||||
bufferStart (position)
|
||||
{
|
||||
buffer.malloc ((size_t) bufferSize);
|
||||
buffer.malloc (bufferSize);
|
||||
}
|
||||
|
||||
BufferedInputStream::BufferedInputStream (InputStream& sourceStream, int size)
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ String InputStream::readString()
|
|||
String InputStream::readNextLine()
|
||||
{
|
||||
MemoryBlock buffer (256);
|
||||
char* data = static_cast<char*> (buffer.getData());
|
||||
auto* data = static_cast<char*> (buffer.getData());
|
||||
size_t i = 0;
|
||||
|
||||
while ((data[i] = readByte()) != 0)
|
||||
|
|
@ -223,8 +223,8 @@ void InputStream::skipNextBytes (int64 numBytesToSkip)
|
|||
{
|
||||
if (numBytesToSkip > 0)
|
||||
{
|
||||
const int skipBufferSize = (int) jmin (numBytesToSkip, (int64) 16384);
|
||||
HeapBlock<char> temp ((size_t) skipBufferSize);
|
||||
auto skipBufferSize = (int) jmin (numBytesToSkip, (int64) 16384);
|
||||
HeapBlock<char> temp (skipBufferSize);
|
||||
|
||||
while (numBytesToSkip > 0 && ! isExhausted())
|
||||
numBytesToSkip -= read (temp, (int) jmin (numBytesToSkip, (int64) skipBufferSize));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue