Commit c01e6d47 authored by neverlord's avatar neverlord

coding style

parent 06f40508
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
namespace { namespace {
void erase_trailing_newline(std::string& str) inline void erase_trailing_newline(std::string& str)
{ {
while (!str.empty() && (*str.rbegin()) == '\n') while (!str.empty() && (*str.rbegin()) == '\n')
{ {
...@@ -96,7 +96,7 @@ cppa::process_information* compute_proc_info() ...@@ -96,7 +96,7 @@ cppa::process_information* compute_proc_info()
return new cppa::process_information(getpid(), node_id); return new cppa::process_information(getpid(), node_id);
} }
cppa::intrusive_ptr<cppa::process_information> s_pinfo; cppa::process_information_ptr s_pinfo;
struct pinfo_manager struct pinfo_manager
{ {
...@@ -151,8 +151,8 @@ void node_id_from_string(const std::string& hash, ...@@ -151,8 +151,8 @@ void node_id_from_string(const std::string& hash,
} }
} }
bool equal(const std::string& hash, bool equal(std::string const& hash,
const process_information::node_id_type& node_id) process_information::node_id_type const& node_id)
{ {
if (hash.size() != (node_id.size() * 2)) if (hash.size() != (node_id.size() * 2))
{ {
...@@ -180,23 +180,23 @@ bool equal(const std::string& hash, ...@@ -180,23 +180,23 @@ bool equal(const std::string& hash,
return true; return true;
} }
process_information::process_information(const process_information& other) process_information::process_information(process_information const& other)
: super(), m_process_id(other.process_id()), m_node_id(other.node_id()) : super(), m_process_id(other.process_id()), m_node_id(other.node_id())
{ {
} }
process_information::process_information(std::uint32_t a, const std::string& b) process_information::process_information(std::uint32_t a, std::string const& b)
: m_process_id(a) : m_process_id(a)
{ {
node_id_from_string(b, m_node_id); node_id_from_string(b, m_node_id);
} }
process_information::process_information(std::uint32_t a, const node_id_type& b) process_information::process_information(std::uint32_t a, node_id_type const& b)
: m_process_id(a), m_node_id(b) : m_process_id(a), m_node_id(b)
{ {
} }
std::string to_string(const process_information::node_id_type& node_id) std::string to_string(process_information::node_id_type const& node_id)
{ {
std::ostringstream oss; std::ostringstream oss;
oss << std::hex; oss << std::hex;
...@@ -209,15 +209,15 @@ std::string to_string(const process_information::node_id_type& node_id) ...@@ -209,15 +209,15 @@ std::string to_string(const process_information::node_id_type& node_id)
return oss.str(); return oss.str();
} }
const intrusive_ptr<process_information>& process_information::get() intrusive_ptr<process_information> const& process_information::get()
{ {
return s_pinfo; return s_pinfo;
} }
int process_information::compare(const process_information& other) const int process_information::compare(process_information const& other) const
{ {
int tmp = strncmp(reinterpret_cast<const char*>(node_id().data()), int tmp = strncmp(reinterpret_cast<char const*>(node_id().data()),
reinterpret_cast<const char*>(other.node_id().data()), reinterpret_cast<char const*>(other.node_id().data()),
node_id_size); node_id_size);
if (tmp == 0) if (tmp == 0)
{ {
...@@ -228,7 +228,7 @@ int process_information::compare(const process_information& other) const ...@@ -228,7 +228,7 @@ int process_information::compare(const process_information& other) const
return tmp; return tmp;
} }
std::string to_string(const process_information& what) std::string to_string(process_information const& what)
{ {
std::ostringstream oss; std::ostringstream oss;
oss << what.process_id() << "@" << to_string(what.node_id()); oss << what.process_id() << "@" << to_string(what.node_id());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment