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" RelativePath="..\..\..\src\ctx.cpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\dealer.cpp"
>
</File>
<File <File
RelativePath="..\..\..\src\decoder.cpp" RelativePath="..\..\..\src\decoder.cpp"
> >
@ -378,6 +382,10 @@
RelativePath="..\..\..\src\push.cpp" RelativePath="..\..\..\src\push.cpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\random.cpp"
>
</File>
<File <File
RelativePath="..\..\..\src\reaper.cpp" RelativePath="..\..\..\src\reaper.cpp"
> >
@ -390,6 +398,10 @@
RelativePath="..\..\..\src\req.cpp" RelativePath="..\..\..\src\req.cpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\router.cpp"
>
</File>
<File <File
RelativePath="..\..\..\src\select.cpp" RelativePath="..\..\..\src\select.cpp"
> >
@ -516,6 +528,10 @@
RelativePath="..\..\..\src\ctx.hpp" RelativePath="..\..\..\src\ctx.hpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\dealer.hpp"
>
</File>
<File <File
RelativePath="..\..\..\src\decoder.hpp" RelativePath="..\..\..\src\decoder.hpp"
> >
@ -664,6 +680,10 @@
RelativePath="..\..\..\src\push.hpp" RelativePath="..\..\..\src\push.hpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\random.hpp"
>
</File>
<File <File
RelativePath="..\..\..\src\reaper.hpp" RelativePath="..\..\..\src\reaper.hpp"
> >
@ -676,6 +696,10 @@
RelativePath="..\..\..\src\req.hpp" RelativePath="..\..\..\src\req.hpp"
> >
</File> </File>
<File
RelativePath="..\..\..\src\router.hpp"
>
</File>
<File <File
RelativePath="..\..\..\src\select.hpp" 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_) int zmq::dist_t::send_to_matching (msg_t *msg_, int flags_)
{ {
// Is this end of a multipart message? // 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. // Push the message to matching pipes.
distribute (msg_, flags_); 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 (fetched) {
if (pipe_) if (pipe_)
*pipe_ = pipes [current]; *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) { if (!more) {
current++; current++;
if (current >= active) 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. // switch back to non-dropping mode.
if (dropping) { if (dropping) {
more = msg_->flags () & (msg_t::more | msg_t::label); more = msg_->flags () & (msg_t::more | msg_t::label) ? true : false;
if (!more) if (!more)
dropping = false; dropping = false;
@ -88,7 +88,8 @@ int zmq::lb_t::send (msg_t *msg_, int flags_)
while (active > 0) { while (active > 0) {
if (pipes [current]->write (msg_)) { 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; break;
} }

View File

@ -165,7 +165,7 @@ bool zmq::pipe_t::write (msg_t *msg_)
if (unlikely (!check_write (msg_))) if (unlikely (!check_write (msg_)))
return false; 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); outpipe->write (*msg_, more);
if (!more) if (!more)
msgs_written++; msgs_written++;

View File

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

View File

@ -42,7 +42,7 @@ int zmq::rep_t::xsend (msg_t *msg_, int flags_)
return -1; 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. // Push message to the reply pipe.
int rc = xrep_t::xsend (msg_, flags_); 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; 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_); int rc = xreq_t::xsend (msg_, flags_);
if (rc != 0) 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. // 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. // Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) { if (current_out) {
@ -188,7 +188,7 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
if (prefetched) { if (prefetched) {
int rc = msg_->move (prefetched_msg); int rc = msg_->move (prefetched_msg);
errno_assert (rc == 0); 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; prefetched = false;
return 0; return 0;
} }
@ -202,7 +202,7 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
zmq_assert (inpipes [current_in].active); zmq_assert (inpipes [current_in].active);
bool fetched = inpipes [current_in].pipe->read (msg_); bool fetched = inpipes [current_in].pipe->read (msg_);
zmq_assert (fetched); 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) { if (!more_in) {
current_in++; current_in++;
if (current_in >= inpipes.size ()) if (current_in >= inpipes.size ())

View File

@ -71,7 +71,8 @@ bool zmq::session_t::read (msg_t *msg_)
if (!pipe->read (msg_)) if (!pipe->read (msg_))
return false; 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; 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; rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel) if (rcvlabel)
msg_->reset_flags (msg_t::label); msg_->reset_flags (msg_t::label);
rcvmore = msg_->flags () & msg_t::more; rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore) if (rcvmore)
msg_->reset_flags (msg_t::more); msg_->reset_flags (msg_t::more);
return 0; return 0;
@ -603,7 +603,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
rcvlabel = msg_->flags () & msg_t::label; rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel) if (rcvlabel)
msg_->reset_flags (msg_t::label); msg_->reset_flags (msg_t::label);
rcvmore = msg_->flags () & msg_t::more; rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore) if (rcvmore)
msg_->reset_flags (msg_t::more); msg_->reset_flags (msg_t::more);
return 0; return 0;
@ -642,7 +642,7 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
rcvlabel = msg_->flags () & msg_t::label; rcvlabel = msg_->flags () & msg_t::label;
if (rcvlabel) if (rcvlabel)
msg_->reset_flags (msg_t::label); msg_->reset_flags (msg_t::label);
rcvmore = msg_->flags () & msg_t::more; rcvmore = msg_->flags () & msg_t::more ? true : false;
if (rcvmore) if (rcvmore)
msg_->reset_flags (msg_t::more); msg_->reset_flags (msg_t::more);
return 0; 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_) 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. // For the first part of multi-part message, find the matching pipes.
if (!more) 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. // 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. // Push the message into the pipe. If there's no out pipe, just drop it.
if (current_out) { if (current_out) {
@ -192,7 +192,7 @@ int zmq::xrep_t::xrecv (msg_t *msg_, int flags_)
if (prefetched) { if (prefetched) {
int rc = msg_->move (prefetched_msg); int rc = msg_->move (prefetched_msg);
errno_assert (rc == 0); 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; prefetched = false;
return 0; 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 we are in the middle of reading a message, just return the next part.
if (more_in) { 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; return 0;
} }

View File

@ -116,7 +116,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_, int flags_)
int rc = msg_->move (message); int rc = msg_->move (message);
errno_assert (rc == 0); errno_assert (rc == 0);
has_message = false; 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; 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. // Check whether the message matches at least one subscription.
// Non-initial parts of the message are passed // Non-initial parts of the message are passed
if (more || !options.filter || match (msg_)) { 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; return 0;
} }