[openbeos-midi] Re: MIDI parser source (bytestream->MIDI messages)

  • From: "Martijn Sipkema" <msipkema@xxxxxxxxxxxxxxxxxxx>
  • To: <openbeos-midi@xxxxxxxxxxxxx>
  • Date: Sat, 31 Jan 2004 19:00:35 +0100

>> Please take a look at it and let me know if coding style and variable
>> names are okay.
[...]
> Although I wonder why you declared all local variables "static," since
> that doesn't seem to be necessary, judging from your code.

It won't work without the static, but it won't work correctly with them
either; it is not a good idea to store state in static variables. Perhaps
you only included the static variables to demonstrate the parser...

You need to have the parser be a member function of a class that
holds the state. This allows correct parsing of more than one stream
from a single application.

--ms





Other related posts: