Hi,

> > Just a little note to whoever is working on and understands the save
> > game code.
> > Sorry to be anal but (just looking at the code sample from Matt's
> > earlier post)
> > is it possible that more descriptive variable names can be used
> > rather than
> > 'foo'?

I changed foo -> save_struc and bar -> token, which IMHO more closely
describe their meanings. No one was supposed to look at that code
initially (since it's not human-made anyway), but this might help if you
want to debug cfsml.pl from this side.

> >  More to the point, some good (or any :-) ) commenting would be
> > a huge
> > help so that hours don't have to be wasted to understand code
> > anywhere in FreeSCI.

Automatic commenting in automatically generated code isn't that easy, I'm
afraid ;-)
Please have a look at doc/misc/cfsml.spec; this might help with reading
the cfsml source file and understanding what the code generator does.

> Actually, I would really like it if the savegame.cfsml wouldn't declare
> the bar, min, max, i variables in a function

Just to clarify: That's done by the code generator, not the source file
(you probably knew that, but I thought it should be mentioned here).

> unless they're going to
> be used. This would eliminate a couple hundred "unused variable" warning
> in VC++.

Variable declaration is done pretty early on in the subs 'create_reader'
and 'create_writer' in cfsml.pl. You could move the current code
generation part into a second pass and test for the necessity to declare
the variables before that.

llap,
 Christoph


Reply via email to