Skip to content

Commit

Permalink
Correct whitespace inconsistencies.
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@3848 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
chmallon committed Oct 2, 2010
1 parent a8077da commit b51cdeb
Show file tree
Hide file tree
Showing 30 changed files with 2,593 additions and 2,607 deletions.
1 change: 0 additions & 1 deletion Simutrans.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

2 changes: 1 addition & 1 deletion bauer/brueckenbauer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ koord3d brueckenbauer_t::finde_ende(karte_t *welt, koord3d pos, koord zv, const
return koord3d::invalid;
}
// and if ground is above bridge / double slopes
if (height<-Z_TILE_STEP){
if (height < -Z_TILE_STEP) {
break; // to trigger the right error message
}
gr1 = welt->lookup(pos + koord3d(0, 0, Z_TILE_STEP));
Expand Down
6 changes: 3 additions & 3 deletions besch/tunnel_besch.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class tunnel_besch_t : public obj_besch_std_name_t {
*/
uint8 has_way;

/* Has broad portals?
*/
uint8 broad_portals;
/* Has broad portals?
*/
uint8 broad_portals;

werkzeug_t *builder;

Expand Down
2 changes: 1 addition & 1 deletion dataobj/crossing_logic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void crossing_logic_t::add_to_crossing( const vehikel_basis_t *v )
if(v->get_waytype()==besch->get_waytype(0)) {
on_way1.append_unique(v);
}
else if(v->get_waytype()==besch->get_waytype(1)) {
else if (v->get_waytype() == besch->get_waytype(1)) {
// add it and close crossing
on_way2.append_unique(v);
if( request_close==v ) {
Expand Down
2 changes: 1 addition & 1 deletion dataobj/fahrplan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void schedule_t::rdwr(loadsave_t *file)

void schedule_t::rotate90( sint16 y_size )
{
// now we have to rotate all entries ...
// now we have to rotate all entries ...
for( uint8 i = 0; i<eintrag.get_count(); i++ ) {
eintrag[i].pos.rotate90(y_size);
}
Expand Down
4 changes: 2 additions & 2 deletions documentation/coding_styles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ Change the following construct from:

class myclass {
...
static const int MY_CONST = 77;
static const int MY_CONST = 77;
...
};

to:

class myclass {
...
enum { MY_CONST = 77 };
enum { MY_CONST = 77 };
...
};

Expand Down
2 changes: 1 addition & 1 deletion gui/components/gui_fixedwidth_textarea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

gui_fixedwidth_textarea_t::gui_fixedwidth_textarea_t(const char *const text_, const sint16 width, const koord reserved_area_)
{
set_text(text_);
set_text(text_);
set_width(width);
set_reserved_area(reserved_area_);
}
Expand Down
4 changes: 2 additions & 2 deletions gui/components/gui_textarea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

gui_textarea_t::gui_textarea_t(const char *text)
{
set_text(text);
recalc_size();
set_text(text);
recalc_size();
}


Expand Down
98 changes: 49 additions & 49 deletions gui/halt_list_filter_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,62 +165,62 @@ halt_list_filter_frame_t::~halt_list_filter_frame_t()
*/
bool halt_list_filter_frame_t::action_triggered( gui_action_creator_t *komp,value_t /* */)
{
int i;
int i;

for(i = 0; i < FILTER_BUTTONS; i++) {
if(komp == filter_buttons + i) {
main_frame->set_filter(filter_buttons_types[i], !main_frame->get_filter(filter_buttons_types[i]));
main_frame->display_list();
return true;
for (i = 0; i < FILTER_BUTTONS; i++) {
if (komp == filter_buttons + i) {
main_frame->set_filter(filter_buttons_types[i], !main_frame->get_filter(filter_buttons_types[i]));
main_frame->display_list();
return true;
}
}
}
if(komp == &ware_alle_ab) {
main_frame->set_alle_ware_filter_ab(1);
main_frame->display_list();
return true;
}
if(komp == &ware_keine_ab) {
main_frame->set_alle_ware_filter_ab(0);
main_frame->display_list();
return true;
}
if(komp == &ware_invers_ab) {
main_frame->set_alle_ware_filter_ab(-1);
main_frame->display_list();
return true;
}
if(komp == &ware_alle_an) {
main_frame->set_alle_ware_filter_an(1);
main_frame->display_list();
return true;
}
if(komp == &ware_keine_an) {
main_frame->set_alle_ware_filter_an(0);
main_frame->display_list();
return true;
}
if(komp == &ware_invers_an) {
main_frame->set_alle_ware_filter_an(-1);
main_frame->display_list();
return true;
}
if(komp == &name_filter_input) {
main_frame->display_list();
return true;
}
return false;
if (komp == &ware_alle_ab) {
main_frame->set_alle_ware_filter_ab(1);
main_frame->display_list();
return true;
}
if (komp == &ware_keine_ab) {
main_frame->set_alle_ware_filter_ab(0);
main_frame->display_list();
return true;
}
if (komp == &ware_invers_ab) {
main_frame->set_alle_ware_filter_ab(-1);
main_frame->display_list();
return true;
}
if (komp == &ware_alle_an) {
main_frame->set_alle_ware_filter_an(1);
main_frame->display_list();
return true;
}
if (komp == &ware_keine_an) {
main_frame->set_alle_ware_filter_an(0);
main_frame->display_list();
return true;
}
if (komp == &ware_invers_an) {
main_frame->set_alle_ware_filter_an(-1);
main_frame->display_list();
return true;
}
if (komp == &name_filter_input) {
main_frame->display_list();
return true;
}
return false;
}


void halt_list_filter_frame_t::ware_item_triggered(const ware_besch_t *ware_ab, const ware_besch_t *ware_an)
{
if(ware_ab) {
main_frame->set_ware_filter_ab(ware_ab, -1);
}
if(ware_an) {
main_frame->set_ware_filter_an(ware_an, -1);
}
main_frame->display_list();
if (ware_ab) {
main_frame->set_ware_filter_ab(ware_ab, -1);
}
if (ware_an) {
main_frame->set_ware_filter_an(ware_an, -1);
}
main_frame->display_list();
}


Expand Down
28 changes: 14 additions & 14 deletions gui/halt_list_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ bool halt_list_frame_t::passes_filter(halthandle_t halt)
}
else if(ware != warenbauer_t::nichts) {

// Oh Mann - eine doppelte Schleife und das noch pro Haltestelle
// Zum Glück ist die Anzahl der Fabriken und die ihrer Ausgänge
// begrenzt (Normal 1-2 Fabriken mit je 0-1 Ausgang) - V. Meyer
// Oh Mann - eine doppelte Schleife und das noch pro Haltestelle
// Zum Glück ist die Anzahl der Fabriken und die ihrer Ausgänge
// begrenzt (Normal 1-2 Fabriken mit je 0-1 Ausgang) - V. Meyer

slist_iterator_tpl<fabrik_t *> fab_iter(halt->get_fab_list());
while(!ok && fab_iter.next()) {
Expand Down Expand Up @@ -365,29 +365,29 @@ bool halt_list_frame_t::infowin_event(const event_t *ev)
*/
bool halt_list_frame_t::action_triggered( gui_action_creator_t *komp,value_t /* */)
{
if(komp == &filter_on) {
if (komp == &filter_on) {
set_filter(any_filter, !get_filter(any_filter));
filter_on.set_text(get_filter(any_filter) ? "hl_btn_filter_enable" : "hl_btn_filter_disable");
display_list();
}
else if(komp == &sortedby) {
set_sortierung((sort_mode_t)((get_sortierung() + 1) % SORT_MODES));
}
else if (komp == &sortedby) {
set_sortierung((sort_mode_t)((get_sortierung() + 1) % SORT_MODES));
display_list();
}
else if(komp == &sorteddir) {
set_reverse(!get_reverse());
}
else if (komp == &sorteddir) {
set_reverse(!get_reverse());
display_list();
}
else if(komp == &filter_details) {
}
else if (komp == &filter_details) {
if (filter_frame) {
destroy_win(filter_frame);
}
else {
filter_frame = new halt_list_filter_frame_t(m_sp, this);
create_win(filter_frame, w_info, (long)this);
}
}
return true;
}
return true;
}


Expand Down
26 changes: 13 additions & 13 deletions gui/help_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ help_frame_t::help_frame_t(const std::string &filename) :
set_text(buf);
}
else {
std::string file_prefix("text/");
std::string fullname = file_prefix + translator::get_lang()->iso + "/" + filename;
chdir( umgebung_t::program_dir );

FILE * file = fopen(fullname.c_str(), "rb");
if(!file) {
//Check for the 'base' language(ie en from en_gb)
file = fopen((file_prefix + translator::get_lang()->iso_base + "/" + filename).c_str(), "rb");
}
if(!file) {
// Hajo: check fallback english
file = fopen((file_prefix+"/en/"+filename).c_str(), "rb");
}
std::string file_prefix("text/");
std::string fullname = file_prefix + translator::get_lang()->iso + "/" + filename;
chdir(umgebung_t::program_dir);

FILE* file = fopen(fullname.c_str(), "rb");
if (!file) {
//Check for the 'base' language(ie en from en_gb)
file = fopen((file_prefix + translator::get_lang()->iso_base + "/" + filename).c_str(), "rb");
}
if (!file) {
// Hajo: check fallback english
file = fopen((file_prefix + "/en/" + filename).c_str(), "rb");
}
// go back to load/save dir
chdir( umgebung_t::user_dir );

Expand Down
2 changes: 1 addition & 1 deletion gui/werkzeug_waehler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DBG_DEBUG("werkzeug_waehler_t::add_tool()","ww=%i, rows=%i",ww,rows);
// At least, 3 rows is needed to drag toolbar
tool_icon_width = min( tool_icon_width, max(umgebung_t::toolbar_max_width, 3) );
}
}
}
tool_icon_height = max( (display_get_height()/icon.y)-3, 1 );
if( umgebung_t::toolbar_max_height > 0 ) {
tool_icon_height = min(tool_icon_height, umgebung_t::toolbar_max_height);
Expand Down
2 changes: 0 additions & 2 deletions music/core-audio_midi.mm
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,3 @@ bool dr_init_midi(void)
movies = [[NSMutableArray alloc] initWithCapacity: MAX_MIDI];
return true;
}


3 changes: 0 additions & 3 deletions nsis/simutrans-offline.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,3 @@ Function DownloadInstall
CopyFiles "$TEMP\Simutrans\*.*" "$INSTDIR"
RMdir /r "$TEMP\simutrans"
FunctionEnd



3 changes: 0 additions & 3 deletions nsis/simutrans.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,3 @@ Function DownloadInstall
CopyFiles "$TEMP\Simutrans\*.*" "$INSTDIR"
RMdir /r "$TEMP\simutrans"
FunctionEnd



6 changes: 3 additions & 3 deletions player/ai_goods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ DBG_MESSAGE("do_ki()","check railway");
count_rail=255; // no cars yet
if( rail_vehicle!=NULL ) {
// if our car is faster: well use slower speed to save money
best_rail_speed = min(51,rail_vehicle->get_geschw());
best_rail_speed = min(51, rail_vehicle->get_geschw());
// for engine: gues number of cars
count_rail = (prod*dist) / (rail_vehicle->get_zuladung()*best_rail_speed)+1;
// assume the engine weight 100 tons for power needed calcualtion
Expand Down Expand Up @@ -1020,8 +1020,8 @@ DBG_MESSAGE("ai_goods_t::do_ki()","No roadway possible.");
if(count_rail>=3) {
if(count_rail<org_count_rail) {
// rethink engine
int best_rail_speed = min(51,rail_vehicle->get_geschw());
// obey timeline
int best_rail_speed = min(51, rail_vehicle->get_geschw());
// obey timeline
uint month_now = (welt->use_timeline() ? welt->get_current_month() : 0);
// for engine: gues number of cars
long power_needed=(long)(((best_rail_speed*best_rail_speed)/2500.0+1.0)*(100.0+count_rail*(rail_vehicle->get_gewicht()+rail_vehicle->get_zuladung()*freight->get_weight_per_unit()*0.001)));
Expand Down
2 changes: 1 addition & 1 deletion simconvoi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2782,7 +2782,7 @@ void convoi_t::check_pending_updates()
fpl->set_aktuell( (fpl->get_aktuell()+fpl->get_count()-1)%fpl->get_count() );
}

if(state!=INITIAL) {
if (state != INITIAL) {
if(is_same || is_depot) {
/* same destination
* We are already there => remove wrong freight and keep current state
Expand Down
4 changes: 2 additions & 2 deletions simconvoi.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ class convoi_t : public sync_steppable, public overtaker_t
*/
static karte_t *welt;

/**
/**
* the convoi is being withdrawn from service
* @author kierongreen
*/
bool withdraw;

/**
/**
* nothing will be loaded onto this convoi
* @author kierongreen
*/
Expand Down
2 changes: 1 addition & 1 deletion simgraph16.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ static inline void colorpixcopy(PIXVAL *dest, const PIXVAL *src, const PIXVAL *
*/
enum pixcopy_routines {
plain = 0, /// simply copies the pixels
colored = 1 /// replaces player colors
colored = 1 /// replaces player colors
};

template<pixcopy_routines copyroutine> void templated_pixcopy(PIXVAL *dest, const PIXVAL *src, const PIXVAL * const end);
Expand Down
2 changes: 1 addition & 1 deletion simmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enum {
WKZ_REMOVE_WAYOBJ,
WKZ_SLICED_AND_UNDERGROUND_VIEW,
WKZ_BUY_HOUSE,
WKZ_CITYROAD,
WKZ_CITYROAD,
GENERAL_TOOL_COUNT,
GENERAL_TOOL = 0x1000
};
Expand Down
2 changes: 1 addition & 1 deletion simsys_x8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int dr_os_open(int w, int h, int bpp, int fullscreen)

mw = XCreateSimpleWindow(
md, DefaultRootWindow(md),
mh.x, mh.y, mh.width, mh.height, 5,
mh.x, mh.y, mh.width, mh.height, 5,
mfg, mbg
);

Expand Down
Loading

0 comments on commit b51cdeb

Please sign in to comment.