]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed some increment/decrement operators from postfix to prefix form.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Jul 2012 19:37:47 +0000 (21:37 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Jul 2012 19:37:47 +0000 (21:37 +0200)
lib/ntlmauth/support_bits.cci
src/Parsing.cc
src/StoreMetaUnpacker.cc
src/SwapDir.cc
src/comm/ModSelectWin32.cc
src/ip/Qos.cci
src/ipc_win32.cc
src/mem.cc
src/pconn.cc
src/snmp_core.cc
tools/purge/purge.cc

index a13c5e9771d2190904825579556a3840b4bdae3d..c59695a8887fbeb6fe30deb3f41d5a1cd4aaf079 100644 (file)
@@ -18,7 +18,7 @@ uc(char *string)
     char *p = string, c;
     while ((c = *p)) {
         *p = xtoupper(c);
-        p++;
+        ++p;
     }
 }
 
@@ -29,7 +29,7 @@ lc(char *string)
     char *p = string, c;
     while ((c = *p)) {
         *p = xtolower(c);
-        p++;
+        ++p;
     }
 }
 
@@ -53,7 +53,7 @@ hex_dump(unsigned char *data, int size)
         char addrstr[10] = {0};
         char hexstr[16 * 3 + 5] = {0};
         char charstr[16 * 1 + 5] = {0};
