]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed increment operators from postfix to prefix form.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 20 Jul 2012 12:44:39 +0000 (14:44 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 20 Jul 2012 12:44:39 +0000 (14:44 +0200)
14 files changed:
helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc
lib/hash.cc
src/DescriptorSet.cc
src/MemObject.cc
src/String.cc
src/dns_internal.cc
src/esi/Esi.cc
src/format/Quoting.cc
src/gopher.cc
src/icmp/Icmp.cc
src/icmp/Icmp4.cc
src/icmp/Icmp6.cc
tools/purge/copyout.cc
tools/squidclient.cc

index 314bc93f1e8dd36a94e1697363cea32533acb643..0a9fd534a3f1cd96e575cbd4ef7972c0e92849f2 100644 (file)
@@ -681,12 +681,16 @@ build_filter(char *filter, int size, const char *templ, const char *user, const
         case '\\':
             ++templ;
             if (*templ) {
-                *filter++ = *templ++;
+                *filter = *templ;
+                ++filter;
+                ++templ;
                 --size;
             }
             break;
         default:
-            *filter++ = *templ++;
+            *filter = *templ;
+            ++filter;
+            ++templ;
             --size;
             break;
         }
index b3d3061d7d1a15b3965d34b769d6f2911ffdd923..f0e4980c8cce06f891636b3e5b061c0aa8807574 100644 (file)
@@ -72,7 +72,8 @@ hash_string(const void *data, unsigned int size)
     unsigned int i = 0;
     while (*s) {
         ++j;
-        n ^= 271 * (*s++);
+        n ^= 271 * *s;
+        ++s;
     }
     i = n ^ (j * 271);
     return i % size;
index 18268dc0f2d8e5fa07694943c0b2cfa572c70e4b..12d12b3c6bfb4c4c5252a4240f0c93a88537602d 100644 (file)
@@ -37,7 +37,8 @@ DescriptorSet::add(int fd)
         return false; // already have it
 
     assert(size_ < capacity_); // \todo: replace with Must()
-    const int pos = size_++;
+    const int pos = size_;
+    ++size_;
     index_[fd] = pos;
     descriptors_[pos] = fd;
     return true; // really added
index a544e976a357ce9f8e097de6f015553a211ec3c9..7a2de16e6a0b28838dd6052f353ea996a317c135 100644 (file)
@@ -211,7 +211,8 @@ struct StoreClientStats : public unary_function<store_client, void> {
     StoreClientStats(MemBuf *anEntry):where(anEntry),index(0) {}
 
     void operator()(store_client const &x) {
-        x.dumpStats(where, index++);
+        x.dumpStats(where, index);
+        ++index;
     }
 
     MemBuf *where;
index c4c80eb3a6fc2ef0b41d75652b05a273a28916f2..ca16de82aa7f5e767440a970fb4d69952facc68d 100644 (file)
@@ -416,7 +416,9 @@ strwordtok(char *buf, char **t)
                 goto done;
             }
 
-            *d++ = *p++;
+            *d = *p;
+            ++d;
+            ++p;
             break;
         }
     }
index 5b7d383a864e45259337463c03599babd2d5b053..4e360fb006f14335cc1e9c6a41789374bc6f3750 100644 (file)
@@ -1291,7 +1291,7 @@ idnsRead(int fd, void *data)
         fd_bytes(fd, len, FD_READ);
 
         assert(N);
-        (*N)++;
+        ++(*N);
 
         debugs(78, 3, "idnsRead: FD " << fd << ": received " << len << " bytes from " << from);
 
index 5fa1b68b7e161733eb5e9795c80897c6e759e859..a52d1ea2ec15ac1ecdb6b37bdd812cd04e9b1cee 100644 (file)
@@ -1037,14 +1037,16 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount)
                     assert( xstrncpy(position, "&quot;", sizeof(localbuf) + (position-localbuf)) );
                     position += 6;
                 } else {
-                    *(position++) = ch;
+                    *position = ch;
+                    ++position;
                 }
             }
             position += strlen (position);
             *position++ = '\"';
         }
 
-        *position++ = '>';
+        *position = '>';
+        ++position;
         *position = '\0';
 
         addLiteral (localbuf, position - localbuf);
index 102b168f4aa90af264a464a16cb186c92bdb5ecd..6568941ecd8c080e22f7a85bab60aa508e969c4f 100644 (file)
@@ -46,21 +46,29 @@ username_quote(const char *header)
 
     while ((c = *(const unsigned char *) header++) != '\0') {
         if (c == '\r') {
-            *buf_cursor++ = '\\';
-            *buf_cursor++ = 'r';
+            *buf_cursor = '\\';
+            ++buf_cursor;
+            *buf_cursor = 'r';
+            ++buf_cursor;
         } else if (c == '\n') {
-            *buf_cursor++ = '\\';
-            *buf_cursor++ = 'n';
+            *buf_cursor = '\\';
+            ++buf_cursor;
+            *buf_cursor = 'n';
+            ++buf_cursor;
         } else if (c <= 0x1F
                    || c >= 0x7F
                    || c == '%'
                    || c == ' ') {
-            *buf_cursor++ = '%';
+            *buf_cursor = '%';
+            ++buf_cursor;
             i = c * 2;
-            *buf_cursor++ = c2x[i];
-            *buf_cursor++ = c2x[i + 1];
+            *buf_cursor = c2x[i];
+            ++buf_cursor;
+            *buf_cursor = c2x[i + 1];
+            ++buf_cursor;
         } else {
-            *buf_cursor++ = (char) c;
+            *buf_cursor = (char) c;
+            ++buf_cursor;
         }
     }
 
index b4fac64cab0ad6ae0ab579574b76b84fdb677c55..4f88131a57768dbc317f13b47e20d89719e9630e 100644 (file)
@@ -492,7 +492,8 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
 
         case gopher_ds::HTML_DIR: {
             tline = line;
-            gtype = *tline++;
+            gtype = *tline;
+            ++tline;
             name = tline;
             selector = strchr(tline, TAB);
 
index c6eb62ffea91e7ba2aa277870acc4893b064aede..838319da0a1f98bf1ccd4e9984887a9e28b6104e 100644 (file)
@@ -69,7 +69,8 @@ Icmp::CheckSum(unsigned short *ptr, int size)
     sum = 0;
 
     while (size > 1) {
-        sum += *ptr++;
+        sum += *ptr;
+        ++ptr;
         size -= 2;
     }
 
index e1203ab6ee11331a3aa2df081278fe197f8ca5ad..2aa7a57a098c6d9a8adebb11a0471b26ef1569d3 100644 (file)
@@ -117,7 +117,8 @@ Icmp4::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
     icmp->icmp_code = 0;
     icmp->icmp_cksum = 0;
     icmp->icmp_id = icmp_ident;
-    icmp->icmp_seq = (unsigned short) icmp_pkts_sent++;
+    icmp->icmp_seq = (unsigned short) icmp_pkts_sent;
+    ++icmp_pkts_sent;
 
     // Construct ICMP packet data content
     echo = (icmpEchoData *) (icmp + 1);
index b2d8c1690a62c11a6caf202fcdfdc06da6b3957a..206df2c8961e61db7a39530057dc0669603850ff 100644 (file)
@@ -158,7 +158,8 @@ Icmp6::SendEcho(Ip::Address &to, int opcode, const char *payload, int len)
     icmp->icmp6_code = 0;
     icmp->icmp6_cksum = 0;
     icmp->icmp6_id = icmp_ident;
-    icmp->icmp6_seq = (unsigned short) icmp_pkts_sent++;
+    icmp->icmp6_seq = (unsigned short) icmp_pkts_sent;
+    ++icmp_pkts_sent;
 
     icmp6_pktsize = sizeof(struct icmp6_hdr);
 
index fbd659a70ecfba8ce630970b7f6089fc30b00b3e..4e5da68ab4844508bb6ded5d3d7a2410c52c4807 100644 (file)
@@ -199,7 +199,8 @@ copy_out( size_t filesize, size_t metasize, unsigned debug,
             //    1 ||  0 |  4 |  0 |
             //    2 ||  1 |  4 |  0 |
             //    3 ||  4 |  2 |  0 |
-            state = table[ state ][ xlate(*s++) ];
+            state = table[ state ][ xlate(*s) ];
+            ++s;
         }
 
         if ( state < 4 )
index 05b5cd93dc145d7c0712376619d104588e1ced9d..46205c59bb763cb56542a68f887c69678a86bda1 100644 (file)
@@ -375,7 +375,7 @@ main(int argc, char *argv[])
 #endif
             case 'v':
                 /* undocumented: may increase verb-level by giving more -v's */
-                opt_verbose++;
+                ++opt_verbose;
                 break;
 
             case '?':          /* usage */
@@ -564,7 +564,7 @@ main(int argc, char *argv[])
     }
     loops = ping ? pcount : 1;
 
-    for (i = 0; loops == 0 || i < loops; i++) {
+    for (i = 0; loops == 0 || i < loops; ++i) {
         int fsize = 0;
         struct addrinfo *AI = NULL;