summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-09-20 23:11:01 +0000
committersmatz <smatz@openttd.org>2009-09-20 23:11:01 +0000
commit114d48e492cc38644c0c020c6a30ab6c57179862 (patch)
tree80044362459c1f30b75b8eb8d9020f318d3ce5fb /src/table
parente07efc2370b0c846f792a4f5d3f8695c21895583 (diff)
downloadopenttd-114d48e492cc38644c0c020c6a30ab6c57179862.tar.xz
(svn r17596) -Codechange: constify some tables
Diffstat (limited to 'src/table')
-rw-r--r--src/table/elrail_data.h10
-rw-r--r--src/table/pricebase.h2
-rw-r--r--src/table/station_land.h2
-rw-r--r--src/table/strgen_tables.h2
-rw-r--r--src/table/unicode.h2
-rw-r--r--src/table/unmovable_land.h4
6 files changed, 11 insertions, 11 deletions
diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h
index a40fcaa92..55725a249 100644
--- a/src/table/elrail_data.h
+++ b/src/table/elrail_data.h
@@ -38,7 +38,7 @@ enum {
};
/** Which PPPs are possible at all on a given PCP */
-static byte AllowedPPPonPCP[DIAGDIR_END] = {
+static const byte AllowedPPPonPCP[DIAGDIR_END] = {
1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
@@ -48,7 +48,7 @@ static byte AllowedPPPonPCP[DIAGDIR_END] = {
/** Which of the PPPs are inside the tile. For the two PPPs on the tile border
* the following system is used: if you rotate the PCP so that it is in the
* north, the eastern PPP belongs to the tile. */
-static byte OwnedPPPonPCP[DIAGDIR_END] = {
+static const byte OwnedPPPonPCP[DIAGDIR_END] = {
1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW,
1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_NW,
@@ -70,7 +70,7 @@ static const DiagDirection PCPpositions[TRACK_END][2] = {
* track, plus the point in extension of the track (to mark end-of-track). PCPs
* which are not on either end of the track are fully preferred.
* @see PCPpositions */
-static byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
+static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
{ // X
1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE
PCP_NOT_ON_TRACK, // SE
@@ -111,7 +111,7 @@ static byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
/** In case we have a staight line, we place pylon only every two tiles,
* so there are certain tiles which we ignore. A straight line is found if
* we have exactly two PPPs. */
-static byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
+static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
{ // Ignore group 1, X and Y tracks
{ // X even, Y even
IGNORE_NONE,
@@ -186,7 +186,7 @@ static byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
#undef NO_IGNORE
/** Which pylons can definately NOT be built */
-static byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
+static const byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
{1 << DIR_SW | 1 << DIR_NE, 0, 1 << DIR_SW | 1 << DIR_NE, 0 }, // X
{0, 1 << DIR_NW | 1 << DIR_SE, 0, 1 << DIR_NW | 1 << DIR_SE}, // Y
{1 << DIR_W | 1 << DIR_E, 0, 0, 1 << DIR_W | 1 << DIR_E }, // UPPER
diff --git a/src/table/pricebase.h b/src/table/pricebase.h
index 8876c6b43..364dd3f82 100644
--- a/src/table/pricebase.h
+++ b/src/table/pricebase.h
@@ -9,7 +9,7 @@
/** @file pricebase.h Price Bases */
-static PriceBaseSpec _price_base_specs[NUM_PRICES] = {
+static const PriceBaseSpec _price_base_specs[NUM_PRICES] = {
{ 100, PCAT_NONE }, ///< station_value
{ 100, PCAT_CONSTRUCTION}, ///< build_rail
{ 95, PCAT_CONSTRUCTION}, ///< build_road
diff --git a/src/table/station_land.h b/src/table/station_land.h
index 5726dd57d..f6264e537 100644
--- a/src/table/station_land.h
+++ b/src/table/station_land.h
@@ -967,7 +967,7 @@ static const DrawTileSprites _station_display_datas_waypoint[] = {
#undef TILE_SPRITE_LINE
-static const DrawTileSprites *_station_display_datas[] = {
+static const DrawTileSprites * const _station_display_datas[] = {
_station_display_datas_rail,
_station_display_datas_airport,
_station_display_datas_truck,
diff --git a/src/table/strgen_tables.h b/src/table/strgen_tables.h
index 2e2eb95e6..8aae5cf3e 100644
--- a/src/table/strgen_tables.h
+++ b/src/table/strgen_tables.h
@@ -184,7 +184,7 @@ static const PluralForm _plural_forms[] = {
* a = array, i.e. list of strings
*/
/** All pragmas used */
-static const char *_pragmas[][4] = {
+static const char * const _pragmas[][4] = {
/* name flags default description */
{ "name", "0", "", "English name for the language" },
{ "ownname", "t", "", "Localised name for the language" },
diff --git a/src/table/unicode.h b/src/table/unicode.h
index 05eaa5f67..4c7f45107 100644
--- a/src/table/unicode.h
+++ b/src/table/unicode.h
@@ -24,7 +24,7 @@ enum {
* exist, or are in the wrong place, in the standard sprite fonts.
* This is not used for FreeType rendering */
-static DefaultUnicodeMapping _default_unicode_map[] = {
+static const DefaultUnicodeMapping _default_unicode_map[] = {
{ 0x00A0, 0x20 }, // Non-breaking space / Up arrow
{ 0x00A4, CLRL }, // Currency sign
{ 0x00A6, CLRL }, // Broken bar
diff --git a/src/table/unmovable_land.h b/src/table/unmovable_land.h
index bafbb8bdb..7a10e3773 100644
--- a/src/table/unmovable_land.h
+++ b/src/table/unmovable_land.h
@@ -100,10 +100,10 @@ static const DrawTileSprites _unmovable_display_datas[] = {
#undef TILE_SPRITE_LINE
-const UnmovableSpec _original_unmovable[] = {
+static const UnmovableSpec _original_unmovable[] = {
{STR_LAI_UNMOVABLE_DESCRIPTION_TRANSMITTER, 1, 1},
{STR_LAI_UNMOVABLE_DESCRIPTION_LIGHTHOUSE, 1, 1},
- {STR_TOWN_BUILDING_NAME_STATUE_1, 1, 1},
+ {STR_TOWN_BUILDING_NAME_STATUE_1, 1, 1},
{STR_LAI_UNMOVABLE_DESCRIPTION_COMPANY_OWNED_LAND, 10, 2},
{STR_LAI_UNMOVABLE_DESCRIPTION_COMPANY_HEADQUARTERS, 1, 1},
};