mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fix and suppress some analysis warnings
This fixes warnings that are emitted when building with the `-analyze` flag enabled.
This commit is contained in:
parent
54423f6583
commit
31a7c62baf
83 changed files with 476 additions and 230 deletions
|
|
@ -287,11 +287,14 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other)
|
|||
{
|
||||
if (other.isHeapAllocated())
|
||||
{
|
||||
if (isHeapAllocated())
|
||||
packedData.allocatedData = static_cast<uint8*> (std::realloc (packedData.allocatedData, (size_t) other.size));
|
||||
else
|
||||
packedData.allocatedData = static_cast<uint8*> (std::malloc ((size_t) other.size));
|
||||
auto* newStorage = static_cast<uint8*> (isHeapAllocated()
|
||||
? std::realloc (packedData.allocatedData, (size_t) other.size)
|
||||
: std::malloc ((size_t) other.size));
|
||||
|
||||
if (newStorage == nullptr)
|
||||
throw std::bad_alloc{}; // The midi message has not been adjusted at this point
|
||||
|
||||
packedData.allocatedData = newStorage;
|
||||
memcpy (packedData.allocatedData, other.packedData.allocatedData, (size_t) other.size);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue