Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Patch to reduce .ajz size by 2.5KB

Re: Patch to reduce .ajz size by 2.5KB

From: TP Diffenbach <rockbox_at_diffenbach.org>
Date: Mon, 28 Apr 2003 04:17:32 -0400

Quoting Björn Stenberg <bjorn_at_haxx.se>:

> TP Diffenbach wrote:
> > I have a patch that reduces the size of the .ajz by about 2.5KB
> (2688
> > bytes at the moment, with the possibiliy of more).
> [..]
> > Any interest?
>
> Possibly, if you tell us what it does... :-)

It replaces repeated code in settings.c with iteration over an array of structs.

It also makes adding a seting quite a bit easier; it took me significantly more time to add settings code to my lastest patch than writing the patch code proper.

Some evil casting can (i.e, "I know that the biggest value I'll be using will fit in a short, so I'll force the compiler to know it too...") achieve an additional savings of 0.5KB, possibly at some run-time cost as those values are re-adjusted.

I suspect, but can't yet prove, that I can save yet another 1KB or so by adding a few more arrays to remove more code.


So, interested? :)

-- 
Archos FM needs a Rockbox!
Received on 2003-04-28

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy