Fix MSVC build

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2011-06-23 08:51:48 +02:00
parent d1373792f7
commit 770d0bc77c
14 changed files with 51 additions and 20 deletions

View File

@ -262,6 +262,10 @@
RelativePath="..\..\..\src\ctx.cpp"
>
</File>
<File
RelativePath="..\..\..\src\dealer.cpp"
>
</File>
<File
RelativePath="..\..\..\src\decoder.cpp"
>
@ -378,6 +382,10 @@
RelativePath="..\..\..\src\push.cpp"
>
</File>
<File
RelativePath="..\..\..\src\random.cpp"
>
</File>
<File
RelativePath="..\..\..\src\reaper.cpp"
>
@ -390,6 +398,10 @@
RelativePath="..\..\..\src\req.cpp"
>
</File>
<File
RelativePath="..\..\..\src\router.cpp"
>
</File>
<File
RelativePath="..\..\..\src\select.cpp"
>
@ -516,6 +528,10 @@
RelativePath="..\..\..\src\ctx.hpp"
>
</File>
<File
RelativePath="..\..\..\src\dealer.hpp"
>
</File>
<File
RelativePath="..\..\..\src\decoder.hpp"
>
@ -664,6 +680,10 @@
RelativePath="..\..\..\src\push.hpp"
>
</File>
<File
RelativePath="..\..\..\src\random.hpp"
>
</File>
<File
RelativePath="..\..\..\src\reaper.hpp"
>
@ -676,6 +696,10 @@
RelativePath="..\..\..\src\req.hpp"
>
</File>
<File
RelativePath="..\..\..\src\router.hpp"
>
</File>
<File
RelativePath="..\..\..\src\select.hpp"
>

View File

@ -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_);

View File

@ -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)

View File

@ -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;
}

View File

@ -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++;

View File

@ -19,6 +19,7 @@
*/
#include "random.hpp"
#include "stdint.hpp"
#include "uuid.hpp"
#include "err.hpp"

View File

@ -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_);

View File

@ -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)

View File

@ -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 ())

View File

@ -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;
}

View File

@ -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;

View File

@ -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)

View File

@ -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;
}

View File

@ -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;
}