mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 08:46:44 +01:00
Fix cppcheck warnings: Prefer prefix ++/-- operators for non-primitive types.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
b262f2fe9b
commit
56bdba592c
@ -266,11 +266,11 @@ void zmq::ctx_t::unregister_endpoints (socket_base_t *socket_)
|
||||
while (it != endpoints.end ()) {
|
||||
if (it->second.socket == socket_) {
|
||||
endpoints_t::iterator to_erase = it;
|
||||
it++;
|
||||
++it;
|
||||
endpoints.erase (to_erase);
|
||||
continue;
|
||||
}
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
|
||||
endpoints_sync.unlock ();
|
||||
@ -327,7 +327,7 @@ void zmq::ctx_t::dezombify ()
|
||||
slots [tid] = NULL;
|
||||
}
|
||||
else
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ zmq::epoll_t::~epoll_t ()
|
||||
worker.stop ();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ void zmq::epoll_t::loop ()
|
||||
|
||||
// Destroy retired event sources.
|
||||
for (retired_t::iterator it = retired.begin (); it != retired.end ();
|
||||
it ++)
|
||||
++it)
|
||||
delete *it;
|
||||
retired.clear ();
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ void zmq::kqueue_t::loop ()
|
||||
|
||||
// Destroy retired event sources.
|
||||
for (retired_t::iterator it = retired.begin (); it != retired.end ();
|
||||
it ++)
|
||||
++it)
|
||||
delete *it;
|
||||
retired.clear ();
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ void zmq::own_t::process_term (int linger_)
|
||||
zmq_assert (!terminating);
|
||||
|
||||
// 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_);
|
||||
register_term_acks (owned.size ());
|
||||
owned.clear ();
|
||||
|
@ -73,7 +73,7 @@ void zmq::pgm_receiver_t::plug (io_thread_t *io_thread_, i_inout *inout_)
|
||||
void zmq::pgm_receiver_t::unplug ()
|
||||
{
|
||||
// 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)
|
||||
delete it->second.decoder;
|
||||
}
|
||||
|
@ -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_)
|
||||
{
|
||||
// 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_) {
|
||||
timers.erase (it);
|
||||
return;
|
||||
|
@ -83,7 +83,7 @@ void zmq::select_t::rm_fd (handle_t handle_)
|
||||
{
|
||||
// Mark the descriptor as retired.
|
||||
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_)
|
||||
break;
|
||||
zmq_assert (it != fds.end ());
|
||||
@ -104,7 +104,7 @@ void zmq::select_t::rm_fd (handle_t handle_)
|
||||
// highest-numbered file descriptor.
|
||||
if (handle_ == maxfd) {
|
||||
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)
|
||||
maxfd = it->fd;
|
||||
}
|
||||
|
@ -87,10 +87,10 @@ void zmq::xrep_t::process_term (int linger_)
|
||||
register_term_acks (inpipes.size () + outpipes.size ());
|
||||
|
||||
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
|
||||
it++)
|
||||
++it)
|
||||
it->reader->terminate ();
|
||||
for (outpipes_t::iterator it = outpipes.begin (); it != outpipes.end ();
|
||||
it++)
|
||||
++it)
|
||||
it->second.writer->terminate ();
|
||||
|
||||
socket_base_t::process_term (linger_);
|
||||
@ -99,7 +99,7 @@ void zmq::xrep_t::process_term (int linger_)
|
||||
void zmq::xrep_t::terminated (reader_t *pipe_)
|
||||
{
|
||||
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
|
||||
it++) {
|
||||
++it) {
|
||||
if (it->reader == pipe_) {
|
||||
inpipes.erase (it);
|
||||
if (terminating)
|
||||
@ -135,7 +135,7 @@ void zmq::xrep_t::delimited (reader_t *pipe_)
|
||||
void zmq::xrep_t::activated (reader_t *pipe_)
|
||||
{
|
||||
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
|
||||
it++) {
|
||||
++it) {
|
||||
if (it->reader == pipe_) {
|
||||
zmq_assert (!it->active);
|
||||
it->active = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user