Page MenuHomeFreeBSD

The simplest OSS MIDI example
ClosedPublic

Authored by meka_tilda.center on Aug 14 2022, 1:12 AM.
Tags
None
Referenced Files
F102862310: D36195.diff
Mon, Nov 18, 3:26 AM
Unknown Object (File)
Fri, Nov 15, 1:04 AM
Unknown Object (File)
Mon, Nov 11, 10:22 AM
Unknown Object (File)
Tue, Nov 5, 11:36 AM
Unknown Object (File)
Tue, Nov 5, 7:01 AM
Unknown Object (File)
Tue, Nov 5, 7:01 AM
Unknown Object (File)
Tue, Nov 5, 7:01 AM
Unknown Object (File)
Tue, Nov 5, 7:01 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

share/examples/sound/midi.c
47

Make sure you wait for 0x80 MSB set.

if (!(raw & 0x80))
continue;
share/examples/sound/midi.c
72

All switch cases should have a "default:"

share/examples/sound/ossmidi.h
33

Use #define or enum here.

meka_tilda.center marked an inline comment as done.
meka_tilda.center marked 2 inline comments as done.
share/examples/sound/ossmidi.h
33

NOTE_MASK -> CMD_MASK

Looks good, though I might want to format the code w.r.t. style a bit more before commit? Who will submit this?

This revision is now accepted and ready to land.Aug 16 2022, 1:44 PM

To be honest I don't know how the process works. Can you advise, please?

As for formatting, this is the output that indent(1) produced. Can you tell me what would make it better?

To be honest I don't know how the process works. Can you advise, please?

I think it's just a matter of you saying how you want to be referred to in the author field of the git commit :) But I think it requires a "name <email>" format.

As for formatting, this is the output that indent(1) produced. Can you tell me what would make it better?

indent is a hack from the 70s, but it can be made to produce fairly style-complaint formatting if you use it with the profile that you can find under share/examples/indent/indent.pro.
Generally we apply rules from style(9) but we also apply the existing style from a file to new code in that file. Since the two don't always agree, we sometimes reformat existing code to be style(9)-compliant and then add the new code.

I think it's just a matter of you saying how you want to be referred to in the author field of the git commit :) But I think it requires a "name <email>" format.

I though "git format-patch" will do the right thing here. But anway "Goran Mekić <meka@tilda.center>" is prefered.

indent is a hack from the 70s, but it can be made to produce fairly style-complaint formatting if you use it with the profile that you can find under share/examples/indent/indent.pro.
Generally we apply rules from style(9) but we also apply the existing style from a file to new code in that file. Since the two don't always agree, we sometimes reformat existing code to be style(9)-compliant and then add the new code.

I didn't know there are differences between indent(1) and style(9). I am now using profile from examples and the following is the product of it. I see there's vim integration with style(9) so I'll try to incorporate it into my own config.

This revision now requires review to proceed.Aug 16 2022, 6:40 PM
This revision is now accepted and ready to land.Sep 27 2022, 5:22 PM