------------------------------------------------------------ revno: 12193 revision-id: kinkie@squid-cache.org-20120702123713-swr344qxk9ab07my parent: kinkie@squid-cache.org-20120702122810-6jhnwnxtfyx8sh3z committer: Francesco Chemolli branch nick: trunk timestamp: Mon 2012-07-02 14:37:13 +0200 message: Change increment and decrement operators from postfix to prefix form. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20120702123713-swr344qxk9ab07my # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 92ef941a0336e27ea318fe224e94bcb1915c1109 # timestamp: 2012-07-02 12:52:36 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: kinkie@squid-cache.org-20120702122810-\ # 6jhnwnxtfyx8sh3z # # Begin patch === modified file 'src/comm/AcceptLimiter.cc' --- src/comm/AcceptLimiter.cc 2012-01-20 18:55:04 +0000 +++ src/comm/AcceptLimiter.cc 2012-07-02 12:37:13 +0000 @@ -14,7 +14,7 @@ void Comm::AcceptLimiter::defer(Comm::TcpAcceptor *afd) { - afd->isLimited++; + ++afd->isLimited; debugs(5, 5, HERE << afd->conn << " x" << afd->isLimited); deferred.push_back(afd); } @@ -22,7 +22,7 @@ void Comm::AcceptLimiter::removeDead(const Comm::TcpAcceptor *afd) { - for (unsigned int i = 0; i < deferred.size() && afd->isLimited > 0; i++) { + for (unsigned int i = 0; i < deferred.size() && afd->isLimited > 0; ++i) { if (deferred[i] == afd) { deferred[i]->isLimited--; deferred[i] = NULL; // fast. kick() will skip empty entries later. === modified file 'src/comm/IoCallback.cc' --- src/comm/IoCallback.cc 2012-01-20 18:55:04 +0000 +++ src/comm/IoCallback.cc 2012-07-02 12:37:13 +0000 @@ -14,7 +14,7 @@ { // XXX: convert this to a std::map<> ? iocb_table = static_cast(xcalloc(Squid_MaxFD, sizeof(CbEntry))); - for (int pos = 0; pos < Squid_MaxFD; pos++) { + for (int pos = 0; pos < Squid_MaxFD; ++pos) { iocb_table[pos].fd = pos; iocb_table[pos].readcb.type = IOCB_READ; iocb_table[pos].writecb.type = IOCB_WRITE; @@ -25,7 +25,7 @@ Comm::CallbackTableDestruct() { // release any Comm::Connections being held. - for (int pos = 0; pos < Squid_MaxFD; pos++) { + for (int pos = 0; pos < Squid_MaxFD; ++pos) { iocb_table[pos].readcb.conn = NULL; iocb_table[pos].writecb.conn = NULL; } === modified file 'src/comm/ModDevPoll.cc' --- src/comm/ModDevPoll.cc 2012-01-20 18:55:04 +0000 +++ src/comm/ModDevPoll.cc 2012-07-02 12:37:13 +0000 @@ -165,7 +165,7 @@ comm_flush_updates(); /* Push new event onto array */ - devpoll_update.cur++; + ++devpoll_update.cur; devpoll_update.pfds[devpoll_update.cur].fd = fd; devpoll_update.pfds[devpoll_update.cur].events = events; devpoll_update.pfds[devpoll_update.cur].revents = 0; @@ -385,7 +385,7 @@ PROF_start(comm_handle_ready_fd); - for (i = 0; i < num; i++) { + for (i = 0; i < num; ++i) { int fd = (int)do_poll.dp_fds[i].fd; F = &fd_table[fd]; debugs( @@ -421,7 +421,7 @@ F->read_handler = NULL; hdl(fd, F->read_data); PROF_stop(comm_read_handler); - statCounter.select_fds++; + ++statCounter.select_fds; } else { debugs( 5, @@ -445,7 +445,7 @@ F->write_handler = NULL; hdl(fd, F->write_data); PROF_stop(comm_write_handler); - statCounter.select_fds++; + ++statCounter.select_fds; } else { debugs( 5, === modified file 'src/comm/ModEpoll.cc' --- src/comm/ModEpoll.cc 2012-01-20 18:55:04 +0000 +++ src/comm/ModEpoll.cc 2012-07-02 12:37:13 +0000 @@ -283,7 +283,7 @@ PROF_start(comm_handle_ready_fd); - for (i = 0, cevents = pevents; i < num; i++, cevents++) { + for (i = 0, cevents = pevents; i < num; ++i, ++cevents) { fd = cevents->data.fd; F = &fd_table[fd]; debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "got FD " << fd << " events=" << @@ -300,7 +300,7 @@ F->read_handler = NULL; hdl(fd, F->read_data); PROF_stop(comm_write_handler); - statCounter.select_fds++; + ++statCounter.select_fds; } else { debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no read handler for FD " << fd); // remove interest since no handler exist for this event. @@ -315,7 +315,7 @@ F->write_handler = NULL; hdl(fd, F->write_data); PROF_stop(comm_read_handler); - statCounter.select_fds++; + ++statCounter.select_fds; } else { debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no write handler for FD " << fd); // remove interest since no handler exist for this event. === modified file 'src/comm/ModKqueue.cc' --- src/comm/ModKqueue.cc 2012-03-07 12:37:54 +0000 +++ src/comm/ModKqueue.cc 2012-07-02 12:37:13 +0000 @@ -148,7 +148,7 @@ kqoff = 0; } else { - kqoff++; + ++kqoff; } } } @@ -282,7 +282,7 @@ if (num == 0) return COMM_OK; /* No error.. */ - for (i = 0; i < num; i++) { + for (i = 0; i < num; ++i) { int fd = (int) ke[i].ident; PF *hdl = NULL; fde *F = &fd_table[fd]; === modified file 'src/comm/ModPoll.cc' --- src/comm/ModPoll.cc 2012-04-26 01:04:17 +0000 +++ src/comm/ModPoll.cc 2012-07-02 12:37:13 +0000 @@ -231,7 +231,7 @@ pfds[npfds].fd = fd; pfds[npfds].events = events; pfds[npfds].revents = 0; - npfds++; + ++npfds; } } @@ -241,14 +241,14 @@ } getCurrentTime(); - statCounter.syscalls.selects++; + ++statCounter.syscalls.selects; if (poll(pfds, npfds, 0) < 1) { PROF_stop(comm_check_incoming); return incoming_sockets_accepted; } - for (i = 0; i < npfds; i++) { + for (i = 0; i < npfds; ++i) { int revents; if (((revents = pfds[i].revents) == 0) || ((fd = pfds[i].fd) == -1)) @@ -396,10 +396,10 @@ pfds[nfds].fd = i; pfds[nfds].events = events; pfds[nfds].revents = 0; - nfds++; + ++nfds; if ((events & POLLRDNORM) && fd_table[i].flags.read_pending) - npending++; + ++npending; } } @@ -498,7 +498,7 @@ F->flags.read_pending = 0; hdl(fd, F->read_data); PROF_stop(comm_read_handler); - statCounter.select_fds++; + ++statCounter.select_fds; if (commCheckUdpIncoming) comm_poll_udp_incoming(); @@ -519,7 +519,7 @@ F->write_handler = NULL; hdl(fd, F->write_data); PROF_stop(comm_write_handler); - statCounter.select_fds++; + ++statCounter.select_fds; if (commCheckUdpIncoming) comm_poll_udp_incoming(); === modified file 'src/comm/ModSelect.cc' --- src/comm/ModSelect.cc 2012-04-25 05:29:20 +0000 +++ src/comm/ModSelect.cc 2012-07-02 12:37:13 +0000 @@ -238,12 +238,12 @@ getCurrentTime(); - statCounter.syscalls.selects++; + ++statCounter.syscalls.selects; if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) < 1) return incoming_sockets_accepted; - for (i = 0; i < nfds; i++) { + for (i = 0; i < nfds; ++i) { fd = fds[i]; if (FD_ISSET(fd, &read_mask)) { === modified file 'tools/purge/purge.cc' --- tools/purge/purge.cc 2012-01-20 18:55:04 +0000 +++ tools/purge/purge.cc 2012-07-02 12:37:13 +0000 @@ -267,7 +267,7 @@ if ( meta && (findings = meta->search( STORE_META_KEY_MD5 )) ) { unsigned char* s = (unsigned char*) findings->data; - for ( int j=0; j<16; j++, s++ ) { + for ( int j=0; j<16; ++j, ++s ) { md5[j*2+0] = hexdigit[ *s >> 4 ]; md5[j*2+1] = hexdigit[ *s & 15 ]; }