1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a safety check and fixed a couple of warnings.

This commit is contained in:
jules 2014-02-21 16:00:39 +00:00
parent a34496588c
commit 48c2f42802
2 changed files with 12 additions and 9 deletions

View file

@ -679,8 +679,8 @@ MidiMessage MidiMessage::textMetaEvent (int type, const StringRef& text)
const size_t headerLen = sizeof (header) - n;
uint8* const dest = result.allocateSpace (headerLen + textSize);
result.size = headerLen + textSize;
uint8* const dest = result.allocateSpace ((int) (headerLen + textSize));
result.size = (int) (headerLen + textSize);
memcpy (dest, header + n, headerLen);
memcpy (dest + headerLen, text.text.getAddress(), textSize);

View file

@ -118,6 +118,8 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone
void timerCallback() override
{
if (NSView* parent = (NSView*) getView())
{
if ([[parent subviews] count] > 0)
{
if (NSView* child = [[parent subviews] objectAtIndex: 0])
{
@ -132,6 +134,7 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone
}
}
}
}
};
#endif