Skip to content

Commit

Permalink
cleanup: const.
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@7230 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
chmallon committed May 27, 2014
1 parent 47d8a7f commit e0d5b90
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bauer/hausbauer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ vector_tpl<const haus_besch_t *> hausbauer_t::station_building;
vector_tpl<const haus_besch_t *> hausbauer_t::headquarter;

/// special objects directly needed by the program
static spezial_obj_tpl<haus_besch_t> spezial_objekte[] = {
static spezial_obj_tpl<haus_besch_t> const spezial_objekte[] = {
{ &hausbauer_t::elevated_foundation_besch, "MonorailGround" },
{ NULL, NULL }
};
Expand Down
2 changes: 1 addition & 1 deletion bauer/warenbauer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ware_besch_t *warenbauer_t::load_passagiere = NULL;
ware_besch_t *warenbauer_t::load_post = NULL;
ware_besch_t *warenbauer_t::load_nichts = NULL;

static spezial_obj_tpl<ware_besch_t> spezial_objekte[] = {
static spezial_obj_tpl<ware_besch_t> const spezial_objekte[] = {
{ &warenbauer_t::passagiere, "Passagiere" },
{ &warenbauer_t::post, "Post" },
{ &warenbauer_t::nichts, "None" },
Expand Down
2 changes: 1 addition & 1 deletion besch/grund_besch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const grund_besch_t *grund_besch_t::borders = NULL;
const grund_besch_t *grund_besch_t::sea = NULL;
const grund_besch_t *grund_besch_t::ausserhalb = NULL;

static spezial_obj_tpl<grund_besch_t> grounds[] = {
static spezial_obj_tpl<grund_besch_t> const grounds[] = {
{ &boden_texture, "ClimateTexture" },
{ &light_map, "LightTexture" },
{ &transition_water_texture, "ShoreTrans" },
Expand Down
6 changes: 3 additions & 3 deletions besch/spezial_obj_tpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ template<class besch_t> struct spezial_obj_tpl {
* @param so List to operate over.
* @parem besch Descriptor to add.
*/
template<class besch_t> bool register_besch(spezial_obj_tpl<besch_t>* so, const besch_t* besch)
template<class besch_t> bool register_besch(spezial_obj_tpl<besch_t> const* so, besch_t const* const besch)
{
for (; so->name; ++so) {
if (strcmp(so->name, besch->get_name()) == 0) {
Expand All @@ -45,7 +45,7 @@ template<class besch_t> bool register_besch(spezial_obj_tpl<besch_t>* so, const
* Verifies the passed list for all objects to be not NULL, ie are loaded.
* @param so List to check.
*/
template<class besch_t> bool alles_geladen(spezial_obj_tpl<besch_t>* so)
template<class besch_t> bool alles_geladen(spezial_obj_tpl<besch_t> const* so)
{
for (; so->name; ++so) {
if (!*so->besch) {
Expand All @@ -61,7 +61,7 @@ template<class besch_t> bool alles_geladen(spezial_obj_tpl<besch_t>* so)
* @param so List to check.
* @param count Number of elements to check.
*/
template<class besch_t> void warne_ungeladene(spezial_obj_tpl<besch_t>* so)
template<class besch_t> void warne_ungeladene(spezial_obj_tpl<besch_t> const* so)
{
for (; so->name; ++so) {
if (!*so->besch) {
Expand Down
2 changes: 1 addition & 1 deletion gui/message_frame_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static sint32 categories[MAX_MESG_TABS] =
(1 << message_t::general) | (1 << message_t::new_vehicle)
};

static const char *tab_strings[]=
static char const* const tab_strings[]=
{
"Chat_msg",
"Scenario_msg",
Expand Down
2 changes: 1 addition & 1 deletion gui/optionen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum BUTTONS {
BUTTON_QUIT
};

const char *option_buttons_text[] =
static char const *const option_buttons_text[] =
{
"Sprache", "Spieler(mz)", "Farbe", "Helligk.", "Sound",
"Neue Karte", "Load game", "Speichern", "Load scenario", "Scenario", "Beenden"
Expand Down
4 changes: 2 additions & 2 deletions simcity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ void stadt_t::bewerte_res_com_ind(const koord pos, int &ind_score, int &com_scor

// return the eight neighbors:
// orthogonal before diagonal
static koord neighbors[] = {
static koord const neighbors[] = {
koord( 0, 1),
koord( 1, 0),
koord( 0, -1),
Expand All @@ -2432,7 +2432,7 @@ static koord neighbors[] = {


// return layout
static int building_layout[] = {0,0,1,4,2,0,5,1,3,7,1,0,6,3,2,0};
static int const building_layout[] = { 0, 0, 1, 4, 2, 0, 5, 1, 3, 7, 1, 0, 6, 3, 2, 0 };


void stadt_t::build_city_building(const koord k)
Expand Down
14 changes: 7 additions & 7 deletions simskin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const skin_besch_t* skinverwaltung_t::tunnel_texture = NULL;
slist_tpl<const skin_besch_t *>skinverwaltung_t::extra_obj;


static spezial_obj_tpl<skin_besch_t> misc_objekte[] = {
static spezial_obj_tpl<skin_besch_t> const misc_objekte[] = {
{ &skinverwaltung_t::senke, "PowerDest" },
{ &skinverwaltung_t::pumpe, "PowerSource" },
{ &skinverwaltung_t::construction_site, "Construction" },
Expand All @@ -81,7 +81,7 @@ static spezial_obj_tpl<skin_besch_t> misc_objekte[] = {
{ NULL, NULL }
};

static spezial_obj_tpl<skin_besch_t> menu_objekte[] = {
static spezial_obj_tpl<skin_besch_t> const menu_objekte[] = {
// new menu system
{ &skinverwaltung_t::button, "Button" },
{ &skinverwaltung_t::round_button, "Roundbutton" },
Expand All @@ -100,7 +100,7 @@ static spezial_obj_tpl<skin_besch_t> menu_objekte[] = {
{ NULL, NULL }
};

static spezial_obj_tpl<skin_besch_t> symbol_objekte[] = {
static spezial_obj_tpl<skin_besch_t> const symbol_objekte[] = {
{ &skinverwaltung_t::seasons_icons, "Seasons" },
{ &skinverwaltung_t::message_options, "MessageOptions" },
{ &skinverwaltung_t::color_options, "ColorOptions" },
Expand All @@ -118,7 +118,7 @@ static spezial_obj_tpl<skin_besch_t> symbol_objekte[] = {
};

// simutrans will work without those
static spezial_obj_tpl<skin_besch_t> fakultative_objekte[] = {
static spezial_obj_tpl<skin_besch_t> const fakultative_objekte[] = {
{ &skinverwaltung_t::biglogosymbol, "BigLogo" },
{ &skinverwaltung_t::mouse_cursor, "Mouse" },
{ &skinverwaltung_t::zughaltsymbol, "TrainStop" },
Expand All @@ -138,7 +138,7 @@ static spezial_obj_tpl<skin_besch_t> fakultative_objekte[] = {
{ NULL, NULL }
};

static spezial_obj_tpl<skin_besch_t> cursor_objekte[] = {
static spezial_obj_tpl<skin_besch_t> const cursor_objekte[] = {
// old cursors
{ &skinverwaltung_t::bauigelsymbol, "Builder" },
{ &skinverwaltung_t::cursor_general, "GeneralTools" },
Expand All @@ -149,7 +149,7 @@ static spezial_obj_tpl<skin_besch_t> cursor_objekte[] = {

bool skinverwaltung_t::alles_geladen(skintyp_t type)
{
spezial_obj_tpl<skin_besch_t>* sb;
spezial_obj_tpl<skin_besch_t> const* sb;
switch (type) {
case menu: sb = menu_objekte+1; break;
case cursor: sb = cursor_objekte; break;
Expand All @@ -170,7 +170,7 @@ bool skinverwaltung_t::alles_geladen(skintyp_t type)

bool skinverwaltung_t::register_besch(skintyp_t type, const skin_besch_t* besch)
{
spezial_obj_tpl<skin_besch_t>* sb;
spezial_obj_tpl<skin_besch_t> const* sb;
switch (type) {
case menu: sb = menu_objekte; break;
case cursor: sb = cursor_objekte; break;
Expand Down
2 changes: 1 addition & 1 deletion simwerkz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4750,7 +4750,7 @@ bool wkz_build_haus_t::init( spieler_t * )
}

// TODO: merge this into building_layout defined in simcity.cc
static int building_layout[] = {0,0,1,4,2,0,5,1,3,7,1,0,6,3,2,0};
static int const building_layout[] = { 0, 0, 1, 4, 2, 0, 5, 1, 3, 7, 1, 0, 6, 3, 2, 0 };

const char *wkz_build_haus_t::work( spieler_t *sp, koord3d pos )
{
Expand Down

0 comments on commit e0d5b90

Please sign in to comment.