[Freeciv-Dev] (PR#11489) More const struct player
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11489 >
Here's the second half of #11478, including the changes to text.[ch]
that were withheld.
--
Frédéric Brière <*> fbriere@xxxxxxxxxxx
=> <fbriere@xxxxxxxxxx> IS NO MORE: <http://www.abacomsucks.com> <=
Index: client/text.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.c,v
retrieving revision 1.18
diff -u -r1.18 text.c
--- client/text.c 11 Dec 2004 10:34:46 -0000 1.18
+++ client/text.c 12 Dec 2004 08:44:19 -0000
@@ -682,7 +682,7 @@
Return text giving the ping time for the player. This is generally used
used in the playerdlg. This should only be used in playerdlg_common.c.
****************************************************************************/
-const char *get_ping_time_text(struct player *pplayer)
+const char *get_ping_time_text(const struct player *pplayer)
{
INIT;
Index: client/text.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.h,v
retrieving revision 1.8
diff -u -r1.8 text.h
--- client/text.h 12 Dec 2004 03:44:47 -0000 1.8
+++ client/text.h 12 Dec 2004 08:44:19 -0000
@@ -36,7 +36,7 @@
const char *get_spaceship_descr(struct player_spaceship *pship);
const char *get_timeout_label_text(void);
const char *format_duration(int duration);
-const char *get_ping_time_text(struct player *pplayer);
+const char *get_ping_time_text(const struct player *pplayer);
const char *get_report_title(const char *report_name);
const char *get_happiness_buildings(const struct city *pcity);
const char *get_happiness_wonders(const struct city *pcity);
Index: client/plrdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.c,v
retrieving revision 1.14
diff -u -r1.14 plrdlg_common.c
--- client/plrdlg_common.c 12 Dec 2004 03:44:47 -0000 1.14
+++ client/plrdlg_common.c 12 Dec 2004 08:44:19 -0000
@@ -71,7 +71,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_name(struct player *player)
+static const char *col_name(const struct player *player)
{
return player->name;
}
@@ -79,7 +79,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_username(struct player *player)
+static const char *col_username(const struct player *player)
{
return player->username;
}
@@ -87,7 +87,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_nation(struct player *player)
+static const char *col_nation(const struct player *player)
{
return get_nation_name(player->nation);
}
@@ -95,7 +95,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_team(struct player *player)
+static const char *col_team(const struct player *player)
{
if (player->team != TEAM_NONE) {
return team_get_by_id(player->team)->name;
@@ -107,7 +107,7 @@
/******************************************************************
...
*******************************************************************/
-static bool col_ai(struct player *plr)
+static bool col_ai(const struct player *plr)
{
return plr->ai.control;
}
@@ -115,7 +115,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_embassy(struct player *player)
+static const char *col_embassy(const struct player *player)
{
return get_embassy_status(game.player_ptr, player);
}
@@ -123,7 +123,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_diplstate(struct player *player)
+static const char *col_diplstate(const struct player *player)
{
static char buf[100];
const struct player_diplstate *pds;
@@ -145,7 +145,7 @@
/******************************************************************
Return a string displaying the AI's love (or not) for you...
*******************************************************************/
-static const char *col_love(struct player *player)
+static const char *col_love(const struct player *player)
{
if (player == game.player_ptr || !player->ai.control) {
return "-";
@@ -157,7 +157,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_vision(struct player *player)
+static const char *col_vision(const struct player *player)
{
return get_vision_status(game.player_ptr, player);
}
@@ -165,7 +165,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_reputation(struct player *player)
+static const char *col_reputation(const struct player *player)
{
return reputation_text(player->reputation);
}
@@ -173,7 +173,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_state(struct player *plr)
+static const char *col_state(const struct player *plr)
{
if (plr->is_alive) {
if (plr->is_connected) {
@@ -193,7 +193,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_host(struct player *player)
+static const char *col_host(const struct player *player)
{
return player_addr_hack(player);
}
@@ -201,7 +201,7 @@
/******************************************************************
...
*******************************************************************/
-static const char *col_idle(struct player *plr)
+static const char *col_idle(const struct player *plr)
{
int idle;
static char buf[100];
Index: client/plrdlg_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.h,v
retrieving revision 1.9
diff -u -r1.9 plrdlg_common.h
--- client/plrdlg_common.h 12 Dec 2004 03:44:47 -0000 1.9
+++ client/plrdlg_common.h 12 Dec 2004 08:44:19 -0000
@@ -33,10 +33,10 @@
struct player_dlg_column {
bool show;
enum player_dlg_column_type type;
- const char *title; /* already translated */
- const char *(*func)(struct player*); /* if type = COL_*TEXT */
- bool (*bool_func)(struct player*); /* if type = COL_BOOLEAN */
- const char *tagname; /* for save_options */
+ const char *title; /* already translated */
+ const char *(*func)(const struct player*); /* if type = COL_*TEXT */
+ bool (*bool_func)(const struct player*); /* if type = COL_BOOLEAN */
+ const char *tagname; /* for save_options */
};
extern struct player_dlg_column player_dlg_columns[];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#11489) More const struct player,
Frédéric Brière <=
|
|