Re: [Freeciv-Dev] I18n: Patch marked strings
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
David Pfitzner <dwp@xxxxxxxxxxxxxx> writes:
> Also, is there any reason for not following the "standard"
> header grouping when adding '#include "fcintl.h"'?
> (Probably my fault for not adding the explanation about
> this to the hackers guide or contribute.html yet;
> if there is no good reason, it should go alphabetically
> in with the rest of the headers from common/.)
Perhaps we should add a section to the hacker's guide, as it is not
that obvious. Suggestion:
===========================================================================
Mini Style Guide
===========================================================================
If you want to hack FreeCiv, and want your patches to be accepted, it
helps to follow some simple style rules:
- Use K&R indentation style with indentation 2 (in doubt, use
'indent -kr -i2').
- First state all system include files with <> in alphabetic order,
then all FreeCiv include files with "", sorted by folder (common,
server...) and then by alphabet, with a blank line between the
sections. This helps avoiding adding unnecessary include files.
- If you use a system specific feature, don't add #ifdef __CRAY__ or
something like that. Rather write a check for that feature for
configure.in and use a meaningful macro name in the source.
- Don't use C++-style // comments.
- If you send patches, use diff -u.
===========================================================================
Note: I tried using 'indent -kr -i2' on the source, and actually there
are lots of differences; mostly improvements. Probably we should
reindent all existing source to make it look nicer. The problem is
that this would make old diffs unusable.
Falk
|
|