Commit 62e48f83 authored by Simon Giesecke's avatar Simon Giesecke

Problem: assignment within complex condition

Solution: restructured code, inverted condition
parent fcee4ccd
......@@ -685,7 +685,7 @@ const char *zmq_msg_gets (const zmq_msg_t *msg_, const char *property_)
}
}
// Polling.
// Polling.
#if defined ZMQ_HAVE_POLLER
inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
......@@ -1176,18 +1176,20 @@ void *zmq_poller_new (void)
int zmq_poller_destroy (void **poller_p_)
{
void *poller;
if (!poller_p_ || !(poller = *poller_p_)
|| !((zmq::socket_poller_t *) poller)->check_tag ()) {
errno = EFAULT;
return -1;
}
delete ((zmq::socket_poller_t *) poller);
if (poller_p_) {
zmq::socket_poller_t *const poller =
static_cast<zmq::socket_poller_t *> (*poller_p_);
if (poller && poller->check_tag ()) {
delete poller;
*poller_p_ = NULL;
return 0;
}
}
errno = EFAULT;
return -1;
}
static int check_poller (void *const poller_)
{
if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) {
......
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