PortMidi / portmidi

portmidi is a cross-platform MIDI input/output library
Other
116 stars 31 forks source link

Sl1200mk2 patch uint32 t #32

Closed sl1200mk2 closed 2 years ago

sl1200mk2 commented 2 years ago

This is first step in order to go for Midi2.0 on macOS (where MIDIDestinationCreate() is deprecated starting from macOS11 and MIDIDestinationCreateWithProtocol() is working with MIDIEventList* which encapsulate uint32_t and not int32_t)

does it make sense to you? best regards, nicolas

rbdannenberg commented 2 years ago

(Sorry for the delay. I'm trying to catch up.) Changing data types in pm_queue and the PortMidi API has a potentially broad impact, and even some non-PortMidi code uses PortMidi's atomic queues. There's a good argument that uint32_t would have been a better choice for PmMessage, and my only excuse is that, in general, unsigned ints risk underflow, so I avoid them. I'd rather coerce the int32's to unit32's wherever it's really needed.