Hi,
After chatting with a couple of the guys in IRC, I appreciate why such cleanup work (as I present here) is not (at this time) suitable for inclusion in the public SVN repo. They have made clear their reasons in a polite and respectable manner, and I respect their decision.
However, I believe my changes to core/kbd.c may be of use to other developers, especially newcomers. So rather than keep my work secret, in the spirit of open-source here is my work...
Why might it be useful?
The code is far more readable now: Variables have names which reflect their content; Variables are declared to scope; Whitespace cleanup; More consistent code style.
And also, there are several code optimisations: No checking the same variable 5 times on the way to a single line of code; Reduced the number of calls to O(n) core functions; Further logic reductions to reduce RAM access, CPU useage, source size, *and* obfuscation of intent.
I have tested this code with my IXUS 220 HS and all functionality works well.
Enjoy!
BC
(Plus if I lose my copy, I can always get it back from here!)