-        for (n = 1; n <= size; n++) {
+        for (n = 1; n <= size; ++n) {
             if (n % 16 == 1) {
                 /* store address for this line */
                 snprintf(addrstr, sizeof(addrstr), "%.4x", (int) (p - data));
@@ -80,7 +80,7 @@ hex_dump(unsigned char *data, int size)
                 strncat(hexstr, "  ", sizeof(hexstr) - strlen(hexstr) - 1);
                 strncat(charstr, " ", sizeof(charstr) - strlen(charstr) - 1);
             }
-            p++;                /* next byte */
+            ++p;                /* next byte */
         }
 
         if (strlen(hexstr) > 0) {
index 0058ee77a8a7738d9f8f30a242aadcb293c47d1f..47aa61682137a6423d83695dd491dd0039111ed7 100644 (file)
@@ -179,7 +179,8 @@ GetHostWithPort(char *token, Ip::Address *ipa)
         t = strchr(host, ']');
         if (!t)
             return false;
-        *t++ = '\0';
+        *t = '\0';
+        ++t;
         if (*t != ':')
             return false;
         port = xatos(t + 1);
index bd42702fe805ebf1ac2260b399f1b3b0b44858e9..a97edbcf4d9490c436d9c06109bf40a72f03ce18 100644 (file)
@@ -92,7 +92,8 @@ StoreMetaUnpacker::StoreMetaUnpacker (char const *aBuffer, ssize_t aLen, int *an
 void
 StoreMetaUnpacker::getType()
 {
-    type = buf[position++];
+    type = buf[position];
+    ++position;
 }
 
 void
index 867fd7f5f2d18cb94c67d31bb1ac8ec889b6c972..0e20ae5964fb5bfcf9d78bbdab7b5b844d94af0e 100644 (file)
@@ -244,8 +244,10 @@ SwapDir::parseOptions(int isaReconfig)
     while ((name = strtok(NULL, w_space)) != NULL) {
         value = strchr(name, '=');
 
-        if (value)
-            *value++ = '\0';   /* cut on = */
+        if (value) {
+            *value = '\0';     /* cut on = */
+            ++value;
+        }
 
         debugs(3,2, "SwapDir::parseOptions: parsing store option '" << name << "'='" << (value ? value : "") << "'");
 
index 8d30690e88600a381d63421cb2408935e5c3f22a..4d3cf7ebaa3bd285745be5d3992ce1e234e08a9d 100644 (file)
@@ -403,7 +403,7 @@ Comm::DoSelect(int msec)
             register int readfds_handle = readfds.fd_array[j];
             no_bits = 1;
 
-            for ( fd = Biggest_FD; fd; fd-- ) {
+            for ( fd = Biggest_FD; fd; --fd ) {
                 if ( fd_table[fd].win32.handle == readfds_handle ) {
                     if (fd_table[fd].flags.open) {
                         no_bits = 0;
@@ -490,7 +490,7 @@ Comm::DoSelect(int msec)
             register int osfhandle;
             no_bits = 1;
 
-            for ( fd = Biggest_FD; fd; fd-- ) {
+            for ( fd = Biggest_FD; fd; --fd ) {
                 osfhandle = fd_table[fd].win32.handle;
 
                 if (( osfhandle == readfds_handle ) ||
@@ -554,7 +554,7 @@ Comm::DoSelect(int msec)
         for (j = 0; j < (int) errfds.fd_count; ++j) {
             register int errfds_handle = errfds.fd_array[j];
 
-            for ( fd = Biggest_FD; fd; fd-- ) {
+            for ( fd = Biggest_FD; fd; --fd ) {
                 if ( fd_table[fd].win32.handle == errfds_handle )
                     break;
             }
@@ -577,7 +577,7 @@ Comm::DoSelect(int msec)
             register int writefds_handle = writefds.fd_array[j];
             no_bits = 1;
 
-            for ( fd = Biggest_FD; fd; fd-- ) {
+            for ( fd = Biggest_FD; fd; --fd ) {
                 if ( fd_table[fd].win32.handle == writefds_handle ) {
                     if (fd_table[fd].flags.open) {
                         no_bits = 0;
index 7d7c4a9e35edc3793c579d4dd665f9b996538f28..035f8a864eac55361c48c7e26f2cb4b9647403aa 100644 (file)
@@ -49,7 +49,7 @@ Ip::Qos::Config::isAclNfmarkActive() const
 {
     acl_nfmark * nfmarkAcls [] = { nfmarkToServer, nfmarkToClient };
 
-    for (int i=0; i<2; i++) {
+    for (int i=0; i<2; ++i) {
         while (nfmarkAcls[i]) {
             acl_nfmark *l = nfmarkAcls[i];
             if (l->nfmark > 0)
@@ -66,7 +66,7 @@ Ip::Qos::Config::isAclTosActive() const
 {
     acl_tos * tosAcls [] = { tosToServer, tosToClient };
 
-    for (int i=0; i<2; i++) {
+    for (int i=0; i<2; ++i) {
         while (tosAcls[i]) {
             acl_tos *l = tosAcls[i];
             if (l->tos > 0)
index 527fdfddc289fdf481d2d813aee6b5b82da23255..e67322d49ad5d435eb113f327023a763a49d3632 100644 (file)
@@ -566,7 +566,8 @@ ipc_thread_1(void *in_params)
     x = 1;
 
     while (args[x]) {
-        strcat(buf1, args[x++]);
+        strcat(buf1, args[x]);
+        ++x;
         strcat(buf1, " ");
     }
 
index 4cdc9ddb61239f29432a07b6610576dfd20e81e2..ada71546e04ac8c82c4a3f626d5f5fcad43cba55 100644 (file)
@@ -764,10 +764,13 @@ Mem::Report(std::ostream &stream)
         if (!mp_stats.pool)    /* pool destroyed */
             continue;
 
-        if (mp_stats.pool->getMeter().gb_allocated.count > 0)  /* this pool has been used */
-            sortme[npools++] = mp_stats;
-        else
+        if (mp_stats.pool->getMeter().gb_allocated.count > 0) {
+            /* this pool has been used */
+            sortme[npools] = mp_stats;
+            ++npools;
+        } else {
             ++not_used;
+        }
     }
 
     memPoolIterateDone(&iter);
index 326d118d3d299568603e6a6b87e566a8d3a443f1..3cc57a0b21e91d0b21496e273929da959e8e38a2 100644 (file)
@@ -150,7 +150,8 @@ IdleConnList::closeN(size_t n)
         }
         // ensure the last N entries are unset
         while (index < ((size_t)size_)) {
-            theList_[index++] = NULL;
+            theList_[index] = NULL;
+            ++index;
         }
         size_ -= n;
     }
@@ -186,7 +187,8 @@ IdleConnList::push(const Comm::ConnectionPointer &conn)
     if (parent_)
         parent_->noteConnectionAdded();
 
-    theList_[size_++] = conn;
+    theList_[size_] = conn;
+    ++size_;
     AsyncCall::Pointer readCall = commCbCall(5,4, "IdleConnList::Read",
                                   CommIoCbPtrFun(IdleConnList::Read, this));
     comm_read(conn, fakeReadBuf_, sizeof(fakeReadBuf_), readCall);
index 86f7b3010f075b5bb421dec4aea8d3c5afc28555..940b0d0a77696b30a8f05bc72731576754bf30da 100644 (file)
@@ -1160,7 +1160,7 @@ public:
     virtual int match (ACLData<MatchType> * &, ACLFilledChecklist *);
     static ACLSNMPCommunityStrategy *Instance();
     /* Not implemented to prevent copies of the instance. */
-    /* Not private to prevent brain dead g+++ warnings about
+    /* Not private to prevent brain dead g++ warnings about
      * private constructors with no friends */
     ACLSNMPCommunityStrategy(ACLSNMPCommunityStrategy const &);
 
index a23b07bdf2db0580d063d91018f2a45608de2370..f0eecc49b223c5bdbd664200e70d287c7760df47 100644 (file)
@@ -674,8 +674,10 @@ parseCommandline( int argc, char* argv[], REList*& head,
                     }
 
                     // remove trailing line breaks
-                    while ( len > 0 && ( line[len] == '\n' || line[len] == '\r' ) )
-                        line[len--] = '\0';
+                    while ( len > 0 && ( line[len] == '\n' || line[len] == '\r' ) ) {
+                        line[len] = '\0';
+                        --len;
+                    }
 
                     // insert into list of expressions
                     if ( head == 0 ) tail = head = new REList(line,option=='F');