[haiku-bugs] Re: [Haiku] #9311: usb_midi fix to handle more "Class-Compliant" devices

  • From: "Pete" <trac@xxxxxxxxxxxx>
  • Date: Wed, 26 Dec 2012 02:22:35 -0000

#9311: usb_midi fix to handle more "Class-Compliant" devices
---------------------------+-------------------------
   Reporter:  Pete         |      Owner:  mmlr
       Type:  bug          |     Status:  new
   Priority:  normal       |  Milestone:  R1
  Component:  Drivers/USB  |    Version:  R1/alpha4.1
 Resolution:               |   Keywords:
 Blocked By:               |   Blocking:
Has a Patch:  1            |   Platform:  All
---------------------------+-------------------------

Comment (by Pete):

 Replying to [comment:2 korli]:
 > Hi Pete,
 >
 > the name of the new struct variables should be more like:
 in_buffer_size, out_buffer_size.
 Hmm.  Are you objecting to the camelCase or the "...Pkt" nomenclature?
 As to the first, I saw no harm in ''starting'' to update the convention
 (:-/), but if you'd prefer consistency I can easily change it.
 I carefully avoided using the term "buffer" in any form, because the
 actual buffers remain the same size (2048 bytes), while the variables
 refer to the packets being transferred.
 > Also why did you split the else and the if lines 73-74?
 If you look at the code immediately above, you'll see a 'parallel' if
 statement (66-72 in the diff).  The else actually pairs with the if on
 line 65, but with the original layout it was very hard to parse this
 visually; the indentation of the second if block was different from the
 first.  Adding redundant braces and matching the indentation has made the
 logic much clearer. (Might help to look at the original source.)

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/9311#comment:3>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: