Commit 58059939 authored by Pieter Hintjens's avatar Pieter Hintjens

Problem: compile warnings on Windows in new radio/dish code

Solution: fix these.
parent e0f02bdf
......@@ -325,7 +325,7 @@ int zmq::dish_session_t::pull_msg (msg_t *msg_)
if (!msg_->is_join () && !msg_->is_leave ())
return rc;
else {
int group_length = strlen (msg_->group ());
int group_length = (int) strlen (msg_->group ());
msg_t command;
int offset;
......
......@@ -184,12 +184,12 @@ int zmq::radio_session_t::push_msg (msg_t *msg_)
// Set the msg type to either JOIN or LEAVE
if (data_size >= 5 && memcmp (command_data, "\4JOIN", 5) == 0) {
group_length = data_size - 5;
group_length = (int) data_size - 5;
group = command_data + 5;
rc = join_leave_msg.init_join ();
}
else if (data_size >= 6 && memcmp (command_data, "\5LEAVE", 6) == 0) {
group_length = data_size - 6;
group_length = (int) data_size - 6;
group = command_data + 6;
rc = join_leave_msg.init_leave ();
}
......@@ -223,7 +223,7 @@ int zmq::radio_session_t::pull_msg (msg_t *msg_)
return rc;
const char *group = pending_msg.group ();
int length = strlen (group);
int length = (int) strlen (group);
// First frame is the group
msg_->init_size (length);
......
......@@ -41,7 +41,6 @@
namespace zmq
{
class udp_address_t
{
public:
......@@ -71,7 +70,6 @@ namespace zmq
const in_addr interface_ip () const;
private:
in_addr multicast;
in_addr iface;
sockaddr_in bind_address;
......
......@@ -38,7 +38,7 @@ zmq::udp_engine_t::~udp_engine_t()
}
}
int zmq::udp_engine_t::init (address_t* address_, bool send_, bool recv_)
int zmq::udp_engine_t::init (address_t *address_, bool send_, bool recv_)
{
zmq_assert (address_);
zmq_assert (send_ || recv_);
......@@ -74,33 +74,31 @@ void zmq::udp_engine_t::plug (io_thread_t* io_thread_, session_base_t *session_)
if (recv_enabled) {
int on = 1;
int rc = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof (on));
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
rc = bind (fd, address->resolved.udp_addr->bind_addr (), address->resolved.udp_addr->bind_addrlen ());
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
rc = bind (fd, address->resolved.udp_addr->bind_addr (),
address->resolved.udp_addr->bind_addrlen ());
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
if (address->resolved.udp_addr->is_mcast ()) {
struct ip_mreq mreq;
mreq.imr_multiaddr = address->resolved.udp_addr->multicast_ip ();
mreq.imr_interface = address->resolved.udp_addr->interface_ip ();
int rc = setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*) &mreq, sizeof (mreq));
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
}
set_pollin (handle);
// Call restart output to drop all join/leave commands
......@@ -147,10 +145,10 @@ void zmq::udp_engine_t::out_event()
errno_assert (rc == 0);
#ifdef ZMQ_HAVE_WINDOWS
rc = sendto(fd, (char*) out_buffer, size, 0,
address->resolved.udp_addr->dest_addr(),
address->resolved.udp_addr->dest_addrlen());
wsa_assert(rc != SOCKET_ERROR);
rc = sendto (fd, (const char *) out_buffer, (int) size, 0,
address->resolved.udp_addr->dest_addr (),
(int) address->resolved.udp_addr->dest_addrlen ());
wsa_assert (rc != SOCKET_ERROR);
#else
rc = sendto (fd, out_buffer, size, 0,
address->resolved.udp_addr->dest_addr (),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment