Strip trailing whitespace.
This commit is contained in:
parent
b1e7df8100
commit
c5c43815ac
17 changed files with 50 additions and 50 deletions
|
@ -139,7 +139,7 @@ namespace ana
|
|||
* \sa listener_handler
|
||||
*/
|
||||
virtual void set_listener_handler( listener_handler* listener ) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the client_id of this listener.
|
||||
*
|
||||
|
@ -150,13 +150,13 @@ namespace ana
|
|||
* \sa client_id
|
||||
*/
|
||||
virtual client_id id() const = 0;
|
||||
|
||||
|
||||
protected: // should be so?
|
||||
/** Start listening for incoming messages. */
|
||||
virtual void run_listener() = 0;
|
||||
};
|
||||
} //namespace details
|
||||
|
||||
|
||||
/**
|
||||
* Class that should be implemented to handle new connection events.
|
||||
*/
|
||||
|
|
|
@ -57,13 +57,13 @@ namespace ana
|
|||
size_( size )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/** Deletes the buffer from heap. */
|
||||
~read_buffer_implementation()
|
||||
{
|
||||
delete[] base_;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the base address.
|
||||
*
|
||||
|
@ -73,7 +73,7 @@ namespace ana
|
|||
{
|
||||
return base_;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the base address.
|
||||
*
|
||||
|
@ -83,19 +83,19 @@ namespace ana
|
|||
{
|
||||
return static_cast<void*>(base_);
|
||||
}
|
||||
|
||||
|
||||
/** Get the size of the buffer. */
|
||||
size_t size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
|
||||
/** Create a string from the buffer. */
|
||||
std::string string()
|
||||
{
|
||||
return std::string( base_, size_ );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
char* base_;
|
||||
size_t size_;
|
||||
|
@ -125,17 +125,17 @@ namespace ana
|
|||
else
|
||||
base_ = const_cast<void*>(boost::asio::detail::buffer_cast_helper(buffer));
|
||||
}
|
||||
|
||||
|
||||
inline size_t size() const { return size_; }
|
||||
|
||||
|
||||
inline void* base() const { return base_; }
|
||||
|
||||
|
||||
~copying_buffer()
|
||||
{
|
||||
if (copy_)
|
||||
std::free( base_ );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const size_t size_;
|
||||
void* base_;
|
||||
|
@ -145,7 +145,7 @@ namespace ana
|
|||
typedef boost::shared_ptr<detail::copying_buffer> shared_buffer;
|
||||
|
||||
} //namespace detail
|
||||
|
||||
|
||||
|
||||
/** @name Buffer creation methods
|
||||
*
|
||||
|
@ -221,7 +221,7 @@ namespace ana
|
|||
return boost::asio::buffer(data);
|
||||
}
|
||||
|
||||
template<typename PodType, std::size_t N>
|
||||
template<typename PodType, std::size_t N>
|
||||
inline boost::asio::mutable_buffers_1 buffer(boost::array< PodType, N > & data,
|
||||
std::size_t max_size_in_bytes)
|
||||
{
|
||||
|
@ -267,7 +267,7 @@ namespace ana
|
|||
return boost::asio::buffer(data, max_size_in_bytes);
|
||||
}
|
||||
|
||||
template<typename PodType, typename Allocator>
|
||||
template<typename PodType, typename Allocator>
|
||||
inline boost::asio::const_buffers_1 buffer(const std::vector< PodType, Allocator > & data)
|
||||
{
|
||||
return boost::asio::buffer(data);
|
||||
|
|
|
@ -46,24 +46,24 @@ namespace ana
|
|||
//@{
|
||||
typedef boost::uint32_t ana_uint32 /** Standard unsigned int, with fixed size to 32 bits. */ ;
|
||||
typedef boost::int32_t ana_int32 /** Standard int, with fixed size to 32 bits. */ ;
|
||||
|
||||
|
||||
typedef ana_uint32 client_id /** Type of IDs of connected components, unique. */ ;
|
||||
typedef ana_uint32 message_size /** Message size type. */ ;
|
||||
|
||||
|
||||
typedef std::string port /** Port type, a std::string (instead of a short.) */ ;
|
||||
typedef std::string address /** Address type, a string. Either IP of hostname. */ ;
|
||||
|
||||
|
||||
typedef bool send_type /** Send operation type, true to copy the buffer. */ ;
|
||||
|
||||
|
||||
typedef boost::system::error_code error_code /** Standard error code, can evaluate to bool. */ ;
|
||||
|
||||
|
||||
const send_type ZeroCopy = false /** Don't copy the buffer. */ ;
|
||||
const send_type CopyBuffer = true /** Copy the buffer. */ ;
|
||||
|
||||
|
||||
const message_size HeaderLength = sizeof(ana_uint32) /** Length of message header. */ ;
|
||||
|
||||
|
||||
const client_id ServerID = 0 /** The ID of the server application. */ ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -57,7 +57,7 @@ namespace ana
|
|||
virtual bool selects(client_id) const = 0;
|
||||
};
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* Intended for private use, should be created with create_predicate.
|
||||
*
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ana
|
|||
TimePerKilobyte /** Use timers, calculating the necessary time from
|
||||
the size of the buffer that is to be sent. */
|
||||
};
|
||||
|
||||
|
||||
/** @name Timers
|
||||
*
|
||||
* Definitions of timer related types.
|
||||
|
|
|
@ -80,7 +80,7 @@ void asio_client::handle_proxy_connection(const boost::system::error_code& ec, a
|
|||
|
||||
if ( ! ec )
|
||||
run_listener();
|
||||
|
||||
|
||||
delete proxy_;
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ void proxy_connection::handle_connect(const boost::system::error_code& ec,
|
|||
if ( ! ec )
|
||||
{
|
||||
std::string* request( NULL );
|
||||
|
||||
|
||||
if ( authenticating_ )
|
||||
request = generate_base64_credentials();
|
||||
else
|
||||
|
|
|
@ -300,7 +300,7 @@ void game_display::draw_invalidated()
|
|||
{
|
||||
halo::unrender(invalidated_);
|
||||
display::draw_invalidated();
|
||||
|
||||
|
||||
foreach(unit* temp_unit, temp_units_) {
|
||||
const map_location& loc = temp_unit->get_location();
|
||||
if (invalidated_.find(loc) != invalidated_.end())
|
||||
|
|
|
@ -929,7 +929,7 @@ void menu_handler::recall(int side_num, const map_location &last_hex)
|
|||
//sort by level
|
||||
static int sort_by = 3;
|
||||
static bool sort_reversed = false;
|
||||
|
||||
|
||||
if(sort_by >= 0) {
|
||||
rmenu.get_menu().sort_by(sort_by);
|
||||
// "reclick" on the sorter to reverse the order
|
||||
|
|
|
@ -92,8 +92,8 @@ void persist_context::load() {
|
|||
load_persist_data(namespace_.root_,cfg_,false);
|
||||
}
|
||||
|
||||
persist_context::persist_context(const std::string &name_space) :
|
||||
namespace_(name_space),
|
||||
persist_context::persist_context(const std::string &name_space) :
|
||||
namespace_(name_space),
|
||||
cfg_(),
|
||||
valid_(namespace_.valid()),
|
||||
root_node_(namespace_.root_,this,cfg_),
|
||||
|
|
|
@ -95,7 +95,7 @@ private:
|
|||
}
|
||||
config &cfg() { return cfg_; }
|
||||
node &add_child(const std::string &name) {
|
||||
children_[name] = new node(name,root_,cfg_.child_or_add(name),this);
|
||||
children_[name] = new node(name,root_,cfg_.child_or_add(name),this);
|
||||
return *(children_[name]);
|
||||
}
|
||||
node &child(const name_space &name) {
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
config get_var(const std::string &);
|
||||
bool set_var(const std::string &, const config &);
|
||||
bool valid() const { return valid_; };
|
||||
bool dirty() const {
|
||||
bool dirty() const {
|
||||
return true;
|
||||
};
|
||||
operator bool() { return valid_; }
|
||||
|
|
|
@ -42,7 +42,7 @@ class controller
|
|||
public:
|
||||
controller(display& disp, const vconfig& data, const std::string& scenario_name,
|
||||
int segment_index, int total_segments);
|
||||
|
||||
|
||||
/**
|
||||
* Display all story screen parts in a first..last sequence.
|
||||
*/
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace {
|
|||
partcfg["text_align"] = "centered";
|
||||
}
|
||||
|
||||
int count_segments(const config::const_child_itors &story)
|
||||
int count_segments(const config::const_child_itors &story)
|
||||
{
|
||||
config::const_child_iterator itor = story.first;
|
||||
int count = 0;
|
||||
|
@ -59,7 +59,7 @@ namespace {
|
|||
} // end anonymous namespace
|
||||
|
||||
|
||||
storyscreen::STORY_RESULT show_story(display& disp,
|
||||
storyscreen::STORY_RESULT show_story(display& disp,
|
||||
const std::string& scenario_name,
|
||||
const config::const_child_itors &story) {
|
||||
const int total_segments = count_segments(story);
|
||||
|
@ -67,7 +67,7 @@ storyscreen::STORY_RESULT show_story(display& disp,
|
|||
config::const_child_iterator itor = story.first;
|
||||
storyscreen::START_POSITION startpos = storyscreen::START_BEGINNING;
|
||||
while(itor != story.second) {
|
||||
storyscreen::STORY_RESULT result = show_storyscreen(disp, vconfig(*itor, true), scenario_name,
|
||||
storyscreen::STORY_RESULT result = show_storyscreen(disp, vconfig(*itor, true), scenario_name,
|
||||
startpos, segment_count, total_segments);
|
||||
switch(result) {
|
||||
case storyscreen::NEXT:
|
||||
|
@ -106,7 +106,7 @@ storyscreen::STORY_RESULT show_story(display& disp,
|
|||
return storyscreen::NEXT;
|
||||
}
|
||||
|
||||
storyscreen::STORY_RESULT show_storyscreen(display& disp, const vconfig& story_cfg,
|
||||
storyscreen::STORY_RESULT show_storyscreen(display& disp, const vconfig& story_cfg,
|
||||
const std::string& scenario_name,
|
||||
storyscreen::START_POSITION startpos,
|
||||
int segment_index, int total_segments)
|
||||
|
|
|
@ -59,11 +59,11 @@ enum START_POSITION {
|
|||
* storyline,and 'img' is a background image. Each part of the sequence will
|
||||
* be displayed in turn, with the user able to go to the next part, or skip
|
||||
* it entirely.
|
||||
* @return is NEXT if the segment played to the end, BACK if the segment played to the beginning,
|
||||
* @return is NEXT if the segment played to the end, BACK if the segment played to the beginning,
|
||||
* FIRST if a skip to the first segment is requested, LAST if a skip to the last segment is requested,
|
||||
* and QUIT if the story was quit
|
||||
*/
|
||||
storyscreen::STORY_RESULT show_storyscreen(display& disp, const vconfig& story_cfg,
|
||||
storyscreen::STORY_RESULT show_storyscreen(display& disp, const vconfig& story_cfg,
|
||||
const std::string& scenario_name,
|
||||
storyscreen::START_POSITION startpos,
|
||||
int segment_index, int total_segments);
|
||||
|
|
|
@ -81,8 +81,8 @@ namespace {
|
|||
|
||||
namespace storyscreen {
|
||||
|
||||
part_ui::part_ui(part& p, display& disp,
|
||||
gui::button& next_button, gui::button& back_button,
|
||||
part_ui::part_ui(part& p, display& disp,
|
||||
gui::button& next_button, gui::button& back_button,
|
||||
gui::button& first_button, gui::button& last_button,
|
||||
gui::button& play_button)
|
||||
: p_(p)
|
||||
|
@ -270,8 +270,8 @@ bool part_ui::render_floating_images()
|
|||
}
|
||||
}
|
||||
|
||||
if(keys_[SDLK_ESCAPE] ||
|
||||
next_button_.pressed() || back_button_.pressed() ||
|
||||
if(keys_[SDLK_ESCAPE] ||
|
||||
next_button_.pressed() || back_button_.pressed() ||
|
||||
first_button_.pressed() || last_button_.pressed() ||
|
||||
play_button_.pressed()) {
|
||||
skip = true;
|
||||
|
@ -561,7 +561,7 @@ void part_ui::render_story_box()
|
|||
if((last_keydown && !last_key) || last_button_.pressed()) {
|
||||
ret_ = LAST;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if((first_keydown && !last_key) || first_button_.pressed()) {
|
||||
ret_ = FIRST;
|
||||
|
@ -603,7 +603,7 @@ void part_ui::wait_for_input()
|
|||
ret_ = NEXT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if((back_keydown && !last_key) || back_button_.pressed()) {
|
||||
ret_ = BACK;
|
||||
break;
|
||||
|
|
|
@ -58,8 +58,8 @@ public:
|
|||
* @param next_button Next button. Shouldn't be destroyed before the part_ui object.
|
||||
* @param skip_button Skip button. Shouldn't be destroyed before the part_ui object.
|
||||
*/
|
||||
part_ui(part& p, display& disp,
|
||||
gui::button& next_button, gui::button& back_button,
|
||||
part_ui(part& p, display& disp,
|
||||
gui::button& next_button, gui::button& back_button,
|
||||
gui::button& first_button, gui::button& last_button,
|
||||
gui::button& play_button);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ void process(int mousex, int mousey);
|
|||
|
||||
// Check if we clicked on a tooltip having an action.
|
||||
// If it is, then execute the action and return true
|
||||
// (only possible action are opening help page for the moment)
|
||||
// (only possible action are opening help page for the moment)
|
||||
bool click(int mousex, int mousey);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue