diff --git a/src/dist.cpp b/src/dist.cpp index fb805103..f98ba9a5 100644 --- a/src/dist.cpp +++ b/src/dist.cpp @@ -141,7 +141,7 @@ int zmq::dist_t::send_to_all (msg_t *msg_) int zmq::dist_t::send_to_matching (msg_t *msg_) { // Is this end of a multipart message? - bool msg_more = msg_->flags () & msg_t::more ? true : false; + bool msg_more = (msg_->flags () & msg_t::more) != 0; // Push the message to matching pipes. distribute (msg_); diff --git a/src/fq.cpp b/src/fq.cpp index 1217c088..cb1337fb 100644 --- a/src/fq.cpp +++ b/src/fq.cpp @@ -99,7 +99,7 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_) if (fetched) { if (pipe_) *pipe_ = pipes[current]; - more = msg_->flags () & msg_t::more ? true : false; + more = (msg_->flags () & msg_t::more) != 0; if (!more) { last_in = pipes[current]; current = (current + 1) % active; diff --git a/src/lb.cpp b/src/lb.cpp index d92928d0..3ad27394 100644 --- a/src/lb.cpp +++ b/src/lb.cpp @@ -85,7 +85,7 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_) // Drop the message if required. If we are at the end of the message // switch back to non-dropping mode. if (dropping) { - more = msg_->flags () & msg_t::more ? true : false; + more = (msg_->flags () & msg_t::more) != 0; dropping = more; int rc = msg_->close (); @@ -127,7 +127,7 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_) // If it's final part of the message we can flush it downstream and // continue round-robining (load balance). - more = msg_->flags () & msg_t::more ? true : false; + more = (msg_->flags () & msg_t::more) != 0; if (!more) { pipes[current]->flush (); diff --git a/src/pipe.cpp b/src/pipe.cpp index 0c2a7c35..11ff8e7b 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -233,7 +233,7 @@ bool zmq::pipe_t::write (msg_t *msg_) if (unlikely (!check_write ())) return false; - bool more = msg_->flags () & msg_t::more ? true : false; + bool more = (msg_->flags () & msg_t::more) != 0; const bool is_routing_id = msg_->is_routing_id (); outpipe->write (*msg_, more); if (!more && !is_routing_id) diff --git a/src/router.cpp b/src/router.cpp index bdd1ad2f..2e8a9949 100644 --- a/src/router.cpp +++ b/src/router.cpp @@ -254,7 +254,7 @@ int zmq::router_t::xsend (msg_t *msg_) msg_->reset_flags (msg_t::more); // Check whether this is the last part of the message. - more_out = msg_->flags () & msg_t::more ? true : false; + more_out = (msg_->flags () & msg_t::more) != 0; // Push the message into the pipe. If there's no out pipe, just drop it. if (current_out) { @@ -310,7 +310,7 @@ int zmq::router_t::xrecv (msg_t *msg_) errno_assert (rc == 0); prefetched = false; } - more_in = msg_->flags () & msg_t::more ? true : false; + more_in = (msg_->flags () & msg_t::more) != 0; if (!more_in) { if (terminate_current_in) { @@ -338,7 +338,7 @@ int zmq::router_t::xrecv (msg_t *msg_) // If we are in the middle of reading a message, just return the next part. if (more_in) { - more_in = msg_->flags () & msg_t::more ? true : false; + more_in = (msg_->flags () & msg_t::more) != 0; if (!more_in) { if (terminate_current_in) { diff --git a/src/session_base.cpp b/src/session_base.cpp index 7ac0bc89..4b25b251 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -156,7 +156,7 @@ int zmq::session_base_t::pull_msg (msg_t *msg_) return -1; } - incomplete_in = msg_->flags () & msg_t::more ? true : false; + incomplete_in = (msg_->flags () & msg_t::more) != 0; return 0; } diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 8ef0fd17..a43d1fde 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -1576,7 +1576,7 @@ void zmq::socket_base_t::extract_flags (msg_t *msg_) zmq_assert (options.recv_routing_id); // Remove MORE flag. - rcvmore = msg_->flags () & msg_t::more ? true : false; + rcvmore = (msg_->flags () & msg_t::more) != 0; } int zmq::socket_base_t::monitor (const char *addr_, int events_) diff --git a/src/xpub.cpp b/src/xpub.cpp index 75144007..cfb62a84 100644 --- a/src/xpub.cpp +++ b/src/xpub.cpp @@ -230,7 +230,7 @@ void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, xpub_t *self_) int zmq::xpub_t::xsend (msg_t *msg_) { - bool msg_more = msg_->flags () & msg_t::more ? true : false; + bool msg_more = (msg_->flags () & msg_t::more) != 0; // For the first part of multi-part message, find the matching pipes. if (!more) { diff --git a/src/xsub.cpp b/src/xsub.cpp index d49d3be1..b0079ba8 100644 --- a/src/xsub.cpp +++ b/src/xsub.cpp @@ -134,7 +134,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_) int rc = msg_->move (message); errno_assert (rc == 0); has_message = false; - more = msg_->flags () & msg_t::more ? true : false; + more = (msg_->flags () & msg_t::more) != 0; return 0; } @@ -153,7 +153,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_) // Check whether the message matches at least one subscription. // Non-initial parts of the message are passed if (more || !options.filter || match (msg_)) { - more = msg_->flags () & msg_t::more ? true : false; + more = (msg_->flags () & msg_t::more) != 0; return 0; }