1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +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:
jules 2017-10-11 12:10:58 +01:00
parent 13ccdf9411
commit 369d59f656
32 changed files with 189 additions and 199 deletions

View file

@ -37,8 +37,8 @@ struct FlexBoxLayoutCalculation
|| fb.flexDirection == FlexBox::Direction::rowReverse),
containerLineLength (isRowDirection ? parentWidth : parentHeight)
{
lineItems.calloc ((size_t) (numItems * numItems));
lineInfo.calloc ((size_t) numItems);
lineItems.calloc (numItems * numItems);
lineInfo.calloc (numItems);
}
struct ItemWithState

View file

@ -578,7 +578,7 @@ public:
const int pixStride = 2;
const int stride = ((w * pixStride + 3) & ~3);
imageData16Bit.malloc ((size_t) (stride * h));
imageData16Bit.malloc (stride * h);
xImage->data = imageData16Bit;
xImage->bitmap_pad = 16;
xImage->depth = pixStride * 8;
@ -1946,7 +1946,7 @@ public:
void setIcon (const Image& newIcon) override
{
const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2;
HeapBlock<unsigned long> data ((size_t) dataSize);
HeapBlock<unsigned long> data (dataSize);
int index = 0;
data[index++] = (unsigned long) newIcon.getWidth();

View file

@ -3492,7 +3492,7 @@ private:
if (attributeSizeBytes > 0)
{
// Get attributes (8 bit flag per character):
HeapBlock<char> attributes ((size_t) attributeSizeBytes);
HeapBlock<char> attributes (attributeSizeBytes);
ImmGetCompositionString (hImc, GCS_COMPATTR, attributes, (DWORD) attributeSizeBytes);
selectionStart = 0;