Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant static_cast<void*> in examples. #859

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/C++/asyncsrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class client_task {
client_socket_.connect("tcp://localhost:5570");

zmq::pollitem_t items[] = {
{ static_cast<void*>(client_socket_), 0, ZMQ_POLLIN, 0 } };
{ client_socket_, 0, ZMQ_POLLIN, 0 } };
int request_nbr = 0;
try {
while (true) {
Expand Down
6 changes: 3 additions & 3 deletions examples/C++/lbbroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ int main(int argc, char *argv[])

// Initialize poll set
zmq::pollitem_t items[] = {
// Always poll for worker activity on backend
{ static_cast<void*>(backend), 0, ZMQ_POLLIN, 0 },
// Always poll for worker activity on backend
{ backend, 0, ZMQ_POLLIN, 0 },
// Poll front-end only if we have available workers
{ static_cast<void*>(frontend), 0, ZMQ_POLLIN, 0 }
{ frontend, 0, ZMQ_POLLIN, 0 }
};
if (worker_queue.size())
zmq::poll(&items[0], 2, -1);
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/lpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main () {
while (expect_reply) {
// Poll socket for a reply, with timeout
zmq::pollitem_t items[] = {
{ static_cast<void*>(*client), 0, ZMQ_POLLIN, 0 } };
{ *client, 0, ZMQ_POLLIN, 0 } };
zmq::poll (&items[0], 1, REQUEST_TIMEOUT);

// If we got a reply, process it
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/mdbroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class broker {
int64_t heartbeat_at = now + HEARTBEAT_INTERVAL;
while (!s_interrupted) {
zmq::pollitem_t items [] = {
{ static_cast<void*>(*m_socket), 0, ZMQ_POLLIN, 0} };
{ *m_socket, 0, ZMQ_POLLIN, 0} };
int64_t timeout = heartbeat_at - now;
if (timeout < 0)
timeout = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/mdcliapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class mdcli {
while (!s_interrupted) {
// Poll socket for a reply, with timeout
zmq::pollitem_t items [] = {
{ static_cast<void*>(*m_client), 0, ZMQ_POLLIN, 0 } };
{ *m_client, 0, ZMQ_POLLIN, 0 } };
zmq::poll (items, 1, m_timeout);

// If we got a reply, process it
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/mdcliapi2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class mdcli {
{
// Poll socket for a reply, with timeout
zmq::pollitem_t items[] = {
{ static_cast<void*>(*m_client), 0, ZMQ_POLLIN, 0 } };
{ *m_client, 0, ZMQ_POLLIN, 0 } };
zmq::poll (items, 1, m_timeout);

// If we got a reply, process it
Expand Down
2 changes: 1 addition & 1 deletion examples/C++/mdwrkapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class mdwrk {

while (!s_interrupted) {
zmq::pollitem_t items[] = {
{ static_cast<void*>(*m_worker), 0, ZMQ_POLLIN, 0 } };
{ *m_worker, 0, ZMQ_POLLIN, 0 } };
zmq::poll (items, 1, m_heartbeat);

if (items[0].revents & ZMQ_POLLIN) {
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/mspoller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ int main (int argc, char *argv[])

// Initialize poll set
zmq::pollitem_t items [] = {
{ static_cast<void*>(receiver), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(subscriber), 0, ZMQ_POLLIN, 0 }
{ receiver, 0, ZMQ_POLLIN, 0 },
{ subscriber, 0, ZMQ_POLLIN, 0 }
};
// Process messages from both sockets
while (1) {
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/ppqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ int main (void)

while (1) {
zmq::pollitem_t items [] = {
{ static_cast<void*>(backend), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(frontend), 0, ZMQ_POLLIN, 0 }
{ backend, 0, ZMQ_POLLIN, 0 },
{ frontend, 0, ZMQ_POLLIN, 0 }
};
// Poll frontend only if we have available workers
if (queue.size()) {
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/rrbroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ int main (int argc, char *argv[])

// Initialize poll set
zmq::pollitem_t items [] = {
{ static_cast<void*>(frontend), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(backend), 0, ZMQ_POLLIN, 0 }
{ frontend, 0, ZMQ_POLLIN, 0 },
{ backend, 0, ZMQ_POLLIN, 0 }
};

// Switch messages between sockets
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/spqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ int main (void)

while (1) {
zmq::pollitem_t items [] = {
{ static_cast<void*>(backend), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(frontend), 0, ZMQ_POLLIN, 0 }
{ backend, 0, ZMQ_POLLIN, 0 },
{ frontend, 0, ZMQ_POLLIN, 0 }
};
// Poll frontend only if we have available workers
if (worker_queue.size())
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/taskwork2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ int main (int argc, char *argv[])

// Process messages from receiver and controller
zmq::pollitem_t items [] = {
{ static_cast<void*>(receiver), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(controller), 0, ZMQ_POLLIN, 0 }
{ receiver, 0, ZMQ_POLLIN, 0 },
{ controller, 0, ZMQ_POLLIN, 0 }
};
// Process messages from both sockets
while (1) {
Expand Down
4 changes: 2 additions & 2 deletions examples/C++/tripping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ broker_task (void *args)

// Initialize poll set
zmq::pollitem_t items [] = {
{ static_cast<void*>(frontend), 0, ZMQ_POLLIN, 0 },
{ static_cast<void*>(backend), 0, ZMQ_POLLIN, 0 }
{ frontend, 0, ZMQ_POLLIN, 0 },
{ backend, 0, ZMQ_POLLIN, 0 }
};
while (1) {
zmq::poll (items, 2, -1);
Expand Down