Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8569) num_player_dlg_columns value
Home

[Freeciv-Dev] (PR#8569) num_player_dlg_columns value

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8569) num_player_dlg_columns value
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Apr 2004 21:52:32 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8569 >

freeciv@xxxxxxxxxxxxxxxxxxx wrote:
> This is an automated notification of a change to freeciv cvs, 
> on Wed Apr 21 19:15:38 PDT 2004 = Thu Apr 22 02:15:38 2004 (GMT)
> by Vasco Alexandre da Silva Costa <vasc@xxxxxxxxxxxxxxx>
> 
> ---- Files affected:
> 
> freeciv/client plrdlg_common.c plrdlg_common.h options.c
> freeciv/client/gui-gtk-2.0 plrdlg.c
> 
> ---- Log message:
>       Tag: HEAD
> 
> Replaced NUM_PLAYER_DLG_COLUMNS constant with num_player_dlg_columns variable.

This value would be better as a const.

In the city report I once tried doing the same thing.  However that 
value is used in the declaration of some global arrays, so it can't be a 
variable.  It's possible this will happen to the playerdlg value as well.

jason

Index: client/plrdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.c,v
retrieving revision 1.6
diff -u -r1.6 plrdlg_common.c
--- client/plrdlg_common.c      22 Apr 2004 02:15:38 -0000      1.6
+++ client/plrdlg_common.c      22 Apr 2004 04:50:14 -0000
@@ -236,7 +236,7 @@
   {TRUE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, NULL, "ping"}
 };
 
-int num_player_dlg_columns;
+const int num_player_dlg_columns = ARRAY_SIZE(player_dlg_columns);
 
 /******************************************************************
  ...
@@ -252,8 +252,6 @@
 void init_player_dlg_common()
 {
   int i;
-
-  num_player_dlg_columns = ARRAY_SIZE(player_dlg_columns);
 
   for (i = 0; i < num_player_dlg_columns; i++) {
     player_dlg_columns[i].title = Q_(player_dlg_columns[i].title);
Index: client/plrdlg_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.h,v
retrieving revision 1.4
diff -u -r1.4 plrdlg_common.h
--- client/plrdlg_common.h      22 Apr 2004 02:15:38 -0000      1.4
+++ client/plrdlg_common.h      22 Apr 2004 04:50:14 -0000
@@ -40,7 +40,7 @@
 };
 
 extern struct player_dlg_column player_dlg_columns[];
-extern int num_player_dlg_columns;
+extern const int num_player_dlg_columns;
 
 const char *get_ping_time_text(struct player *pplayer);
 void init_player_dlg_common(void);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8569) num_player_dlg_columns value, Jason Short <=