(svn r17596) -Codechange: constify some tables

This commit is contained in:
smatz
2009-09-20 23:11:01 +00:00
parent ea2d089daf
commit f85b8c4e09
36 changed files with 64 additions and 64 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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" },

View File

@@ -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

View File

@@ -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},
};