Skip to content

Commit

Permalink
Removed trailing tabs and whitespaces from C++ source
Browse files Browse the repository at this point in the history
[ci skip]

I ran the same command from 9b7b175.

Excludes:
* lua/
* spirit_po/
  • Loading branch information
Vultraz committed Aug 4, 2019
1 parent 33a0296 commit 4a3be68
Show file tree
Hide file tree
Showing 48 changed files with 131 additions and 131 deletions.
4 changes: 2 additions & 2 deletions src/actions/attack.cpp
Expand Up @@ -387,7 +387,7 @@ battle_context::battle_context(

const_attack_ptr a_wep(a_wep_uindex < attacker.attacks().size() ? attacker.attacks()[a_wep_index].shared_from_this() : nullptr);
const_attack_ptr d_wep(d_wep_uindex < defender.attacks().size() ? defender.attacks()[d_wep_index].shared_from_this() : nullptr);

attacker_stats_.reset(new battle_context_unit_stats(attacker, a_loc, a_wep_index, true , defender, d_loc, d_wep, units));
defender_stats_.reset(new battle_context_unit_stats(defender, d_loc, d_wep_index, false, attacker, a_loc, a_wep, units));
}
Expand Down Expand Up @@ -975,7 +975,7 @@ bool attack::perform_hit(bool attacker_turn, statistics::attack_context& stats)
bool& update_fog = attacker_turn ? update_def_fog_ : update_att_fog_;

int ran_num;

if(use_prng_) {

std::vector<bool>& prng_seq = attacker_turn ? prng_attacker_ : prng_defender_;
Expand Down
8 changes: 4 additions & 4 deletions src/config.cpp
Expand Up @@ -543,9 +543,9 @@ size_t config::find_total_first_of(config_key_type key, size_t start)
{
assert(start <= ordered_children.size());
const size_t npos = static_cast<size_t>(-1);

auto pos = std::find_if(ordered_begin() + start, ordered_end(), [&](const config::any_child& can){ return can.key == key; });

if(pos == ordered_end()) {
return npos;
}
Expand All @@ -564,7 +564,7 @@ config& config::add_child_at_total(config_key_type key, const config &val, size_
auto end = ordered_children.end();
auto pos_it = ordered_children.begin() + pos;
auto next = std::find_if(pos_it, end,[&](const child_pos& p){ return p.pos->first == key; });

if(next == end) {
config& res = config::add_child(key, val);
//rotate the just inserted element to position pos.
Expand All @@ -576,7 +576,7 @@ config& config::add_child_at_total(config_key_type key, const config &val, size_
child_list& l = pl->second;
unsigned int index = next->index;
config& res = **(l.emplace(l.begin() + index, new config(val)));

for(auto ord = next; ord != end; ++ord) {
//this changes next->index and all later refernces to that tag.
if(ord->pos == pl) {
Expand Down
2 changes: 1 addition & 1 deletion src/controller_base.hpp
Expand Up @@ -178,7 +178,7 @@ class controller_base : public video2::draw_layering, public events::pump_monito
virtual void execute_action(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu);

virtual bool in_context_menu(hotkey::HOTKEY_COMMAND command) const;

void long_touch_callback(int x, int y);

const config& game_config_;
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/apple_battery_info.hpp
@@ -1,14 +1,14 @@
/*
Copyright (C) 2018 by Martin Hrubý <hrubymar10@gmail.com>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/

Expand Down
8 changes: 4 additions & 4 deletions src/desktop/apple_version.hpp
@@ -1,14 +1,14 @@
/*
Copyright (C) 2018 by Martin Hrubý <hrubymar10@gmail.com>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/

Expand All @@ -20,8 +20,8 @@

namespace desktop {
namespace apple {

std::string os_version();

} // end namespace apple
} // end namespace desktop
4 changes: 2 additions & 2 deletions src/desktop/battery_info.cpp
@@ -1,14 +1,14 @@
/*
Copyright (C) 2018 by Martin Hrubý <hrubymar10@gmail.com>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/

Expand Down
4 changes: 2 additions & 2 deletions src/desktop/battery_info.hpp
@@ -1,14 +1,14 @@
/*
Copyright (C) 2018 by Martin Hrubý <hrubymar10@gmail.com>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/

Expand Down
2 changes: 1 addition & 1 deletion src/desktop/version.cpp
Expand Up @@ -125,7 +125,7 @@ std::string os_version()
//
// Standard Mac OS X version
//

return desktop::apple::os_version();

#elif defined(_X11)
Expand Down
2 changes: 1 addition & 1 deletion src/fake_unit_ptr.cpp
Expand Up @@ -114,7 +114,7 @@ fake_unit_ptr::~fake_unit_ptr()
// fake_unit from the managers's fake_units_ dequeue in the event of an
// exception.
if(my_manager_) {
//my_manager_ points to resources::fake_units, the next line fixes a bug whre this code would attempt to access a freed fake_unit_manager object, see https://github.com/wesnoth/wesnoth/issues/3008
//my_manager_ points to resources::fake_units, the next line fixes a bug whre this code would attempt to access a freed fake_unit_manager object, see https://github.com/wesnoth/wesnoth/issues/3008
if(resources::fake_units != nullptr) {
remove_from_fake_unit_manager();
}
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem.cpp
Expand Up @@ -561,7 +561,7 @@ static const std::string& get_version_path_suffix()
old_saves_dir += get_version_path_suffix();
boost::filesystem::path new_saves_dir = home / "Library/Containers/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_";
new_saves_dir += get_version_path_suffix();

if(bfs::is_directory(new_saves_dir)) {
if(!bfs::exists(old_saves_dir)) {
std::cout << "Apple developer's userdata migration: ";
Expand Down
2 changes: 1 addition & 1 deletion src/font/text.hpp
Expand Up @@ -158,7 +158,7 @@ class pango_text

/**
* Get maximum length.
*
*
* @returns The maximum length of the text. The length of text
* should not exceed this value.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/flg_manager.cpp
Expand Up @@ -102,7 +102,7 @@ flg_manager::flg_manager(const std::vector<const config*>& era_factions,
update_available_factions();

select_default_faction();

}

void flg_manager::set_current_faction(const unsigned index)
Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/lobby_info.hpp
Expand Up @@ -142,7 +142,7 @@ class lobby_info
return users_;
}

bool gamelist_initialized() const
bool gamelist_initialized() const
{
return gamelist_initialized_;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/playcampaign.cpp
Expand Up @@ -370,7 +370,7 @@ LEVEL_RESULT campaign_controller::play_game()
if(state_.mp_settings().saved_game == mp_game_settings::SAVED_GAME_MODE::MIDGAME) {
state_.mp_settings().saved_game = mp_game_settings::SAVED_GAME_MODE::SCENARIO_START;
}

state_.mp_settings().use_map_settings = starting_pos["force_lock_settings"].to_bool(!is_mp);

ng::connect_engine_ptr connect_engine(new ng::connect_engine(state_, false, mp_info_));
Expand Down
2 changes: 1 addition & 1 deletion src/generators/default_map_generator_job.hpp
Expand Up @@ -45,7 +45,7 @@ class default_map_generator_job
height_map generate_height_map(size_t width, size_t height,
size_t iterations, size_t hill_size,
size_t island_size, size_t island_off_center);

height_map generate_height_map(size_t width, size_t height,
size_t iterations, size_t hill_size,
size_t island_size, size_t center_x, size_t center_y);
Expand Down
2 changes: 1 addition & 1 deletion src/gettext.cpp
Expand Up @@ -490,7 +490,7 @@ int icompare(const std::string& s1, const std::string& s2)

if(!bad_cast_once) {
ERR_G << "locale set-up for icompare() is broken, falling back to std::string::compare()\n";

try { //just to be safe.
ERR_G << get_manager().debug_description() << "\n";
} catch (const std::exception& e) {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/core/event/handler.cpp
Expand Up @@ -230,14 +230,14 @@ class sdl_event_handler : public events::sdl_handler
* @param distance The distance moved.
*/
void touch_motion(const point& position, const point& distance);

/**
* Fires a touch "finger down" event.
*
* @param position The position touched.
*/
void touch_down(const point& position);

/**
* Fires a touch "finger up" event.
*
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/scrollbar.hpp
Expand Up @@ -71,7 +71,7 @@ class scrollbar_base : public styled_widget
* @param scroll 'step size' to scroll.
*/
void scroll(const scroll_mode scroll);

void scroll_by(const int pixels);

/** Is the positioner at the beginning of the scrollbar? */
Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/text_box_base.cpp
Expand Up @@ -168,13 +168,13 @@ size_t text_box_base::get_composition_length() const
if(!is_composing()) {
return 0;
}

size_t text_length = utf8::size(text_.text());
size_t text_cached_length = utf8::size(text_cached_);
if(text_length < text_cached_length) {
return 0;
}

return utf8::size(text_.text()) - utf8::size(text_cached_);
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/text_box_base.hpp
Expand Up @@ -120,7 +120,7 @@ class text_box_base : public styled_widget
protected:
/** Get length of composition text by IME **/
size_t get_composition_length() const;

/**
* Moves the cursor to the end of the line.
*
Expand Down
4 changes: 2 additions & 2 deletions src/map/map.hpp
Expand Up @@ -105,7 +105,7 @@ class gamemap

}
};

/** Overlays another map onto this one at the given position. */
void overlay(const gamemap& m, map_location loc, const std::vector<overlay_rule>& rules = std::vector<overlay_rule>(), bool is_odd = false, bool ignore_special_locations = false);

Expand All @@ -120,7 +120,7 @@ class gamemap
const std::vector<overlay_rule>& rules,
bool is_odd,
bool ignore_special_locations);

/** Effective map width. */
int w() const { return w_; }

Expand Down
2 changes: 1 addition & 1 deletion src/pathutils.cpp
Expand Up @@ -241,7 +241,7 @@ void get_tiles_radius(const gamemap& map, const std::vector<map_location>& locs,
typedef std::set<map_location> location_set;
location_set not_visited(locs.begin(), locs.end());

get_tiles_radius(std::move(not_visited), radius, result,
get_tiles_radius(std::move(not_visited), radius, result,
[&](const map_location& l) {
return with_border ? map.on_board_with_border(l) : map.on_board(l);
},
Expand Down
12 changes: 6 additions & 6 deletions src/pathutils_impl.hpp
Expand Up @@ -24,22 +24,22 @@
* that are connected to elements of
* locs by a chain of at most @a radius tiles, each of which matches @a pred2.
* @a result must be a std::set of locations.
*
*
* @a pred1 a fast predicate (used before cachecheck).
* @a pred2 a slow predicate (used after cachecheck).
*/
template<typename FPred1, typename FPred2>
void get_tiles_radius(std::set<map_location>&& locs, size_t radius, std::set<map_location>& result, const FPred1& pred1, const FPred2& pred2)
{
{
typedef std::set<map_location> location_set;
location_set must_visit, filtered_out;
location_set not_visited = std::move(locs);

for ( ; radius != 0 && !not_visited.empty(); --radius )
{
location_set::const_iterator it = not_visited.begin();
location_set::const_iterator it_end = not_visited.end();

result.insert(it, it_end);
for(; it != it_end; ++it) {
adjacent_loc_array_t adj;
Expand All @@ -58,10 +58,10 @@ void get_tiles_radius(std::set<map_location>&& locs, size_t radius, std::set<map
}
}
}

not_visited.swap(must_visit);
must_visit.clear();
}

result.insert(not_visited.begin(), not_visited.end());
}
4 changes: 2 additions & 2 deletions src/playmp_controller.hpp
Expand Up @@ -39,8 +39,8 @@ class playmp_controller : public playsingle_controller, public syncmp_handler
bool is_networked_mp() const override;
void send_to_wesnothd(const config& cfg, const std::string& packet_type = "unknown") const override;
bool receive_from_wesnothd(config& cfg) const override;


void play_slice(bool is_delay_enabled = true) override;
protected:
virtual void handle_generic_event(const std::string& name) override;
Expand Down
2 changes: 1 addition & 1 deletion src/playturn.cpp
Expand Up @@ -195,7 +195,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
auto disp_set_team = [](int side_index) {
const bool side_changed = static_cast<int>(display::get_singleton()->viewing_team()) != side_index;
display::get_singleton()->set_team(side_index);

if(side_changed) {
display::get_singleton()->redraw_everything();
display::get_singleton()->recalculate_minimap();
Expand Down
2 changes: 1 addition & 1 deletion src/playturn_network_adapter.cpp
Expand Up @@ -130,7 +130,7 @@ playturn_network_adapter::playturn_network_adapter(source_type source)
, data_front_()
, next_(data_.front().ordered_end())
, next_command_num_(0)

{

}
Expand Down
2 changes: 1 addition & 1 deletion src/playturn_network_adapter.hpp
Expand Up @@ -47,7 +47,7 @@ class playturn_network_adapter
// note: all of the following could be replaced by a simple std::list<config> if we would
// split incoming tags right after we rechived them from network_reader_ the reason
// why we currently don'T do that is for performance.

//this always contains one empty config because we want a valid value for next_.
std::list<config> data_;
//packages that the client could not process at that point.
Expand Down
2 changes: 1 addition & 1 deletion src/preferences/credentials.cpp
Expand Up @@ -297,7 +297,7 @@ static secure_buffer rc4_crypt(const secure_buffer& text, const secure_buffer& k
result.data(),
result.size(),
&outWritten);

assert(ccStatus == kCCSuccess);
assert(outWritten == text.size());
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/reports.cpp
Expand Up @@ -603,7 +603,7 @@ REPORT_GENERATOR(unit_defense,rc)
const team &viewing_team = rc.teams()[rc.screen().viewing_team()];
const map_location& mouseover_hex = rc.screen().mouseover_hex();
const map_location& displayed_unit_hex = rc.screen().displayed_unit_hex();
const map_location& hex = (mouseover_hex.valid() && !viewing_team.shrouded(mouseover_hex)) ? mouseover_hex : displayed_unit_hex;
const map_location& hex = (mouseover_hex.valid() && !viewing_team.shrouded(mouseover_hex)) ? mouseover_hex : displayed_unit_hex;
return unit_defense(rc, u, hex);
}
REPORT_GENERATOR(selected_unit_defense, rc)
Expand Down Expand Up @@ -938,7 +938,7 @@ static int attack_info(reports::context & rc, const attack_type &at, config &res
bool attacking = (u.side() == rc.screen().playing_side());
auto ctx = (sec_u == nullptr) ? at.specials_context_for_listing(attacking) :
at.specials_context(unit_const_ptr(&u), unit_const_ptr(sec_u), hex, sec_u->get_location(), attacking, sec_u_weapon);

boost::dynamic_bitset<> active;
const std::vector<std::pair<t_string, t_string>> &specials = at.special_tooltips(&active);
const std::size_t specials_size = specials.size();
Expand Down

0 comments on commit 4a3be68

Please sign in to comment.