Mutex::Locker l(lock);
if (my_inst.addr == dest.addr) {
// local
- return (Connection *)local_connection->get();
+ return static_cast<Connection *>(local_connection->get());
}
// remote
Connection *SimpleMessenger::get_loopback_connection()
{
- return (Connection*)local_connection->get();
+ return static_cast<Connection*>(local_connection->get());
}
void SimpleMessenger::submit_message(Message *m, Connection *con,
int SimpleMessenger::send_keepalive(Connection *con)
{
int ret = 0;
- Pipe *pipe = (Pipe *)con->get_pipe();
+ Pipe *pipe = static_cast<Pipe *>(con->get_pipe());
if (pipe) {
ldout(cct,20) << "send_keepalive con " << con << ", have pipe." << dendl;
assert(pipe->msgr == this);
void SimpleMessenger::mark_down(Connection *con)
{
lock.Lock();
- Pipe *p = (Pipe *)con->get_pipe();
+ Pipe *p = static_cast<Pipe *>(con->get_pipe());
if (p) {
ldout(cct,1) << "mark_down " << con << " -- " << p << dendl;
assert(p->msgr == this);
void SimpleMessenger::mark_down_on_empty(Connection *con)
{
lock.Lock();
- Pipe *p = (Pipe *)con->get_pipe();
+ Pipe *p = static_cast<Pipe *>(con->get_pipe());
if (p) {
assert(p->msgr == this);
p->pipe_lock.Lock();
void SimpleMessenger::mark_disposable(Connection *con)
{
lock.Lock();
- Pipe *p = (Pipe *)con->get_pipe();
+ Pipe *p = static_cast<Pipe *>(con->get_pipe());
if (p) {
ldout(cct,1) << "mark_disposable " << con << " -- " << p << dendl;
assert(p->msgr == this);