[CF-Devel] clean code?

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Aug 18 02:32:26 CDT 2004


David Delbecq wrote:
>
     
      mm cleanup weird stuff? like using carefully a snprintf and  2 lines later 
     
     >
     
      using strcat? Well am already cleaning (and it take a huge amount of time) 
     
     >
     
      string manipulation in server code (to prevent buffer overflows :) )
     
     >
     
     
     >
     
      Le samedi 07 Août 2004 12:44, Nicolas Weeger a écrit :
     
     >
     
      tchize a écrit :
     
     >
     
     
     >>>
     
     Wandering in the code today, i was wondering. Am i the only one to feel
     
     >>>
     
     ashamed by those 'goto' in the code? When i learned programming 12 years
     
     >>>
     
     ago, i was learned never to use them because you endup with spaghetti
     
     >>>
     
     programs.
     
     >
     
     
     >
     
     
     >
     
      Well, somehow function calls & such are really gotos....
     
     >
     
      But yes, if we could avoid'em, i too think that'd be better.
     
     >
     
      Though maybe we could first clean the code of other weird stuff, fix
     
     >
     
      broken things, and so on :)
     
     
  Well, taking a quick look at the code, it seems a lot are in the apply() 
function, and taking a quick look, I can't see any reason those can't be breaks.

  Of course, that basically is the same thing as a goto.

  Some number of goto's are in computer generated code (Eg, the stuff from the 
.l files) so that's not a big deal.  But I see a good number in other places.

  It'd be nice to clean those up, but probably not as big a deal - they make the 
code a little mess, but probably don't make it more reliable.  There is a memory 
corruption leak out there someplace.


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list