mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-27 02:20:05 +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
|
|
@ -260,7 +260,7 @@ static void findIPAddresses (int sock, Array<IPAddress>& result)
|
|||
do
|
||||
{
|
||||
bufferSize *= 2;
|
||||
buffer.calloc ((size_t) bufferSize);
|
||||
buffer.calloc (bufferSize);
|
||||
|
||||
cfg.ifc_len = bufferSize;
|
||||
cfg.ifc_buf = buffer;
|
||||
|
|
|
|||
|
|
@ -239,8 +239,8 @@ public:
|
|||
return false;
|
||||
|
||||
int64 numBytesToSkip = wantedPos - position;
|
||||
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));
|
||||
|
|
|
|||
|
|
@ -1055,9 +1055,9 @@ public:
|
|||
if (wantedPos < position)
|
||||
return false;
|
||||
|
||||
int64 numBytesToSkip = wantedPos - position;
|
||||
const int skipBufferSize = (int) jmin (numBytesToSkip, (int64) 16384);
|
||||
HeapBlock<char> temp ((size_t) skipBufferSize);
|
||||
auto numBytesToSkip = wantedPos - position;
|
||||
auto skipBufferSize = (int) jmin (numBytesToSkip, (int64) 16384);
|
||||
HeapBlock<char> temp (skipBufferSize);
|
||||
|
||||
while (numBytesToSkip > 0 && ! isExhausted())
|
||||
numBytesToSkip -= read (temp, (int) jmin (numBytesToSkip, (int64) skipBufferSize));
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ String String::fromCFString (CFStringRef cfString)
|
|||
CFIndex bytesNeeded = 0;
|
||||
CFStringGetBytes (cfString, range, kCFStringEncodingUTF8, 0, false, nullptr, 0, &bytesNeeded);
|
||||
|
||||
HeapBlock<UInt8> utf8 ((size_t) bytesNeeded + 1);
|
||||
HeapBlock<UInt8> utf8 (bytesNeeded + 1);
|
||||
CFStringGetBytes (cfString, range, kCFStringEncodingUTF8, 0, false, utf8, bytesNeeded + 1, nullptr);
|
||||
|
||||
return String (CharPointer_UTF8 ((const CharPointer_UTF8::CharType*) utf8.get()),
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
for (;;)
|
||||
{
|
||||
HeapBlock<char> buffer ((size_t) bufferSizeBytes);
|
||||
HeapBlock<char> buffer (bufferSizeBytes);
|
||||
|
||||
if (HttpQueryInfo (request, HTTP_QUERY_RAW_HEADERS_CRLF, buffer.getData(), &bufferSizeBytes, 0))
|
||||
{
|
||||
|
|
@ -216,8 +216,8 @@ public:
|
|||
return false;
|
||||
|
||||
int64 numBytesToSkip = wantedPos - position;
|
||||
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));
|
||||
|
|
@ -645,7 +645,7 @@ bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailA
|
|||
message.lpRecips = &recip;
|
||||
|
||||
HeapBlock<MapiFileDesc> files;
|
||||
files.calloc ((size_t) filesToAttach.size());
|
||||
files.calloc (filesToAttach.size());
|
||||
|
||||
message.nFileCount = (ULONG) filesToAttach.size();
|
||||
message.lpFiles = files;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue