Changeset - r13086:71e929261037
src/base_media_base.h
Show inline comments
 
@@ -42,13 +42,13 @@ struct MD5File {
 
template <class T, size_t Tnum_files>
 
struct BaseSet {
 
	/** Number of files in this set */
 
	static const size_t NUM_FILES = Tnum_files;
 

	
 
	/** Internal names of the files in this set. */
 
	static const char **file_names;
 
	static const char * const *file_names;
 

	
 
	const char *name;          ///< The name of the base set
 
	const char *description;   ///< Description of the base set
 
	uint32 shortname;          ///< Four letter short variant of the name
 
	uint32 version;            ///< The version of this base set
 

	
src/callback_table.cpp
Show inline comments
 
@@ -64,13 +64,13 @@ CommandCallback CcBuildLoco;
 
/* group_gui.cpp */
 
CommandCallback CcCreateGroup;
 

	
 
/* ai/ai_core.cpp */
 
CommandCallback CcAI;
 

	
 
CommandCallback *_callback_table[] = {
 
CommandCallback * const _callback_table[] = {
 
	/* 0x00 */ NULL,
 
	/* 0x01 */ CcBuildAircraft,
 
	/* 0x02 */ CcBuildAirport,
 
	/* 0x03 */ CcBuildBridge,
 
	/* 0x04 */ CcBuildCanal,
 
	/* 0x05 */ CcBuildDocks,
src/callback_table.h
Show inline comments
 
@@ -11,10 +11,10 @@
 

	
 
#ifndef CALLBACK_TABLE_H
 
#define CALLBACK_TABLE_H
 

	
 
#include "command_type.h"
 

	
 
extern CommandCallback *_callback_table[];
 
extern CommandCallback * const _callback_table[];
 
extern const int _callback_table_count;
 

	
 
#endif /* CALLBACK_TABLE_H */
src/clear_cmd.cpp
Show inline comments
 
@@ -26,13 +26,13 @@
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "table/clear_land.h"
 

	
 
static CommandCost ClearTile_Clear(TileIndex tile, DoCommandFlag flags)
 
{
 
	static const Money *clear_price_table[] = {
 
	static const Money * const clear_price_table[] = {
 
		&_price.clear_grass,
 
		&_price.clear_roughland,
 
		&_price.clear_rocks,
 
		&_price.clear_fields,
 
		&_price.clear_roughland,
 
		&_price.clear_roughland,
src/console_cmds.cpp
Show inline comments
 
@@ -1240,13 +1240,13 @@ DEF_CONSOLE_CMD(ConScreenShot)
 

	
 
	return true;
 
}
 

	
 
DEF_CONSOLE_CMD(ConInfoVar)
 
{
 
	static const char *_icon_vartypes[] = {"boolean", "byte", "uint16", "uint32", "int16", "int32", "string"};
 
	static const char * const _icon_vartypes[] = {"boolean", "byte", "uint16", "uint32", "int16", "int32", "string"};
 
	const IConsoleVar *var;
 

	
 
	if (argc == 0) {
 
		IConsoleHelp("Print out debugging information about a variable. Usage: 'info_var <var>'");
 
		return true;
 
	}
 
@@ -1584,13 +1584,13 @@ bool NetworkChangeCompanyPassword(byte a
 
#if defined(WITH_ZLIB)
 
#include "network/network_content.h"
 

	
 
/** Resolve a string to a content type. */
 
static ContentType StringToContentType(const char *str)
 
{
 
	static const char *inv_lookup[] = { "", "base", "newgrf", "ai", "ailib", "scenario", "heightmap" };
 
	static const char * const inv_lookup[] = { "", "base", "newgrf", "ai", "ailib", "scenario", "heightmap" };
 
	for (uint i = 1 /* there is no type 0 */; i < lengthof(inv_lookup); i++) {
 
		if (strcasecmp(str, inv_lookup[i]) == 0) return (ContentType)i;
 
	}
 
	return CONTENT_TYPE_END;
 
}
 

	
 
@@ -1667,15 +1667,15 @@ DEF_CONSOLE_CMD(ConContent)
 
		return true;
 
	}
 

	
 
	if (strcasecmp(argv[1], "state") == 0) {
 
		IConsolePrintF(CC_WHITE, "id, type, state, name");
 
		for (ConstContentIterator iter = _network_content_client.Begin(); iter != _network_content_client.End(); iter++) {
 
			static const char *types[] = { "Base graphics", "NewGRF", "AI", "AI library", "Scenario", "Heightmap" };
 
			static const char *states[] = { "Not selected", "Selected" , "Dep Selected", "Installed", "Unknown" };
 
			static ConsoleColour state_to_colour[] = { CC_COMMAND, CC_INFO, CC_INFO, CC_WHITE, CC_ERROR };
 
			static const char * const types[] = { "Base graphics", "NewGRF", "AI", "AI library", "Scenario", "Heightmap" };
 
			static const char * const states[] = { "Not selected", "Selected" , "Dep Selected", "Installed", "Unknown" };
 
			static const ConsoleColour state_to_colour[] = { CC_COMMAND, CC_INFO, CC_INFO, CC_WHITE, CC_ERROR };
 

	
 
			const ContentInfo *ci = *iter;
 
			IConsolePrintF(state_to_colour[ci->state], "%d, %s, %s, %s", ci->id, types[ci->type - 1], states[ci->state], ci->name);
 
		}
 
		return true;
 
	}
src/depot_gui.cpp
Show inline comments
 
@@ -172,13 +172,13 @@ static void TrainDepotMoveVehicle(const 
 
/* Array to hold the block sizes
 
 * First part is the vehicle type, while the last is 0 = x, 1 = y */
 
uint _block_sizes[4][2];
 

	
 
/* Array to hold the default resize capacities
 
 * First part is the vehicle type, while the last is 0 = x, 1 = y */
 
const uint _resize_cap[][2] = {
 
static const uint _resize_cap[][2] = {
 
/* VEH_TRAIN */    {6, 10 * 29},
 
/* VEH_ROAD */     {5, 5},
 
/* VEH_SHIP */     {3, 3},
 
/* VEH_AIRCRAFT */ {3, 4},
 
};
 

	
src/gamelog.cpp
Show inline comments
 
@@ -136,13 +136,13 @@ static void PrintGrfInfo(char *buf, uint
 

	
 
	return;
 
}
 

	
 

	
 
/** Text messages for various logged actions */
 
static const char *la_text[] = {
 
static const char * const la_text[] = {
 
	"new game started",
 
	"game loaded",
 
	"GRF config changed",
 
	"cheat was used",
 
	"settings changed",
 
	"GRF bug triggered",
src/gfxinit.cpp
Show inline comments
 
@@ -249,17 +249,17 @@ MD5File::ChecksumResult MD5File::CheckMD
 

	
 
	checksum.Finish(digest);
 
	return memcmp(this->hash, digest, sizeof(this->hash)) == 0 ? CR_MATCH : CR_MISMATCH;
 
}
 

	
 
/** Names corresponding to the GraphicsFileType */
 
const char *_graphics_file_names[] = { "base", "logos", "arctic", "tropical", "toyland", "extra" };
 
static const char * const _graphics_file_names[] = { "base", "logos", "arctic", "tropical", "toyland", "extra" };
 

	
 
/** Implementation */
 
template <class T, size_t Tnum_files>
 
/* static */ const char **BaseSet<T, Tnum_files>::file_names = _graphics_file_names;
 
/* static */ const char * const *BaseSet<T, Tnum_files>::file_names = _graphics_file_names;
 

	
 
extern void UpdateNewGRFConfigPalette();
 

	
 
/**
 
 * Determine the palette that has to be used.
 
 *  - forced palette via command line -> leave it that way
src/ini.cpp
Show inline comments
 
@@ -95,13 +95,13 @@ void IniGroup::Clear()
 
{
 
	delete this->item;
 
	this->item = NULL;
 
	this->last_item = &this->item;
 
}
 

	
 
IniFile::IniFile(const char **list_group_names) : group(NULL), comment(NULL), list_group_names(list_group_names)
 
IniFile::IniFile(const char * const *list_group_names) : group(NULL), comment(NULL), list_group_names(list_group_names)
 
{
 
	this->last_group = &this->group;
 
}
 

	
 
IniFile::~IniFile()
 
{
src/ini_type.h
Show inline comments
 
@@ -77,23 +77,23 @@ struct IniGroup {
 
	 */
 
	void Clear();
 
};
 

	
 
/** The complete ini file. */
 
struct IniFile {
 
	IniGroup *group;               ///< the first group in the ini
 
	IniGroup **last_group;         ///< the last group in the ini
 
	char *comment;                 ///< last comment in file
 
	const char **list_group_names; ///< NULL terminated list with group names that are lists
 
	IniGroup *group;                      ///< the first group in the ini
 
	IniGroup **last_group;                ///< the last group in the ini
 
	char *comment;                        ///< last comment in file
 
	const char * const *list_group_names; ///< NULL terminated list with group names that are lists
 

	
 
	/**
 
	 * Construct a new in-memory Ini file representation.
 
	 * @param list_group_names A NULL terminated list with groups that should be
 
	 *                         loaded as lists instead of variables.
 
	 */
 
	IniFile(const char **list_group_names = NULL);
 
	IniFile(const char * const *list_group_names = NULL);
 

	
 
	/** Free everything we loaded. */
 
	~IniFile();
 

	
 
	/**
 
	 * Get the group with the given name, and if it doesn't exist
src/map.cpp
Show inline comments
 
@@ -279,13 +279,13 @@ bool CircularTileSearch(TileIndex *tile,
 
	assert(proc != NULL);
 
	assert(radius > 0);
 

	
 
	uint x = TileX(*tile) + w + 1;
 
	uint y = TileY(*tile);
 

	
 
	uint extent[DIAGDIR_END] = { w, h, w, h };
 
	const uint extent[DIAGDIR_END] = { w, h, w, h };
 

	
 
	for (uint n = 0; n < radius; n++) {
 
		for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
 
			/* Is the tile within the map? */
 
			for (uint j = extent[dir] + n * 2 + 1; j != 0; j--) {
 
				if (x < MapSizeX() && y < MapSizeY()) {
src/misc/dbg_helpers.cpp
Show inline comments
 
@@ -11,13 +11,13 @@
 

	
 
#include "../stdafx.h"
 
#include "../rail_map.h"
 
#include "dbg_helpers.h"
 

	
 
/** Trackdir & TrackdirBits short names. */
 
static const char *trackdir_names[] = {
 
static const char * const trackdir_names[] = {
 
	"NE", "SE", "UE", "LE", "LS", "RS", "rne", "rse",
 
	"SW", "NW", "UW", "LW", "LN", "RN", "rsw", "rnw",
 
};
 

	
 
/** Return name of given Trackdir. */
 
CStrA ValueStr(Trackdir td)
 
@@ -34,13 +34,13 @@ CStrA ValueStr(TrackdirBits td_bits)
 
	out.Format("%d (%s)", td_bits, ComposeNameT(td_bits, trackdir_names, "UNK", INVALID_TRACKDIR_BIT, "INV").Data());
 
	return out.Transfer();
 
}
 

	
 

	
 
/** DiagDirection short names. */
 
static const char *diagdir_names[] = {
 
static const char * const diagdir_names[] = {
 
	"NE", "SE", "SW", "NW",
 
};
 

	
 
/** Return name of given DiagDirection. */
 
CStrA ValueStr(DiagDirection dd)
 
{
 
@@ -48,13 +48,13 @@ CStrA ValueStr(DiagDirection dd)
 
	out.Format("%d (%s)", dd, ItemAtT(dd, diagdir_names, "UNK", INVALID_DIAGDIR, "INV"));
 
	return out.Transfer();
 
}
 

	
 

	
 
/** SignalType short names. */
 
static const char *signal_type_names[] = {
 
static const char * const signal_type_names[] = {
 
	"NORMAL", "ENTRY", "EXIT", "COMBO", "PBS", "NOENTRY",
 
};
 

	
 
/** Return name of given SignalType. */
 
CStrA ValueStr(SignalType t)
 
{
src/misc/dbg_helpers.h
Show inline comments
 
@@ -31,13 +31,13 @@ template <typename T, size_t N> struct A
 

	
 
/**
 
 * Helper template function that returns item of array at given index
 
 * or t_unk when index is out of bounds.
 
 */
 
template <typename E, typename T>
 
inline typename ArrayT<T>::item_t ItemAtT(E idx, T &t, typename ArrayT<T>::item_t t_unk)
 
inline typename ArrayT<T>::item_t ItemAtT(E idx, const T &t, typename ArrayT<T>::item_t t_unk)
 
{
 
	if ((size_t)idx >= ArrayT<T>::length) {
 
		return t_unk;
 
	}
 
	return t[idx];
 
}
 
@@ -45,13 +45,13 @@ inline typename ArrayT<T>::item_t ItemAt
 
/**
 
 * Helper template function that returns item of array at given index
 
 * or t_inv when index == idx_inv
 
 * or t_unk when index is out of bounds.
 
 */
 
template <typename E, typename T>
 
inline typename ArrayT<T>::item_t ItemAtT(E idx, T &t, typename ArrayT<T>::item_t t_unk, E idx_inv, typename ArrayT<T>::item_t t_inv)
 
inline typename ArrayT<T>::item_t ItemAtT(E idx, const T &t, typename ArrayT<T>::item_t t_unk, E idx_inv, typename ArrayT<T>::item_t t_inv)
 
{
 
	if ((size_t)idx < ArrayT<T>::length) {
 
		return t[idx];
 
	}
 
	if (idx == idx_inv) {
 
		return t_inv;
src/misc_gui.cpp
Show inline comments
 
@@ -345,13 +345,13 @@ static const WindowDesc _about_desc(
 
	WDP_CENTER, WDP_CENTER, 0, 0, 0, 0,
 
	WC_GAME_OPTIONS, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
 
	NULL, _nested_about_widgets, lengthof(_nested_about_widgets)
 
);
 

	
 
static const char *_credits[] = {
 
static const char * const _credits[] = {
 
	"Original design by Chris Sawyer",
 
	"Original graphics by Simon Foster",
 
	"",
 
	"The OpenTTD team (in alphabetical order):",
 
	"  Jean-Francois Claeys (Belugas) - GUI, newindustries and more",
 
	"  Bjarni Corfitzen (Bjarni) - MacOSX port, coder and vehicles",
src/network/network_gui.cpp
Show inline comments
 
@@ -821,13 +821,13 @@ static const Widget _network_game_window
 
};
 

	
 
/* Generates incorrect display_flags for widgets NGWW_NAME, and incorrect
 
 * display_flags and/or left/right side for the overlapping widgets
 
 * NGWW_CLIENTS through NGWW_YEARS.
 
 */
 
NWidgetPart _nested_network_game_widgets[] = {
 
static const NWidgetPart _nested_network_game_widgets[] = {
 
	/* TOP */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, NGWW_CLOSE),
 
		NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, NGWW_CAPTION), SetMinimalSize(439, 14), SetDataTip(STR_NETWORK_SERVER_LIST_CAPTION, STR_NULL), // XXX Add default caption tooltip!
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, NGWW_MAIN),
src/newgrf.cpp
Show inline comments
 
@@ -5641,13 +5641,13 @@ static const CargoLabel _default_refitma
 

	
 
static const CargoLabel _default_refitmasks_aircraft[] = {
 
	'PASS', 'MAIL', 'GOOD', 'VALU', 'GOLD', 'DIAM', 'FOOD', 'FRUT', 'SUGR',
 
	'TOYS', 'BATT', 'SWET', 'TOFF', 'COLA', 'CTCD', 'BUBL', 'PLST', 'FZDR',
 
	0 };
 

	
 
static const CargoLabel *_default_refitmasks[] = {
 
static const CargoLabel * const _default_refitmasks[] = {
 
	_default_refitmasks_rail,
 
	_default_refitmasks_road,
 
	_default_refitmasks_ships,
 
	_default_refitmasks_aircraft,
 
};
 

	
src/rail_cmd.cpp
Show inline comments
 
@@ -50,13 +50,13 @@ assert_compile(sizeof(_original_railtype
 
void ResetRailTypes()
 
{
 
	memset(_railtypes, 0, sizeof(_railtypes));
 
	memcpy(_railtypes, _original_railtypes, sizeof(_original_railtypes));
 
}
 

	
 
const byte _track_sloped_sprites[14] = {
 
static const byte _track_sloped_sprites[14] = {
 
	14, 15, 22, 13,
 
	 0, 21, 17, 12,
 
	23,  0, 18, 20,
 
	19, 16
 
};
 

	
 
@@ -2289,13 +2289,13 @@ static void GetTileDesc_Track(TileIndex 
 
	switch (GetRailTileType(tile)) {
 
		case RAIL_TILE_NORMAL:
 
			td->str = STR_LAI_RAIL_DESCRIPTION_TRACK;
 
			break;
 

	
 
		case RAIL_TILE_SIGNALS: {
 
			const StringID signal_type[6][6] = {
 
			static const StringID signal_type[6][6] = {
 
				{
 
					STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS,
 
					STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS,
 
					STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS,
 
					STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS,
 
					STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS,
 
@@ -2375,13 +2375,13 @@ static void ChangeTileOwner_Track(TileIn
 
		DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
 
	}
 
}
 

	
 
static const byte _fractcoords_behind[4] = { 0x8F, 0x8, 0x80, 0xF8 };
 
static const byte _fractcoords_enter[4] = { 0x8A, 0x48, 0x84, 0xA8 };
 
static const signed char _deltacoord_leaveoffset[8] = {
 
static const int8 _deltacoord_leaveoffset[8] = {
 
	-1,  0,  1,  0, /* x */
 
	 0,  1,  0, -1  /* y */
 
};
 

	
 

	
 
/** Compute number of ticks when next wagon will leave a depot.
src/roadveh_cmd.cpp
Show inline comments
 
@@ -1306,13 +1306,13 @@ static Trackdir FollowPreviousRoadVehicl
 
			 *  - columns represent the entry direction.
 
			 *  - cell values are determined by the Trackdir one has to take from
 
			 *    the entry dir (column) to the tile in north or south by only
 
			 *    going over the trackdirs used for turning 90 degrees, i.e.
 
			 *    TRACKDIR_{UPPER,RIGHT,LOWER,LEFT}_{N,E,S,W}.
 
			 */
 
			Trackdir reversed_turn_lookup[2][DIAGDIR_END] = {
 
			static const Trackdir reversed_turn_lookup[2][DIAGDIR_END] = {
 
				{ TRACKDIR_UPPER_W, TRACKDIR_RIGHT_N, TRACKDIR_LEFT_N,  TRACKDIR_UPPER_E },
 
				{ TRACKDIR_RIGHT_S, TRACKDIR_LOWER_W, TRACKDIR_LOWER_E, TRACKDIR_LEFT_S  }};
 
			dir = reversed_turn_lookup[prev->tile < tile ? 0 : 1][ReverseDiagDir(entry_dir)];
 
		} else if (HasBit(prev_state, RVS_IN_DT_ROAD_STOP)) {
 
			dir = (Trackdir)(prev_state & RVSB_ROAD_STOP_TRACKDIR_MASK);
 
		} else if (prev_state < TRACKDIR_END) {
src/saveload/gamelog_sl.cpp
Show inline comments
 
@@ -84,13 +84,13 @@ static const SaveLoad _glog_grfbug_desc[
 
};
 

	
 
static const SaveLoad _glog_emergency_desc[] = {
 
	SLE_END()
 
};
 

	
 
static const SaveLoad *_glog_desc[] = {
 
static const SaveLoad * const _glog_desc[] = {
 
	_glog_mode_desc,
 
	_glog_revision_desc,
 
	_glog_oldver_desc,
 
	_glog_setting_desc,
 
	_glog_grfadd_desc,
 
	_glog_grfrem_desc,
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -666,13 +666,13 @@ const SaveLoad *GetVehicleDescription(Ve
 
		SLE_CONDNULL(16,                                                           2, SL_MAX_VERSION),
 

	
 
		     SLE_END()
 
	};
 

	
 

	
 
	static const SaveLoad *_veh_descs[] = {
 
	static const SaveLoad * const _veh_descs[] = {
 
		_train_desc,
 
		_roadveh_desc,
 
		_ship_desc,
 
		_aircraft_desc,
 
		_special_desc,
 
		_disaster_desc,
src/settings.cpp
Show inline comments
 
@@ -83,13 +83,13 @@ typedef void SettingDescProcList(IniFile
 

	
 
static bool IsSignedVarMemType(VarType vt);
 

	
 
/**
 
 * Groups in openttd.cfg that are actually lists.
 
 */
 
static const char *_list_group_names[] = {
 
static const char * const _list_group_names[] = {
 
	"bans",
 
	"newgrf",
 
	"servers",
 
	"server_bind_addresses",
 
	NULL
 
};
 
@@ -1253,13 +1253,13 @@ static void SaveVersionInConfig(IniFile 
 
{
 
	IniGroup *group = ini->GetGroup("version");
 

	
 
	char version[9];
 
	snprintf(version, lengthof(version), "%08X", _openttd_newgrf_version);
 

	
 
	const char *versions[][2] = {
 
	const char * const versions[][2] = {
 
		{ "version_string", _openttd_revision },
 
		{ "version_number", version }
 
	};
 

	
 
	for (uint i = 0; i < lengthof(versions); i++) {
 
		group->GetItem(versions[i][0], true)->SetValue(versions[i][1]);
src/smallmap_gui.cpp
Show inline comments
 
@@ -516,13 +516,13 @@ static const uint32 _smallmap_mask_right
 
	MKCOLOUR(0x0000FFFF),
 
	MKCOLOUR(0x00FFFFFF),
 
};
 

	
 
/* each tile has 4 x pixels and 1 y pixel */
 

	
 
static GetSmallMapPixels *_smallmap_draw_procs[] = {
 
static GetSmallMapPixels * const _smallmap_draw_procs[] = {
 
	GetSmallMapContoursPixels,
 
	GetSmallMapVehiclesPixels,
 
	GetSmallMapIndustriesPixels,
 
	GetSmallMapRoutesPixels,
 
	GetSmallMapVegetationPixels,
 
	GetSmallMapOwnerPixels,
src/sound.cpp
Show inline comments
 
@@ -268,17 +268,17 @@ void SndPlayFx(SoundID sound)
 
	StartSound(sound, 0, msf.effect_vol);
 
}
 

	
 
INSTANTIATE_BASE_MEDIA_METHODS(BaseMedia<SoundsSet>, SoundsSet)
 

	
 
/** Names corresponding to the sound set's files */
 
const char *_sound_file_names[] = { "samples" };
 
static const char * const _sound_file_names[] = { "samples" };
 

	
 

	
 
template <class T, size_t Tnum_files>
 
/* static */ const char **BaseSet<T, Tnum_files>::file_names = _sound_file_names;
 
/* static */ const char * const *BaseSet<T, Tnum_files>::file_names = _sound_file_names;
 

	
 
template <class Tbase_set>
 
/* static */ const char *BaseMedia<Tbase_set>::GetExtension()
 
{
 
	return ".obs"; // OpenTTD Base Sounds
 
}
src/spritecache.cpp
Show inline comments
 
@@ -495,13 +495,13 @@ void *AllocSprite(size_t mem_req)
 
 * @param requested requested sprite type
 
 * @param sc the currently known sprite cache for the requested sprite
 
 * @return fallback sprite
 
 * @note this function will do usererror() in the case the fallback sprite isn't available */
 
static void *HandleInvalidSpriteRequest(SpriteID sprite, SpriteType requested, SpriteCache *sc)
 
{
 
	static const char *sprite_types[] = {
 
	static const char * const sprite_types[] = {
 
		"normal",        // ST_NORMAL
 
		"map generator", // ST_MAPGEN
 
		"character",     // ST_FONT
 
		"recolour",      // ST_RECOLOUR
 
	};
 

	
src/table/elrail_data.h
Show inline comments
 
@@ -35,23 +35,23 @@ enum TileSource {
 

	
 
enum {
 
	NUM_TRACKS_AT_PCP = 6
 
};
 

	
 
/** 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,
 
	1 << DIR_N | 1 << DIR_NE | 1 << DIR_E  | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
 
};
 

	
 
/** 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,
 
	1 << DIR_NE | 1 << DIR_E  | 1 << DIR_SE | 1 << DIR_S
 
};
 

	
 
@@ -67,13 +67,13 @@ static const DiagDirection PCPpositions[
 

	
 
#define PCP_NOT_ON_TRACK 0xFF
 
/** Preferred points of each trackbit. Those are the ones perpendicular to the
 
 * 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
 
		1 << DIR_SE | 1 << DIR_SW | 1 << DIR_NW, // SW
 
		PCP_NOT_ON_TRACK                         // NE
 
	}, { // Y
 
@@ -108,13 +108,13 @@ static byte PreferredPPPofTrackAtPCP[TRA
 

	
 
#define NUM_IGNORE_GROUPS 3
 
#define IGNORE_NONE 0xFF
 
/** 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,
 
			1 << DIR_NE | 1 << DIR_SW,
 
			1 << DIR_NW | 1 << DIR_SE,
 
			IGNORE_NONE
 
@@ -183,13 +183,13 @@ static byte IgnoredPCP[NUM_IGNORE_GROUPS
 
	}
 
};
 

	
 
#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
 
	{0,           1 << DIR_W | 1 << DIR_E,  1 << DIR_W | 1 << DIR_E,  0          }, // LOWER
 
	{0,           0,           1 << DIR_S | 1 << DIR_N,  1 << DIR_N | 1 << DIR_S }, // LEFT
 
	{1 << DIR_S | 1 << DIR_N,  1 << DIR_S | 1 << DIR_N,  0,           0,         }, // RIGHT
src/table/pricebase.h
Show inline comments
 
@@ -6,13 +6,13 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @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
 
	{     65, PCAT_CONSTRUCTION}, ///< build_signals
 
	{    275, PCAT_CONSTRUCTION}, ///< build_bridge
 
	{    600, PCAT_CONSTRUCTION}, ///< build_train_depot
src/table/station_land.h
Show inline comments
 
@@ -964,13 +964,13 @@ static const DrawTileSprites _station_di
 
	TILE_SPRITE_LINE(SPR_RAIL_TRACK_X,               _station_display_datas_waypoint_X)
 
	TILE_SPRITE_LINE(SPR_RAIL_TRACK_Y,               _station_display_datas_waypoint_Y)
 
};
 

	
 
#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,
 
	_station_display_datas_bus,
 
	_station_display_datas_oilrig,
 
	_station_display_datas_dock,
src/table/strgen_tables.h
Show inline comments
 
@@ -181,13 +181,13 @@ static const PluralForm _plural_forms[] 
 
 * x2 = hexadecimal number of 2 bytes
 
 * g = gender
 
 * c = cases
 
 * 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" },
 
	{ "isocode",     "0",   "",       "ISO code for the language" },
 
	{ "plural",      "tp",  "0",      "Plural form to use" },
 
	{ "textdir",     "tl",  "ltr",    "Text direction. Either ltr (left-to-right) or rtl (right-to-left)" },
src/table/unicode.h
Show inline comments
 
@@ -21,13 +21,13 @@ enum {
 

	
 
/* Default unicode mapping table for sprite based glyphs.
 
 * This table allows us use unicode characters even though the glyphs don't
 
 * 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
 
	{ 0x00A7, CLRL }, // Section sign
 
	{ 0x00A8, CLRL }, // Diaeresis
 
	{ 0x00A9, CLRL }, // Copyright sign
src/table/unmovable_land.h
Show inline comments
 
@@ -97,13 +97,13 @@ static const DrawTileSprites _unmovable_
 
	TILE_SPRITE_LINE(SPR_HUGEHQ_WEST_GROUND,   _unmovable_display_datas_18)
 
	TILE_SPRITE_LINE(SPR_HUGEHQ_SOUTH,         _unmovable_display_nothing)
 
};
 

	
 
#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},
 
};
src/toolbar_gui.cpp
Show inline comments
 
@@ -932,13 +932,13 @@ static void SplitToolbar(Window *w)
 
	};
 
	static const byte arrange19[] = {
 
		0,  1,  2,  4,  5,  6, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 17, 18, 27,
 
		0,  1,  3,  4,  7,  8,  9, 10, 12, 25, 19, 20, 21, 22, 23, 26, 17, 18, 27,
 
	};
 

	
 
	static const byte *arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19 };
 
	static const byte * const arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19 };
 

	
 
	uint max_icons = max(TBP_TOOLBAR_MINBUTTON, (ToolBarProperties)((w->width + TBP_BUTTONWIDTH / 2) / TBP_BUTTONWIDTH));
 

	
 
	assert(max_icons >= TBP_TOOLBAR_MINBUTTON && max_icons <= TBP_NORMAL_MAXBUTTON);
 

	
 
	/* first hide all icons */
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -319,19 +319,19 @@ CommandCost CmdBuildBridge(TileIndex end
 
		if (CmdFailed(terraform_cost_south) || (terraform_cost_south.GetCost() != 0 && !allow_on_slopes))
 
			return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
 
		cost.AddCost(terraform_cost_south);
 

	
 
		if (transport_type == TRANSPORT_WATER && (tileh_start == SLOPE_FLAT || tileh_end == SLOPE_FLAT)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
 

	
 
		TileIndex Heads[] = {tile_start, tile_end};
 
		const TileIndex heads[] = {tile_start, tile_end};
 
		for (int i = 0; i < 2; i++) {
 
			if (MayHaveBridgeAbove(Heads[i])) {
 
				if (IsBridgeAbove(Heads[i])) {
 
					TileIndex north_head = GetNorthernBridgeEnd(Heads[i]);
 
			if (MayHaveBridgeAbove(heads[i])) {
 
				if (IsBridgeAbove(heads[i])) {
 
					TileIndex north_head = GetNorthernBridgeEnd(heads[i]);
 

	
 
					if (direction == GetBridgeAxis(Heads[i])) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 
					if (direction == GetBridgeAxis(heads[i])) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 

	
 
					if (z_start + TILE_HEIGHT == GetBridgeHeight(north_head)) {
 
						return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 
					}
 
				}
 
			}
src/yapf/yapf_common.hpp
Show inline comments
 
@@ -147,14 +147,14 @@ public:
 
	}
 

	
 
	/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	inline bool PfCalcEstimate(Node& n)
 
	{
 
		static int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static const int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		if (PfDetectDestination(n)) {
 
			n.m_estimate = n.m_cost;
 
			return true;
 
		}
 

	
 
		TileIndex tile = n.GetTile();
src/yapf/yapf_destrail.hpp
Show inline comments
 
@@ -173,14 +173,14 @@ public:
 
	}
 

	
 
	/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	FORCEINLINE bool PfCalcEstimate(Node& n)
 
	{
 
		static int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static const int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		if (PfDetectDestination(n)) {
 
			n.m_estimate = n.m_cost;
 
			return true;
 
		}
 

	
 
		TileIndex tile = n.GetLastTile();
src/yapf/yapf_node_rail.hpp
Show inline comments
 
@@ -116,13 +116,13 @@ enum EndSegmentReasonBits {
 
};
 

	
 
DECLARE_ENUM_AS_BIT_SET(EndSegmentReasonBits);
 

	
 
inline CStrA ValueStr(EndSegmentReasonBits bits)
 
{
 
	static const char *end_segment_reason_names[] = {
 
	static const char * const end_segment_reason_names[] = {
 
		"DEAD_END", "RAIL_TYPE", "INFINITE_LOOP", "SEGMENT_TOO_LONG", "CHOICE_FOLLOWS",
 
		"DEPOT", "WAYPOINT", "STATION", "SAFE_TILE",
 
		"PATH_TOO_LONG", "FIRST_TWO_WAY_RED", "LOOK_AHEAD_END", "TARGET_REACHED"
 
	};
 

	
 
	CStrA out;
src/yapf/yapf_road.cpp
Show inline comments
 
@@ -301,14 +301,14 @@ public:
 
	}
 

	
 
	/** Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	inline bool PfCalcEstimate(Node& n)
 
	{
 
		static int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
		static const int dg_dir_to_y_offs[] = {0, 1, 0, -1};
 
		if (PfDetectDestination(n)) {
 
			n.m_estimate = n.m_cost;
 
			return true;
 
		}
 

	
 
		TileIndex tile = n.m_segment_last_tile;
0 comments (0 inline, 0 general)