diff --git a/SoundFontsFramework/SoundFontsFramework/Extensions/MIDIPacketList+Extensions.swift b/SoundFontsFramework/SoundFontsFramework/Extensions/MIDIPacketList+Extensions.swift index 6e676e50..06a4eb90 100644 --- a/SoundFontsFramework/SoundFontsFramework/Extensions/MIDIPacketList+Extensions.swift +++ b/SoundFontsFramework/SoundFontsFramework/Extensions/MIDIPacketList+Extensions.swift @@ -63,7 +63,7 @@ extension MIDIPacketList { let packetsSize = (packets.map { $0.alignedByteSize }).reduce(0, +) let listSize = MemoryLayout.size - MemoryLayout.size + packetsSize - func OptionalMIDIPacketListAdd(_ packetListPtr: UnsafeMutablePointer, + func optionalMIDIPacketListAdd(_ packetListPtr: UnsafeMutablePointer, _ curPacketPtr: UnsafeMutablePointer, _ packet: MIDIPacket) -> UnsafeMutablePointer? { return withUnsafeBytes(of: packet.data) { ptr in @@ -78,7 +78,7 @@ extension MIDIPacketList { let packetListPtr = bufferPtr.bindMemory(to: MIDIPacketList.self).baseAddress! var curPacketPtr = MIDIPacketListInit(packetListPtr) for packet in packets { - guard let newPacketPtr = OptionalMIDIPacketListAdd(packetListPtr, curPacketPtr, packet) else { + guard let newPacketPtr = optionalMIDIPacketListAdd(packetListPtr, curPacketPtr, packet) else { fatalError() } curPacketPtr = newPacketPtr