[Freeciv-Dev] Re: Freeciv commit: per: Look for information in savegames
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
Freeciv-Dev <freeciv-dev@xxxxxxxxxxx> |
Subject: |
[Freeciv-Dev] Re: Freeciv commit: per: Look for information in savegames about where n... |
From: |
Jason Dorje Short <jdorje@xxxxxxxxxxxx> |
Date: |
Wed, 19 May 2004 17:32:20 -0400 |
Raimar Falke wrote:
On Wed, May 19, 2004 at 01:20:50PM -0700, Raimar Falke wrote:
- struct map_position *start_positions; /* allocated at runtime */
+ struct start_position {
+ int x, y;
+ Nation_Type_id nation; /* May be NO_NATION_SELECTED. */
+ } *start_positions; /* allocated at runtime */
};
The old comment was placed correctly. The new ones aren't.
How so?
AFAICT there are no rules for the placement of such comments. The style
guide says:
- Comments in declarations. If you need to comment a declared variable,
it should be as such:
struct foo {
int bar; /* bar is used for ....
* in ..... way */
int blah; /* blah is used for .... */
};
but this doesn't say anything about indentation (which should include an
exact number of tabs or a column number), just about general placement
and multiple lines.
void init_new_game(void)
{
- Nation_Type_id start_pos[MAX_NUM_PLAYERS];
+#define NO_START_POS -1
Why is this needed? Why can't another bool array be used? Why not a
const with function scope? And when a define is used why isn't this
undefined after the function?
A bool array is possible but IMO inferior. However it should be a const
with function scope.
jason
|
|