summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-06-23 08:51:48 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-06-23 08:51:48 +0200
commit770d0bc77cd1579a1cba33ba1eb3f06839c28c16 (patch)
tree2764395c2a1dabc81d6b5c8d7ac9e1900898cf29 /src
parentd1373792f7888f312cd7286fdf524a0bfe124846 (diff)
Fix MSVC build
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r--src/dist.cpp3
-rw-r--r--src/fq.cpp3
-rw-r--r--src/lb.cpp5
-rw-r--r--src/pipe.cpp2
-rw-r--r--src/random.cpp1
-rw-r--r--src/rep.cpp2
-rw-r--r--src/req.cpp2
-rw-r--r--src/router.cpp6
-rw-r--r--src/session.cpp3
-rw-r--r--src/socket_base.cpp6
-rw-r--r--src/xpub.cpp3
-rw-r--r--src/xrep.cpp6
-rw-r--r--src/xsub.cpp5
13 files changed, 27 insertions, 20 deletions
diff --git a/src/dist.cpp b/src/dist.cpp
index 6b95b2e..e088e5e 100644
--- a/src/dist.cpp
+++ b/src/dist.cpp
@@ -111,7 +111,8 @@ int zmq::dist_t::send_to_all (msg_t *msg_, int flags_)
int zmq::dist_t::send_to_matching (msg_t *msg_, int flags_)
{
// Is this end of a multipart message?
- bool msg_more = msg_->flags () & (msg_t::more | msg_t::label);
+ bool msg_more =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
// Push the message to matching pipes.
distribute (msg_, flags_);
diff --git a/src/fq.cpp b/src/fq.cpp
index 1a2a0c0..abd4160 100644
--- a/src/fq.cpp
+++ b/src/fq.cpp
@@ -90,7 +90,8 @@ int zmq::fq_t::recvpipe (msg_t *msg_, int flags_, pipe_t **pipe_)
if (fetched) {
if (pipe_)
*pipe_ = pipes [current];
- more = msg_->flags () & (msg_t::more | msg_t::label);
+ more =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
if (!more) {
current++;
if (current >= active)
diff --git a/src/lb.cpp b/src/lb.cpp
index 6101c69..da7cb9d 100644
--- a/src/lb.cpp
+++ b/src/lb.cpp
@@ -75,7 +75,7 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
// switch back to non-dropping mode.
if (dropping) {
- more = msg_->flags () & (msg_t::more | msg_t::label);
+ more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
if (!more)
dropping = false;
@@ -88,7 +88,8 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
while (active > 0) {
if (pipes [current]->write (msg_)) {
- more = msg_->flags () & (msg_t::more | msg_t::label);
+ more =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
break;
}
diff --git a/src/pipe.cpp b/src/pipe.cpp
index c290bae..c52deb9 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -165,7 +165,7 @@ bool zmq::pipe_t::write (msg_t *msg_)
if (unlikely (!check_write (msg_)))
return false;
- bool more = msg_->flags () & (msg_t::more | msg_t::label);
+ bool more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
outpipe->write (*msg_, more);
if (!more)
msgs_written++;
diff --git a/src/random.cpp b/src/random.cpp
index ee7a7fb..2a1d7d6 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -19,6 +19,7 @@
*/
#include "random.hpp"
+#include "stdint.hpp"
#include "uuid.hpp"
#include "err.hpp"
diff --git a/src/rep.cpp b/src/rep.cpp
index a5d1462..ee67186 100644
--- a/src/rep.cpp
+++ b/src/rep.cpp
@@ -42,7 +42,7 @@ int zmq::rep_t::xsend (msg_t *msg_, int flags_)
return -1;
}
- bool more = msg_->flags () & (msg_t::more | msg_t::label);
+ bool more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
// Push message to the reply pipe.
int rc = xrep_t::xsend (msg_, flags_);
diff --git a/src/req.cpp b/src/req.cpp
index e51b853..e0e3321 100644
--- a/src/req.cpp
+++ b/src/req.cpp
@@ -65,7 +65,7 @@ int zmq::req_t::xsend (msg_t *msg_, int flags_)
message_begins = false;
}
- bool more = msg_->flags () & (msg_t::more | msg_t::label);
+ bool more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
int rc = xreq_t::xsend (msg_, flags_);
if (rc != 0)
diff --git a/src/router.cpp b/src/router.cpp
index 2a19068..0d1b77e 100644
--- a/src/router.cpp
+++ b/src/router.cpp
@@ -159,7 +159,7 @@ int zmq::router_t::xsend (msg_t *msg_, int flags_)
}
// Check whether this is the last part of the message.
- more_out = msg_->flags () & (msg_t::more | msg_t::label);
+ more_out = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
// Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) {
@@ -188,7 +188,7 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
if (prefetched) {
int rc = msg_->move (prefetched_msg);
errno_assert (rc == 0);
- more_in = msg_->flags () & (msg_t::more | msg_t::label);
+ more_in = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
prefetched = false;
return 0;
}
@@ -202,7 +202,7 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
zmq_assert (inpipes [current_in].active);
bool fetched = inpipes [current_in].pipe->read (msg_);
zmq_assert (fetched);
- more_in = msg_->flags () & (msg_t::more | msg_t::label);
+ more_in = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
if (!more_in) {
current_in++;
if (current_in >= inpipes.size ())
diff --git a/src/session.cpp b/src/session.cpp
index 9286054..1ca69cf 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -71,7 +71,8 @@ bool zmq::session_t::read (msg_t *msg_)
if (!pipe->read (msg_))
return false;
- incomplete_in = msg_->flags () & (msg_t::more | msg_t::label);
+ incomplete_in =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
return true;
}
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 74a345b..6541661 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -582,7 +582,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel)
msg_->reset_flags (msg_t::label);
- rcvmore = msg_->flags () & msg_t::more;
+ rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore)
msg_->reset_flags (msg_t::more);
return 0;
@@ -603,7 +603,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel)
msg_->reset_flags (msg_t::label);
- rcvmore = msg_->flags () & msg_t::more;
+ rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore)
msg_->reset_flags (msg_t::more);
return 0;
@@ -642,7 +642,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel)
msg_->reset_flags (msg_t::label);
- rcvmore = msg_->flags () & msg_t::more;
+ rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore)
msg_->reset_flags (msg_t::more);
return 0;
diff --git a/src/xpub.cpp b/src/xpub.cpp
index f4fe7a1..7e4eecc 100644
--- a/src/xpub.cpp
+++ b/src/xpub.cpp
@@ -100,7 +100,8 @@ void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, void *arg_)
int zmq::xpub_t::xsend (msg_t *msg_, int flags_)
{
- bool msg_more = msg_->flags () & (msg_t::more | msg_t::label);
+ bool msg_more =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
// For the first part of multi-part message, find the matching pipes.
if (!more)
diff --git a/src/xrep.cpp b/src/xrep.cpp
index fe9ab52..5d111f8 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -163,7 +163,7 @@ int zmq::xrep_t::xsend (msg_t *msg_, int flags_)
}
// Check whether this is the last part of the message.
- more_out = msg_->flags () & (msg_t::more | msg_t::label);
+ more_out = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
// Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) {
@@ -192,7 +192,7 @@ int zmq::xrep_t::xrecv (msg_t *msg_, int flags_)
if (prefetched) {
int rc = msg_->move (prefetched_msg);
errno_assert (rc == 0);
- more_in = msg_->flags () & (msg_t::more | msg_t::label);
+ more_in = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
prefetched = false;
return 0;
}
@@ -205,7 +205,7 @@ int zmq::xrep_t::xrecv (msg_t *msg_, int flags_)
// 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 | msg_t::label);
+ more_in = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
return 0;
}
diff --git a/src/xsub.cpp b/src/xsub.cpp
index bfe12a3..98abc87 100644
--- a/src/xsub.cpp
+++ b/src/xsub.cpp
@@ -116,7 +116,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_, int flags_)
int rc = msg_->move (message);
errno_assert (rc == 0);
has_message = false;
- more = msg_->flags () & (msg_t::more | msg_t::label);
+ more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
return 0;
}
@@ -136,7 +136,8 @@ int zmq::xsub_t::xrecv (msg_t *msg_, int flags_)
// 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 | msg_t::label);
+ more =
+ msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
return 0;
}