#4463: Add multi-ports support to USB MIDI driver ---------------------------+---------------------------- Reporter: Pete | Owner: phoudoin Type: enhancement | Status: assigned Priority: normal | Milestone: R1 Component: Drivers/USB | Version: R1/Development Resolution: | Keywords: Blocked By: | Blocking: Has a Patch: 1 | Platform: All ---------------------------+---------------------------- Comment (by Pete): Replying to [comment:27 korli]: > Pete, I had a look at usb_midi.diff (which I suppose is the latest diff). Yes. > > I found little oddities: Heh -- If you look at the original source, you'll see it's really one big style violation...! It was written, I think, long before the guidelines were laid down, and in fact is mostly built on top of Takayuki's original usb_joy code. In general I tried to conform to the style it was written in, rather than 'Haikuize' the new bits. (Rewriting the whole thing is more than I wanted to take on right now.) > * function declarations like "add_port_info(usbmidi_port_info* port);" should have their return type on the same line, not the previous line. This is as in the original. > * in the following line packet->cn value isn't checked against ports size: > {{{ > usbmidi_port_info* port = midiDevice->ports[packet->cn]; > }}} I don't think the USB protocol could ever cause a mismatch here. I don't think one needs to check ''every'' variable against limits! I think some of your other points are a result of conforming to the existing style, but I'll check through them. > I'd switch to cpp after this patch to ease things. Desirable, yes, but not a small job. (I'd really hope that needed updates like this won't be canned just because of older style. To my mind, consistency is better than a mixed style. Jerome was happy to keep the old forms when he did it...!) -- Ticket URL: <http://dev.haiku-os.org/ticket/4463#comment:28> Haiku <http://dev.haiku-os.org> Haiku - the operating system.