Commit a1b6268c authored by Simon Giesecke's avatar Simon Giesecke

Made to_string const; converted C-style cast to reinterpret_cast

parent 737927e3
...@@ -75,7 +75,7 @@ int zmq::ipc_address_t::resolve (const char *path_) ...@@ -75,7 +75,7 @@ int zmq::ipc_address_t::resolve (const char *path_)
return 0; return 0;
} }
int zmq::ipc_address_t::to_string (std::string &addr_) int zmq::ipc_address_t::to_string (std::string &addr_) const
{ {
if (address.sun_family != AF_UNIX) { if (address.sun_family != AF_UNIX) {
addr_.clear (); addr_.clear ();
...@@ -94,7 +94,7 @@ int zmq::ipc_address_t::to_string (std::string &addr_) ...@@ -94,7 +94,7 @@ int zmq::ipc_address_t::to_string (std::string &addr_)
const sockaddr *zmq::ipc_address_t::addr () const const sockaddr *zmq::ipc_address_t::addr () const
{ {
return (sockaddr *) &address; return reinterpret_cast<const sockaddr *> (&address);
} }
socklen_t zmq::ipc_address_t::addrlen () const socklen_t zmq::ipc_address_t::addrlen () const
......
...@@ -51,7 +51,7 @@ class ipc_address_t ...@@ -51,7 +51,7 @@ class ipc_address_t
int resolve (const char *path_); int resolve (const char *path_);
// The opposite to resolve() // The opposite to resolve()
int to_string (std::string &addr_); int to_string (std::string &addr_) const;
const sockaddr *addr () const; const sockaddr *addr () const;
socklen_t addrlen () const; socklen_t addrlen () const;
......
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