Removed trailing tabs and whitespaces from C++ source
[ci skip]
I ran the same command from 9b7b175
.
Excludes:
* lua/
* spirit_po/
This commit is contained in:
parent
d8f90bc394
commit
ca6ac942f7
30 changed files with 51 additions and 51 deletions
|
@ -373,7 +373,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));
|
||||
}
|
||||
|
@ -976,7 +976,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_;
|
||||
|
|
|
@ -178,7 +178,7 @@ protected:
|
|||
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_;
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
@ -20,8 +20,8 @@
|
|||
|
||||
namespace desktop {
|
||||
namespace apple {
|
||||
|
||||
|
||||
std::string os_version();
|
||||
|
||||
|
||||
} // end namespace apple
|
||||
} // end namespace desktop
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ std::string os_version()
|
|||
//
|
||||
// Standard Mac OS X version
|
||||
//
|
||||
|
||||
|
||||
return desktop::apple::os_version();
|
||||
|
||||
#elif defined(_X11)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
|
||||
/**
|
||||
* Get maximum length.
|
||||
*
|
||||
*
|
||||
* @returns The maximum length of the text. The length of text
|
||||
* should not exceed this value.
|
||||
*/
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -142,7 +142,7 @@ public:
|
|||
return users_;
|
||||
}
|
||||
|
||||
bool gamelist_initialized() const
|
||||
bool gamelist_initialized() const
|
||||
{
|
||||
return gamelist_initialized_;
|
||||
}
|
||||
|
|
|
@ -492,7 +492,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) {
|
||||
|
|
|
@ -230,14 +230,14 @@ private:
|
|||
* @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.
|
||||
*
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
* @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? */
|
||||
|
|
|
@ -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_);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
protected:
|
||||
/** Get length of composition text by IME **/
|
||||
size_t get_composition_length() const;
|
||||
|
||||
|
||||
/**
|
||||
* Moves the cursor to the end of the line.
|
||||
*
|
||||
|
|
|
@ -167,7 +167,7 @@ static inline std::string get_mp_tooltip(int total_movement, std::function<int (
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
for(const terrain_movement& tm: terrain_moves)
|
||||
{
|
||||
|
|
|
@ -39,8 +39,8 @@ public:
|
|||
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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -130,7 +130,7 @@ playturn_network_adapter::playturn_network_adapter(source_type source)
|
|||
, data_front_()
|
||||
, next_(data_.front().ordered_end())
|
||||
, next_command_num_(0)
|
||||
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ private:
|
|||
// 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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "game_version.hpp"
|
||||
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
@ -521,7 +521,7 @@ private:
|
|||
randomness::mt_rng rng_;
|
||||
int last_choice_request_id_;
|
||||
mutable boost::optional<version_range> player_versions_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace wesnothd
|
||||
|
|
|
@ -416,7 +416,7 @@ namespace
|
|||
} else {
|
||||
message = VGETTEXT(text.c_str(), i18n_vars);
|
||||
}
|
||||
|
||||
|
||||
if(show_long_message && !ignore) {
|
||||
play_controller::scoped_savegame_snapshot snapshot(controller);
|
||||
std::stringstream sbuilder;
|
||||
|
|
|
@ -959,7 +959,7 @@ void unit::advance_to(const unit_type& u_type, bool use_traits)
|
|||
max_attacks_ = new_type.max_attacks();
|
||||
|
||||
flag_rgb_ = new_type.flag_rgb();
|
||||
|
||||
|
||||
upkeep_ = upkeep_full();
|
||||
parse_upkeep(new_type.get_cfg()["upkeep"]);
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ bool manager::allow_leader_to_move(const unit& leader) const
|
|||
|
||||
//Look for another leader on another keep in the same castle
|
||||
{ wb::future_map future; // start planned unit map scope
|
||||
|
||||
|
||||
// TODO: when the game executes all whiteboard moves at turn end applying the future map
|
||||
// will fail because we are currently executing actions, and if one of those actions
|
||||
// was a movement of the leader this function will be called, resulting the the error
|
||||
|
|
|
@ -86,7 +86,7 @@ private:
|
|||
unit_ptr temp_unit_;
|
||||
map_location recall_hex_;
|
||||
fake_unit_ptr fake_unit_;
|
||||
|
||||
|
||||
int original_mp_;
|
||||
int original_ap_;
|
||||
int original_recall_pos_;
|
||||
|
|
|
@ -87,7 +87,7 @@ void recruit::init()
|
|||
{
|
||||
temp_unit_->set_movement(0, true);
|
||||
temp_unit_->set_attacks(0);
|
||||
|
||||
|
||||
fake_unit_->set_location(recruit_hex_);
|
||||
fake_unit_->set_movement(0, true);
|
||||
fake_unit_->set_attacks(0);
|
||||
|
@ -145,7 +145,7 @@ void recruit::apply_temp_modifier(unit_map& unit_map)
|
|||
// unit map takes ownership of temp_unit
|
||||
const size_t old_id = temp_unit_->underlying_id();
|
||||
unit_map.insert(temp_unit_);
|
||||
|
||||
|
||||
//in the past there was a bug where the map changed the unit ids here (because a unit with that id already existed) which caused crashes later.
|
||||
assert(temp_unit_->underlying_id() == old_id);
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ size_t side_actions_container::get_turn_impl(size_t begin, size_t end, const_ite
|
|||
ERR_WB << "get_turn: begin >= end\n";
|
||||
}
|
||||
else if(it < turn_beginnings_[begin]) {
|
||||
ERR_WB << "get_turn failed\n";
|
||||
ERR_WB << "get_turn failed\n";
|
||||
}
|
||||
return begin;
|
||||
}
|
||||
|
@ -564,18 +564,18 @@ side_actions::iterator side_actions::remove_action(side_actions::iterator positi
|
|||
|
||||
LOG_WB << "Erasing action at turn #" << get_turn(position) << " position #" << actions_.position_in_turn(position) << "\n";
|
||||
|
||||
|
||||
|
||||
if(resources::gameboard->get_team(team_index_ + 1).is_local()) {
|
||||
position = synced_erase(position);
|
||||
}
|
||||
else {
|
||||
// don't sync actions of sides that we don't control, this would only generate
|
||||
// don't sync actions of sides that we don't control, this would only generate
|
||||
// 'illegal whiteboard data' server wanrings.
|
||||
// it might be better to instead don't even erase the action in this case to keep
|
||||
// the actionlist in sync with the owner client.
|
||||
position = safe_erase(position);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(validate_after_delete) {
|
||||
resources::whiteboard->validate_viewer_actions();
|
||||
|
@ -703,7 +703,7 @@ void side_actions::update_recruited_unit(std::size_t old_id, unit& new_unit)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
side_actions::iterator side_actions::safe_insert(size_t turn, size_t pos, action_ptr act)
|
||||
{
|
||||
assert(act);
|
||||
|
|
|
@ -166,17 +166,17 @@ void scrollarea::handle_event(const SDL_Event& event)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (event.type == SDL_FINGERUP) {
|
||||
swipe_dy_ = 0;
|
||||
}
|
||||
|
||||
|
||||
if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
|
||||
SDL_Rect r = video().screen_area();
|
||||
auto tx = static_cast<int>(event.tfinger.x * r.w);
|
||||
auto ty = static_cast<int>(event.tfinger.y * r.h);
|
||||
auto dy = static_cast<int>(event.tfinger.dy * r.h);
|
||||
|
||||
|
||||
if (event.type == SDL_FINGERDOWN) {
|
||||
swipe_dy_ = 0;
|
||||
swipe_origin_.x = tx;
|
||||
|
@ -184,7 +184,7 @@ void scrollarea::handle_event(const SDL_Event& event)
|
|||
}
|
||||
|
||||
if (event.type == SDL_FINGERMOTION) {
|
||||
|
||||
|
||||
swipe_dy_ += dy;
|
||||
if (scrollbar_.get_max_position() == 0) {
|
||||
return;
|
||||
|
@ -194,7 +194,7 @@ void scrollarea::handle_event(const SDL_Event& event)
|
|||
if (scrollbar_step <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sdl::point_in_rect(swipe_origin_.x, swipe_origin_.y, inner_location())
|
||||
&& abs(swipe_dy_) >= scrollbar_step)
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ void scrollarea::handle_event(const SDL_Event& event)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // end namespace gui
|
||||
|
|
Loading…
Add table
Reference in a new issue