Rewrite of trunk/core/kbd.c - General Discussion and Assistance - CHDK Forum  

Rewrite of trunk/core/kbd.c

  • 3 Replies
  • 1635 Views
Rewrite of trunk/core/kbd.c
« on: 22 / January / 2012, 18:50:22 »
Advertisements
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!)
« Last Edit: 24 / January / 2012, 22:06:08 by BlueChip »

Re: Rewrite of trunk/core/kbd.c
« Reply #1 on: 22 / January / 2012, 19:54:33 »
removed
« Last Edit: 22 / January / 2012, 22:49:19 by BlueChip »

Re: Rewrite of trunk/core/kbd.c
« Reply #2 on: 22 / January / 2012, 22:42:28 »
removed
« Last Edit: 22 / January / 2012, 22:49:38 by BlueChip »

Re: Rewrite of trunk/core/kbd.c
« Reply #3 on: 24 / January / 2012, 22:13:49 »
New first uploaded to first post


 

Related Topics