Commit 56bdba59 authored by Martin Sustrik's avatar Martin Sustrik

Fix cppcheck warnings: Prefer prefix ++/-- operators for non-primitive types.

Signed-off-by: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent b262f2fe
...@@ -266,11 +266,11 @@ void zmq::ctx_t::unregister_endpoints (socket_base_t *socket_) ...@@ -266,11 +266,11 @@ void zmq::ctx_t::unregister_endpoints (socket_base_t *socket_)
while (it != endpoints.end ()) { while (it != endpoints.end ()) {
if (it->second.socket == socket_) { if (it->second.socket == socket_) {
endpoints_t::iterator to_erase = it; endpoints_t::iterator to_erase = it;
it++; ++it;
endpoints.erase (to_erase); endpoints.erase (to_erase);
continue; continue;
} }
it++; ++it;
} }
endpoints_sync.unlock (); endpoints_sync.unlock ();
...@@ -327,7 +327,7 @@ void zmq::ctx_t::dezombify () ...@@ -327,7 +327,7 @@ void zmq::ctx_t::dezombify ()
slots [tid] = NULL; slots [tid] = NULL;
} }
else else
it++; ++it;
} }
} }
...@@ -46,7 +46,7 @@ zmq::epoll_t::~epoll_t () ...@@ -46,7 +46,7 @@ zmq::epoll_t::~epoll_t ()
worker.stop (); worker.stop ();
close (epoll_fd); close (epoll_fd);
for (retired_t::iterator it = retired.begin (); it != retired.end (); it ++) for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it)
delete *it; delete *it;
} }
...@@ -162,7 +162,7 @@ void zmq::epoll_t::loop () ...@@ -162,7 +162,7 @@ void zmq::epoll_t::loop ()
// Destroy retired event sources. // Destroy retired event sources.
for (retired_t::iterator it = retired.begin (); it != retired.end (); for (retired_t::iterator it = retired.begin (); it != retired.end ();
it ++) ++it)
delete *it; delete *it;
retired.clear (); retired.clear ();
} }
......
...@@ -177,7 +177,7 @@ void zmq::kqueue_t::loop () ...@@ -177,7 +177,7 @@ void zmq::kqueue_t::loop ()
// Destroy retired event sources. // Destroy retired event sources.
for (retired_t::iterator it = retired.begin (); it != retired.end (); for (retired_t::iterator it = retired.begin (); it != retired.end ();
it ++) ++it)
delete *it; delete *it;
retired.clear (); retired.clear ();
} }
......
...@@ -158,7 +158,7 @@ void zmq::own_t::process_term (int linger_) ...@@ -158,7 +158,7 @@ void zmq::own_t::process_term (int linger_)
zmq_assert (!terminating); zmq_assert (!terminating);
// Send termination request to all owned objects. // Send termination request to all owned objects.
for (owned_t::iterator it = owned.begin (); it != owned.end (); it++) for (owned_t::iterator it = owned.begin (); it != owned.end (); ++it)
send_term (*it, linger_); send_term (*it, linger_);
register_term_acks (owned.size ()); register_term_acks (owned.size ());
owned.clear (); owned.clear ();
......
...@@ -73,7 +73,7 @@ void zmq::pgm_receiver_t::plug (io_thread_t *io_thread_, i_inout *inout_) ...@@ -73,7 +73,7 @@ void zmq::pgm_receiver_t::plug (io_thread_t *io_thread_, i_inout *inout_)
void zmq::pgm_receiver_t::unplug () void zmq::pgm_receiver_t::unplug ()
{ {
// Delete decoders. // Delete decoders.
for (peers_t::iterator it = peers.begin (); it != peers.end (); it++) { for (peers_t::iterator it = peers.begin (); it != peers.end (); ++it) {
if (it->second.decoder != NULL) if (it->second.decoder != NULL)
delete it->second.decoder; delete it->second.decoder;
} }
......
...@@ -54,7 +54,7 @@ void zmq::poller_base_t::add_timer (int timeout_, i_poll_events *sink_, int id_) ...@@ -54,7 +54,7 @@ void zmq::poller_base_t::add_timer (int timeout_, i_poll_events *sink_, int id_)
void zmq::poller_base_t::cancel_timer (i_poll_events *sink_, int id_) void zmq::poller_base_t::cancel_timer (i_poll_events *sink_, int id_)
{ {
// Complexity of this operation is O(n). We assume it is rarely used. // Complexity of this operation is O(n). We assume it is rarely used.
for (timers_t::iterator it = timers.begin (); it != timers.end (); it++) for (timers_t::iterator it = timers.begin (); it != timers.end (); ++it)
if (it->second.sink == sink_ && it->second.id == id_) { if (it->second.sink == sink_ && it->second.id == id_) {
timers.erase (it); timers.erase (it);
return; return;
......
...@@ -83,7 +83,7 @@ void zmq::select_t::rm_fd (handle_t handle_) ...@@ -83,7 +83,7 @@ void zmq::select_t::rm_fd (handle_t handle_)
{ {
// Mark the descriptor as retired. // Mark the descriptor as retired.
fd_set_t::iterator it; fd_set_t::iterator it;
for (it = fds.begin (); it != fds.end (); it ++) for (it = fds.begin (); it != fds.end (); ++it)
if (it->fd == handle_) if (it->fd == handle_)
break; break;
zmq_assert (it != fds.end ()); zmq_assert (it != fds.end ());
...@@ -104,7 +104,7 @@ void zmq::select_t::rm_fd (handle_t handle_) ...@@ -104,7 +104,7 @@ void zmq::select_t::rm_fd (handle_t handle_)
// highest-numbered file descriptor. // highest-numbered file descriptor.
if (handle_ == maxfd) { if (handle_ == maxfd) {
maxfd = retired_fd; maxfd = retired_fd;
for (fd_set_t::iterator it = fds.begin (); it != fds.end (); it ++) for (fd_set_t::iterator it = fds.begin (); it != fds.end (); ++it)
if (it->fd > maxfd) if (it->fd > maxfd)
maxfd = it->fd; maxfd = it->fd;
} }
......
...@@ -87,10 +87,10 @@ void zmq::xrep_t::process_term (int linger_) ...@@ -87,10 +87,10 @@ void zmq::xrep_t::process_term (int linger_)
register_term_acks (inpipes.size () + outpipes.size ()); register_term_acks (inpipes.size () + outpipes.size ());
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end (); for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
it++) ++it)
it->reader->terminate (); it->reader->terminate ();
for (outpipes_t::iterator it = outpipes.begin (); it != outpipes.end (); for (outpipes_t::iterator it = outpipes.begin (); it != outpipes.end ();
it++) ++it)
it->second.writer->terminate (); it->second.writer->terminate ();
socket_base_t::process_term (linger_); socket_base_t::process_term (linger_);
...@@ -99,7 +99,7 @@ void zmq::xrep_t::process_term (int linger_) ...@@ -99,7 +99,7 @@ void zmq::xrep_t::process_term (int linger_)
void zmq::xrep_t::terminated (reader_t *pipe_) void zmq::xrep_t::terminated (reader_t *pipe_)
{ {
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end (); for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
it++) { ++it) {
if (it->reader == pipe_) { if (it->reader == pipe_) {
inpipes.erase (it); inpipes.erase (it);
if (terminating) if (terminating)
...@@ -135,7 +135,7 @@ void zmq::xrep_t::delimited (reader_t *pipe_) ...@@ -135,7 +135,7 @@ void zmq::xrep_t::delimited (reader_t *pipe_)
void zmq::xrep_t::activated (reader_t *pipe_) void zmq::xrep_t::activated (reader_t *pipe_)
{ {
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end (); for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
it++) { ++it) {
if (it->reader == pipe_) { if (it->reader == pipe_) {
zmq_assert (!it->active); zmq_assert (!it->active);
it->active = true; it->active = true;
......
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