here's a small list of cleanup I'd like to tackle once the bl2 shipment is
completed, so you're not too surprised next week. Quite some of these
already exist in my local copy of the sources. I'm holding back on the
commits until after bl2.
1) function pointer usage in find.c: we currently cast pointers to
different types of functions (different return types and number of
arguments) into a common type 'char *(*FP)()'. That's inherently an
unsafe operation, and thus should be avoided, if possible. I have
changed that already in my local copy.
2) 'global.h' has to go, IMHO. Per-module header files are the way to
3) remove any occurence of 'extern' in the .c files. Anything declared
'extern' should be in a header file of the module providing it, not
in the source using it. The same goes for prototypes of functions
not living in the same sourcefile --> off to the headerfiles with it!
4) after 3), all remaining prototypes and the functions they declare
can, and IMHO should be made 'static'. Minimizes the potential for
name space cluttering, and isolates modules better.
5) all variables not used by other modules should be flagged 'static'
too, to isolate the modules from each other as neatly as possible.
6) #if and #ifdef's checking for particular operating systems should
be removed, by and by. Check for features, where necessary. E.g.,
it's totally unclear what a line like (from invlib.h):
#if u3b || u3b2 || u3b5 || u3b15 || uts
is supposed to mean. It doesn't contain any information to the
fellow programmer about why this test is needed, in the first
place. A nightmare if you're porting to some new platform.
For someone like me, not
having used any of the systems distinguished by these names,
it takes quite some staring at the code to see that this is
querying if the OS is 8-bit clean. Now, if that line had
or so, that'd be a whole different story.
Hans-Bernhard Broeker (broeker@...)
Even if all the snow were burnt, ashes would remain.