Closed msoucy closed 9 years ago
Travis likes 8 width tabs (K&R and all that jazz), but I don't see any reason not to make the array indices changes.
Tab width shouldn't matter as if anyone is being reasonable they should be tab characters so it shows up properly for whoever is editing it. Spaces should only be included for things that need to visually line up. There are very few of those.
Wow I misread that diff. They are currently tab characters, this would be a move to 4 space indentation.
Using anything but 8 width tabs in C is lobotomy-worthy. Torvalds does an excellent job of explaining why in the Linux kernel coding standards document, as does the appendix of K&R version 2 (version 3 supports the heretical viewpoint and didn't involve both K and R; it's also incorrect about bracket placement; long live version 2).
I'm fine with switching to array-style pointer arithmetic and neat-o struct field access. Note that the unused 'duty' variable in saw and triangle wave generator functions is a mistake in the header file, not the implementation. I'm surprised that clang didn't complain about that even in pedantic mode.
I also misread that. The mobile GitHub interface doesn't even let you think about looking at the binary diff.
So, the style was literally just me being dumb and running astyle. I can fix that easily.
The unused "duty" variable was to allow the "function pointer lookup" instead of the switch statements in poly_gen_kernel
Also I'm a bad person and made this pull request off of my fork's master
. I honestly don't care enough to fix that.
I've found that function pointers are slower than letting the compiler decide to inline the generating functions; compare with my last attempt at building a synth library called libADSR. I haven't explicitly inlined these functions because there is no compiler-agnostic way of doing it and both GCC and Clang choose to inline them with -O2.
Including turning some pointer addition into array indices (there's literally no difference from the generated ASM, it's just to make things more legible)