Reformat all code parts

This commit is contained in:
Simon Fels 2017-01-03 09:18:10 +01:00
commit 6307ee4b65
15 changed files with 392 additions and 382 deletions

View file

@ -19,8 +19,8 @@
#define ANBOX_APPLICATION_MANAGER_H_ #define ANBOX_APPLICATION_MANAGER_H_
#include "anbox/android/intent.h" #include "anbox/android/intent.h"
#include "anbox/graphics/rect.h"
#include "anbox/do_not_copy_or_move.h" #include "anbox/do_not_copy_or_move.h"
#include "anbox/graphics/rect.h"
#include <string> #include <string>

View file

@ -105,14 +105,16 @@ void cli::CommandWithSubcommands::help(std::ostream& out) {
<< std::endl; << std::endl;
if (flags_.size() > 0) { if (flags_.size() > 0) {
out << std::endl << pattern::options << std::endl; out << std::endl
<< pattern::options << std::endl;
for (const auto& flag : flags_) for (const auto& flag : flags_)
out << boost::format(pattern::option) % flag->name() % flag->description() out << boost::format(pattern::option) % flag->name() % flag->description()
<< std::endl; << std::endl;
} }
if (commands_.size() > 0) { if (commands_.size() > 0) {
out << std::endl << pattern::commands << std::endl; out << std::endl
<< pattern::commands << std::endl;
for (const auto& cmd : commands_) { for (const auto& cmd : commands_) {
if (cmd.second) if (cmd.second)
out << boost::format(pattern::command) % cmd.second->name() % out << boost::format(pattern::command) % cmd.second->name() %
@ -222,7 +224,8 @@ void cli::CommandWithFlagsAndAction::help(std::ostream& out) {
<< std::endl; << std::endl;
if (flags_.size() > 0) { if (flags_.size() > 0) {
out << std::endl << boost::format(pattern::options) << std::endl; out << std::endl
<< boost::format(pattern::options) << std::endl;
for (const auto& flag : flags_) for (const auto& flag : flags_)
out << boost::format(pattern::option) % flag->name() % flag->description() out << boost::format(pattern::option) % flag->name() % flag->description()
<< std::endl; << std::endl;

View file

@ -16,8 +16,7 @@
namespace anbox { namespace anbox {
namespace common { namespace common {
MessageChannelBase::MessageChannelBase(size_t capacity) : MessageChannelBase::MessageChannelBase(size_t capacity) : pos_(0U),
pos_(0U),
count_(0U), count_(0U),
capacity_(capacity), capacity_(capacity),
lock_(), lock_(),

View file

@ -17,8 +17,8 @@
#include <stddef.h> #include <stddef.h>
#include <mutex>
#include <condition_variable> #include <condition_variable>
#include <mutex>
namespace anbox { namespace anbox {
namespace common { namespace common {
@ -26,14 +26,14 @@ namespace common {
// Base non-templated class used to reduce the amount of template // Base non-templated class used to reduce the amount of template
// specialization. // specialization.
class MessageChannelBase { class MessageChannelBase {
public: public:
// Constructor. |capacity| is the buffer capacity in messages. // Constructor. |capacity| is the buffer capacity in messages.
MessageChannelBase(size_t capacity); MessageChannelBase(size_t capacity);
// Destructor. // Destructor.
~MessageChannelBase(); ~MessageChannelBase();
protected: protected:
// Call this method in the sender thread before writing a new message. // Call this method in the sender thread before writing a new message.
// This returns the position of the available slot in the message array // This returns the position of the available slot in the message array
// where to copy the new fixed-size message. After the copy, call // where to copy the new fixed-size message. After the copy, call
@ -54,7 +54,7 @@ protected:
// the corresponding message. // the corresponding message.
void after_read(); void after_read();
private: private:
size_t pos_; size_t pos_;
size_t count_; size_t count_;
size_t capacity_; size_t capacity_;
@ -75,7 +75,7 @@ private:
// //
template <typename T, size_t CAPACITY> template <typename T, size_t CAPACITY>
class MessageChannel : public MessageChannelBase { class MessageChannel : public MessageChannelBase {
public: public:
MessageChannel() : MessageChannelBase(CAPACITY) {} MessageChannel() : MessageChannelBase(CAPACITY) {}
void send(const T& msg) { void send(const T& msg) {
@ -90,7 +90,7 @@ public:
after_read(); after_read();
} }
private: private:
T mItems[CAPACITY]; T mItems[CAPACITY];
}; };
} // namespace common } // namespace common

View file

@ -39,7 +39,8 @@ struct FuncDelete {
FuncDelete& operator=(FuncDelete&& other) = default; FuncDelete& operator=(FuncDelete&& other) = default;
// To be able to copy/move from all compatible template instantiations. // To be able to copy/move from all compatible template instantiations.
template <class U> friend struct FuncDelete; template <class U>
friend struct FuncDelete;
// Template constructors and move assignment from compatible instantiations. // Template constructors and move assignment from compatible instantiations.
template <class U> template <class U>
@ -63,7 +64,7 @@ struct FuncDelete {
mF(t); mF(t);
} }
private: private:
Func mF; Func mF;
}; };

View file

@ -18,11 +18,11 @@
#include "anbox/container/client.h" #include "anbox/container/client.h"
#include "anbox/config.h" #include "anbox/config.h"
#include "anbox/container/management_api_stub.h" #include "anbox/container/management_api_stub.h"
#include "anbox/logger.h"
#include "anbox/network/local_socket_messenger.h" #include "anbox/network/local_socket_messenger.h"
#include "anbox/rpc/channel.h" #include "anbox/rpc/channel.h"
#include "anbox/rpc/message_processor.h" #include "anbox/rpc/message_processor.h"
#include "anbox/rpc/pending_call_cache.h" #include "anbox/rpc/pending_call_cache.h"
#include "anbox/logger.h"
namespace ba = boost::asio; namespace ba = boost::asio;
namespace bs = boost::system; namespace bs = boost::system;

View file

@ -45,7 +45,7 @@ ApplicationManager::ApplicationManager(
reader >> top; reader >> top;
reader >> right; reader >> right;
reader >> bottom; reader >> bottom;
graphics::Rect launch_bounds{left,top,right,bottom}; graphics::Rect launch_bounds{left, top, right, bottom};
core::dbus::Message::Ptr reply; core::dbus::Message::Ptr reply;

View file

@ -36,7 +36,7 @@ class RenderThread : public emugl::Thread {
// decoding operations between all threads. // decoding operations between all threads.
// TODO(digit): Why is this needed here? Shouldn't this be handled // TODO(digit): Why is this needed here? Shouldn't this be handled
// by the decoders themselves or at a lower-level? // by the decoders themselves or at a lower-level?
static RenderThread* create(const std::shared_ptr<Renderer> &renderer, IOStream* stream, emugl::Mutex* mutex); static RenderThread* create(const std::shared_ptr<Renderer>& renderer, IOStream* stream, emugl::Mutex* mutex);
// Destructor. // Destructor.
virtual ~RenderThread(); virtual ~RenderThread();
@ -51,7 +51,7 @@ class RenderThread : public emugl::Thread {
private: private:
RenderThread(); // No default constructor RenderThread(); // No default constructor
RenderThread(const std::shared_ptr<Renderer> &renderer, IOStream* stream, emugl::Mutex* mutex); RenderThread(const std::shared_ptr<Renderer>& renderer, IOStream* stream, emugl::Mutex* mutex);
virtual intptr_t main(); virtual intptr_t main();

View file

@ -56,7 +56,9 @@ class WindowSurface {
bool flushColorBuffer(); bool flushColorBuffer();
// Used by bind() below. // Used by bind() below.
enum BindType { BIND_READ, BIND_DRAW, BIND_READDRAW }; enum BindType { BIND_READ,
BIND_DRAW,
BIND_READDRAW };
// TODO(digit): What is this used for exactly? For example, the // TODO(digit): What is this used for exactly? For example, the
// mReadContext is never used by this class. The mDrawContext is only // mReadContext is never used by this class. The mDrawContext is only

View file

@ -33,7 +33,12 @@ class Logger : public DoNotCopyOrMove {
public: public:
// Severity enumerates all known severity levels // Severity enumerates all known severity levels
// applicable to log messages. // applicable to log messages.
enum class Severity { kTrace, kDebug, kInfo, kWarning, kError, kFatal }; enum class Severity { kTrace,
kDebug,
kInfo,
kWarning,
kError,
kFatal };
// A Location describes the origin of a log message. // A Location describes the origin of a log message.
struct Location { struct Location {