[Freeciv-Dev] Government file.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
goverment_patch.diff.gz
Description: governement_patch
- [Freeciv-Dev] Government file.,
Nicolas BRUNEL <=
|
|