Converting iso-4217-currencies.scm to C?

Christian Stimming stimming at tuhh.de
Sat Feb 7 05:12:36 EST 2009


Am Freitag, 6. Februar 2009 20:03 schrieb Derek Atkins:
> Quoting Alan Jenkins <sourcejedi.lkml at googlemail.com>:
> > Hi, I'm still finding my way around GnuCash.  I came across
> > iso-4217-currencies.c which is 3000 lines of autogenerated code.  Seems
> > to me it would be simpler (less code, marginally faster) to have all the
> > data in a C array, and loop over it instead of having a call for every
> > single currency.  I'll send a patch for it - unless there's a good
> > reason for keeping it as is?
>
> I was just writing a diatribe on how you shouldn't mess with
> the way it is now...  But as I think about it I don't see any
> reason that a scheme -> C generator is any better than a C file
> that contains an array of the entries.  In both cases you need to
> rebuild GnuCash for the changes to take effect.

Right now we have a scheme -> C generator that generates a list of 3000 
function calls. I think Alan's proposal was to change this into a generator 
that generates a C array with 3000 entries, and writing some simple looping 
code that loops over this array. In effect, I think this isn't much of a 
difference (meaning Alan's time can probably be spent on more important 
things instead), but if Alan would like to submit a patch, I'd probably agree 
to commit this.

Regards,

Christian


More information about the gnucash-devel mailing list