Index: client/options.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/options.c,v retrieving revision 1.36 diff -u -r1.36 options.c --- options.c 2000/08/27 07:00:09 1.36 +++ options.c 2000/09/05 17:50:11 @@ -91,7 +91,7 @@ unsigned int messages_where[E_LAST]; int sorted_events[E_LAST]; -char *message_text[E_LAST]={ +const char *message_text[E_LAST]={ N_("Low Funds"), /* E_LOW_ON_FUNDS */ N_("Pollution"), /* E_POLLUTION */ N_("Global Eco-Disaster"), /* E_GLOBAL_ECO */ Index: client/options.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/options.h,v retrieving revision 1.8 diff -u -r1.8 options.h --- options.h 2000/06/25 13:16:16 1.8 +++ options.h 2000/09/05 17:50:11 @@ -66,7 +66,7 @@ #define MW_POPUP 4 /* popup an individual window */ extern unsigned int messages_where[]; /* OR-ed MW_ values [E_LAST] */ -extern char *message_text[]; /* [E_LAST] */ +extern const char *message_text[]; /* [E_LAST] */ extern int sorted_events[]; /* [E_LAST], sorted by message_text */ Index: client/tilespec.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v retrieving revision 1.36 diff -u -r1.36 tilespec.c --- tilespec.c 2000/08/14 12:42:01 1.36 +++ tilespec.c 2000/09/05 17:50:15 @@ -373,7 +373,7 @@ ***********************************************************************/ static char *nsew_str(int idx) { - static char c[] = "n0s0e0w0"; + static char c[9]; /* strlen("n0s0e0w0") + 1 == 9 */ sprintf(c, "n%ds%de%dw%d", BOOL_VAL(idx&BIT_NORTH), BOOL_VAL(idx&BIT_SOUTH), BOOL_VAL(idx&BIT_EAST), BOOL_VAL(idx&BIT_WEST)); @@ -391,7 +391,7 @@ static void tilespec_lookup_sprite_tags(void) { char buffer[512]; - char dir_char[] = "nsew"; + const char dir_char[] = "nsew"; int i, j; assert(sprite_hash); Index: common/government.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/government.c,v retrieving revision 1.20 diff -u -r1.20 government.c --- government.c 2000/08/14 12:42:03 1.20 +++ government.c 2000/09/05 17:50:22 @@ -62,11 +62,11 @@ struct ai_gov_tech_hint ai_gov_tech_hints[MAX_NUM_TECH_LIST]; -static char *flag_names[] = { +static const char *flag_names[] = { "Build_Veteran_Diplomats", "Revolution_When_Unhappy", "Has_Senate", "Unbribable", "Inspires_Partisans", "Rapture_City_Growth" }; -static char *hint_names[] = { +static const char *hint_names[] = { "Is_Nice", "Favors_Growth" }; Index: common/improvement.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/improvement.c,v retrieving revision 1.2 diff -u -r1.2 improvement.c --- improvement.c 2000/08/31 13:32:45 1.2 +++ improvement.c 2000/09/05 17:50:23 @@ -31,7 +31,7 @@ /* Names of effect ranges. * (These must correspond to enum effect_range_id in improvement.h.) */ -static char *effect_range_names[] = { +static const char *effect_range_names[] = { "None", "Building", "City", @@ -43,7 +43,7 @@ /* Names of effect types. * (These must correspond to enum effect_type_id in improvement.h.) */ -static char *effect_type_names[] = { +static const char *effect_type_names[] = { "Adv_Parasite", "Airlift", "Any_Government", @@ -139,7 +139,7 @@ /************************************************************************** Return effect range name; NULL if bad id. **************************************************************************/ -char *effect_range_name(Eff_Range_id id) +const char *effect_range_name(Eff_Range_id id) { assert(sizeof(effect_range_names)/sizeof(effect_range_names[0])==EFR_LAST); @@ -172,7 +172,7 @@ /************************************************************************** Return effect type name; NULL if bad id. **************************************************************************/ -char *effect_type_name(Eff_Type_id id) +const char *effect_type_name(Eff_Type_id id) { assert(sizeof(effect_type_names)/sizeof(effect_type_names[0])==EFT_LAST); Index: common/improvement.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/improvement.h,v retrieving revision 1.2 diff -u -r1.2 improvement.h --- improvement.h 2000/08/31 13:32:45 1.2 +++ improvement.h 2000/09/05 17:50:24 @@ -200,9 +200,9 @@ /* improvement effect functions */ Eff_Range_id effect_range_from_str(char *str); -char *effect_range_name(Eff_Range_id id); +const char *effect_range_name(Eff_Range_id id); Eff_Type_id effect_type_from_str(char *str); -char *effect_type_name(Eff_Type_id id); +const char *effect_type_name(Eff_Type_id id); /* improvement functions */ Index: common/map.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.c,v retrieving revision 1.59 diff -u -r1.59 map.c --- map.c 2000/08/09 13:24:20 1.59 +++ map.c 2000/09/05 17:50:26 @@ -46,7 +46,7 @@ /* Names of specials. * (These must correspond to enum tile_special_type in terrain.h.) */ -static char *tile_special_type_names[] = +static const char *tile_special_type_names[] = { N_("Special1"), N_("Road"), @@ -266,7 +266,7 @@ /*************************************************************** ... ***************************************************************/ -char *get_special_name(enum tile_special_type type) +const char *get_special_name(enum tile_special_type type) { int inx; Index: common/map.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.h,v retrieving revision 1.65 diff -u -r1.65 map.h --- map.h 2000/08/21 17:54:07 1.65 +++ map.h 2000/09/05 17:50:28 @@ -203,7 +203,7 @@ enum tile_terrain_type get_terrain_by_name(char * name); char *get_terrain_name(enum tile_terrain_type type); enum tile_special_type get_special_by_name(char * name); -char *get_special_name(enum tile_special_type type); +const char *get_special_name(enum tile_special_type type); int is_terrain_near_tile(int x, int y, enum tile_terrain_type t); int count_terrain_near_tile(int x, int y, enum tile_terrain_type t); int is_special_near_tile(int x, int y, enum tile_special_type spe); Index: common/player.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/player.c,v retrieving revision 1.61 diff -u -r1.61 player.c --- player.c 2000/08/17 03:20:21 1.61 +++ player.c 2000/09/05 17:50:29 @@ -431,7 +431,7 @@ **************************************************************************/ const char *diplstate_text(const enum diplstate_type type) { - static char *ds_names[DS_LAST] = + static const char *ds_names[DS_LAST] = { N_("Neutral"), N_("War"), Index: common/tech.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/tech.c,v retrieving revision 1.24 diff -u -r1.24 tech.c --- tech.c 2000/05/31 13:35:15 1.24 +++ tech.c 2000/09/05 17:50:30 @@ -26,7 +26,7 @@ server/ruleset.c (for the server) client/packhand.c (for the client) */ -static char *flag_names[] = { +static const char *flag_names[] = { "Bonus_Tech","Boat_Fast","Bridge","Railroad","Fortress", "Population_Pollution_Inc","Trade_Revenue_Reduce","Airbase","Farmland" }; Index: common/unittype.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/unittype.c,v retrieving revision 1.2 diff -u -r1.2 unittype.c --- unittype.c 2000/08/14 12:48:28 1.2 +++ unittype.c 2000/09/05 17:50:31 @@ -35,24 +35,24 @@ client/packhand.c (for the client) */ -static char *move_type_names[] = { +static const char *move_type_names[] = { "Land", "Sea", "Heli", "Air" }; -static char *flag_names[] = { +static const char *flag_names[] = { "Caravan", "Missile", "IgZOC", "NonMil", "IgTer", "Carrier", "OneAttack", "Pikemen", "Horse", "IgWall", "FieldUnit", "AEGIS", "Fighter", "Marines", "Partial_Invis", "Settlers", "Diplomat", "Trireme", "Nuclear", "Spy", "Transform", "Paratroopers", "Airbase", "Cities", "IgTired", "Missile_Carrier", "No_Land_Attack" }; -static char *role_names[] = { +static const char *role_names[] = { "FirstBuild", "Explorer", "Hut", "HutTech", "Partisan", "DefendOk", "DefendGood", "AttackFast", "AttackStrong", "Ferryboat", "Barbarian", "BarbarianTech", "BarbarianBoat", "BarbarianBuild", "BarbarianBuildTech", "BarbarianLeader", "BarbarianSea", "BarbarianSeaTech" }; -static char *unit_class_names[] = { +static const char *unit_class_names[] = { "Air", "Helicopter", "Land", @@ -206,7 +206,7 @@ /************************************************************************** ... **************************************************************************/ -char *unit_class_name(Unit_Class_id id) +const char *unit_class_name(Unit_Class_id id) { if ((id >= 0) && (id < UCL_LAST)) { return unit_class_names[id]; Index: common/unittype.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/unittype.h,v retrieving revision 1.2 diff -u -r1.2 unittype.h --- unittype.h 2000/08/14 12:48:28 1.2 +++ unittype.h 2000/09/05 17:50:34 @@ -190,7 +190,7 @@ int unit_value(Unit_Type_id id); char *unit_name(Unit_Type_id id); -char *unit_class_name(Unit_Class_id id); +const char *unit_class_name(Unit_Class_id id); char *get_unit_name(Unit_Type_id id); char *get_units_with_flag_string(int flag); Index: server/gotohand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/gotohand.c,v retrieving revision 1.86 diff -u -r1.86 gotohand.c --- gotohand.c 2000/08/30 22:56:12 1.86 +++ gotohand.c 2000/09/05 17:50:52 @@ -948,7 +948,7 @@ const int dest_x, const int dest_y) { int k, d[8], x, y, n, a, best = 0, d0, d1, h0, h1, u, c; - char *dir[] = { "NW", "N", "NE", "W", "E", "SW", "S", "SE" }; + const char *dir[] = { "NW", "N", "NE", "W", "E", "SW", "S", "SE" }; struct tile *ptile, *adjtile; int nearland; struct city *pcity; Index: server/report.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/report.c,v retrieving revision 1.4 diff -u -r1.4 report.c --- report.c 2000/08/31 13:32:49 1.4 +++ report.c 2000/09/05 17:50:56 @@ -37,7 +37,7 @@ HISTORIAN_HAPPIEST=3, HISTORIAN_LARGEST=4}; -static char *historian_message[]={ +static const char *historian_message[]={ N_("%s report on the RICHEST Civilizations in the World."), N_("%s report on the most ADVANCED Civilizations in the World."), N_("%s report on the most MILITARIZED Civilizations in the World."), @@ -45,7 +45,7 @@ N_("%s report on the LARGEST Civilizations in the World.") }; -static char *historian_name[]={ +static const char *historian_name[]={ N_("Herodotus'"), N_("Thucydides'"), N_("Pliny the Elder's"), @@ -70,7 +70,7 @@ ((const struct player_score_entry *)a)->value); } -static char *greatness[MAX_NUM_PLAYERS] = { +static const char *greatness[MAX_NUM_PLAYERS] = { N_("Magnificent"), N_("Glorious"), N_("Great"), N_("Decent"), N_("Mediocre"), N_("Hilarious"), N_("Worthless"), N_("Pathetic"), N_("Useless"), "Useless", "Useless", "Useless", "Useless", "Useless", Index: server/savegame.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v retrieving revision 1.2 diff -u -r1.2 savegame.c --- savegame.c 2000/08/31 13:32:49 1.2 +++ savegame.c 2000/09/05 17:51:09 @@ -51,8 +51,8 @@ #include "savegame.h" -static char dec2hex[] = "0123456789abcdef"; -static char terrain_chars[] = "adfghjm prstu"; +static const char dec2hex[] = "0123456789abcdef"; +static const char terrain_chars[] = "adfghjm prstu"; /* Following does not include "unirandom", used previously; add it if * appropriate. (Code no longer looks at "unirandom", but should still