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: hcl: apps database.c, 1.5, 1.6 database.h, 1.4, 1.5 main.c

Re: hcl: apps database.c, 1.5, 1.6 database.h, 1.4, 1.5 main.c

From: Michiel van der Kolk <michiel_at_snt.utwente.nl>
Date: 2005-07-01

On Fri, Jul 01, 2005 at 08:50:22PM +0200, Daniel Stenberg wrote:
> On Fri, 1 Jul 2005, cvs@labb.contactor.se wrote:
>
> Nice work, HCl!
>
> Is there some docs/notes anywhere on how to get going with this runtime db?
>
> And some nits on the code:
>
> >+void writetagdbheader(void) {
>
> We normally put the brace in the first column on the next line when we
> write functions in Rockbox.

okay, i'll keep that in mind from this point
>
> >tagdb_shiftdown(FILERECORD2OFFSET(currentferecord),FILERECORD2OFFSET(restrecord),(tagdbheader.filecount-restrecord)*FILEENTRY_SIZE);
>
> We write code that is less than 80 columns wide.
>
yea, i'll split it up in multiple lines >.>

> >+ &rundbheader,
> >+ &rundb_fd,
> >+ &rundb_initialized,
> > strncmp,
>
> Always append new functions last in the struct. That way we don't break
> existing plugins.
>
Yea, sorry.. it was partly caused by a cvs conflict.. two people adding
at the same time..

> --- edittoken.h 27 Jun 2005 22:43:11 -0000 1.4
> +++ edittoken.h 1 Jul 2005 17:29:44 -0000 1.5
> @@ -88,7 +88,7 @@
>
> struct token {
> char kind;
> - char spelling[SPELLING_LENGTH + 1];
> + char spelling[SPELLING_LENGTH + 3];
> long intvalue;
> };
>
> Why the +3 ? AFAIU, the code fills in SPELLING_LENGTH bytes there and I
> understand 1 extra for a terminating zero.
+3 to get it 32bits aligned...
>
> Could you perhaps add a comment explaining the 3?
>
> [token.h]
> struct token {
> - unsigned char kind;
> - char spelling[255]; // 255 should make it aligned again..
> - long intvalue;
> + char kind;
> + char spelling[SPELLING_LENGTH + 3];
> + long intvalue;
> };
>
> This is the same struct declared again. Isn't it nicer to have it in just
> one header file?
>
Yes, and i would very much prefer to have a single header file, however,
it would need to be a shared header between two plugins, and i couldn't
see a way to do this :/

> --
> Daniel Stenberg -- http://www.rockbox.org/ -- http://daniel.haxx.se/
> _______________________________________________
> http://cool.haxx.se/mailman/listinfo/rockbox
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on Fri Jul 1 21:27:58 2005


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa