[crossfire] code cleanup commit.

Mark Wedel mwedel at sonic.net
Mon Jun 5 02:01:37 CDT 2006


  I just did a commit which really doesn't change any code, but does clean up 
some compiler warnings (now the core area compiles without warnings when 
compiled with gcc -Wall -Wno-char-subscripts).

  As part of that, I removed a bunch of functions that were not being used (with 
#if 0/#endif blocks).  In some cases, I'm not sure if some may be work in 
progress or plan to be used, and thus not ripped out.

  That said, my belief would be that if there are no indications that they are 
needed, those blocks of codes should just get removed in a couple months - no 
reason to have code around that no one is using (and if someone really wants it 
again, it is in CVS).

  But just looking for #if 0 within the code, there are about 90 such uses.

  Most are of the nature:
#if 0
  LOG(...)
#endif

Which are harmless, but I think we should do a real logging system so that isn't 
needed - instead, pass in the type of log message (object, map, player, spell) 
to the log function, and then be able to specify what log messages we want via 
command like, like 'crossfire -debugmsg +map,+player' - that is what a lot of 
other programs do, and to me makes a lot more sense.

  A fair number of other #if 0 are disabling small portions of code to turn off 
some undesirable behaviour.  I'm thinking that these should either be just 
pulled out, or if they might be useful, should be enabled either via real 
#ifdefs or settings.

  Thoughts?




More information about the crossfire mailing list