Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] Government file.
Home

[Freeciv-Dev] Government file.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Government file.
From: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Jan 2000 22:04:11 +0000 (GMT)
Reply-to: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>

Hello,

   I had got some free time to modify common/goverment.c .

It did three things :

   - I withdraw { } containing one instructions. 
   - In a loop, if a test is done which can stop the loop, it is an
     exit condition of the loop. This condition have to be include in the
     test of exit of the loop( && !this_condition) .

   Example:
     for(i = 0; i < size; i++)
         if (ToBeFound == Tab [i]) return i;

     becomes

     for(i = 0; i < size && ToBeFound != Tab [i]; i++);
     return i;

   - & Tab[i] is equivalent to Tab+i .
     IMHO, as it is shorter, Tab+i is better. 
   
Others things I saw :

   - Lots of useless parenthesis in returns,
   - Code lines that spread on more that one line. It breaks code
   indentation,
   - FreeCiv is really a patchwork of code. All of them have differents
   styles and indentations. It's really a bazaar.
   - Lots of new files ! :) goverment.c barbarian.c worklist.c 
   that's cool

Bye,

Nicolas

Attachment: goverment_patch.diff.gz
Description: governement_patch


[Prev in Thread] Current Thread [Next in Thread]