]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed increment operators from postfix to prefix form.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 13 Jul 2012 10:48:12 +0000 (12:48 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 13 Jul 2012 10:48:12 +0000 (12:48 +0200)
24 files changed:
src/CacheDigest.cc
src/cache_cf.cc
src/cache_diff.cc
src/carp.cc
src/cbdata.cc
src/ip/Address.cc
src/ipc/Kid.cc
src/log/File.cc
src/log/ModDaemon.cc
src/log/access_log.cc
src/repl/lru/store_repl_lru.cc
src/snmp/Pdu.cc
src/ssl/ErrorDetail.cc
src/ssl/ErrorDetailManager.cc
src/ssl/certificate_db.cc
src/ssl/context_storage.cc
src/ssl/crtd_message.cc
src/ssl/ssl_crtd.cc
src/ssl/support.cc
src/tests/stub_cache_cf.cc
src/tests/testAuth.cc
src/tests/testEvent.cc
src/tests/testStoreController.cc
src/tests/testStoreHashIndex.cc

index b2f2cdb9716efab0ecc5aa5a7f01d8d779272cf1..9c7ed7e99cc2a1151086ff2869b1c47fbffcd0da 100644 (file)
@@ -159,35 +159,35 @@ cacheDigestAdd(CacheDigest * cd, const cache_key * key)
 
         if (!CBIT_TEST(cd->mask, hashed_keys[0])) {
             CBIT_SET(cd->mask, hashed_keys[0]);
-            on_xition_cnt++;
+            ++on_xition_cnt;
         }
 
         if (!CBIT_TEST(cd->mask, hashed_keys[1])) {
             CBIT_SET(cd->mask, hashed_keys[1]);
-            on_xition_cnt++;
+            ++on_xition_cnt;
         }
 
         if (!CBIT_TEST(cd->mask, hashed_keys[2])) {
             CBIT_SET(cd->mask, hashed_keys[2]);
-            on_xition_cnt++;
+            ++on_xition_cnt;
         }
 
         if (!CBIT_TEST(cd->mask, hashed_keys[3])) {
             CBIT_SET(cd->mask, hashed_keys[3]);
-            on_xition_cnt++;
+            ++on_xition_cnt;
         }
 
         statCounter.cd.on_xition_count.count(on_xition_cnt);
     }
 #endif
-    cd->count++;
+    ++ cd->count;
 }
 
 void
 cacheDigestDel(CacheDigest * cd, const cache_key * key)
 {
     assert(cd && key);
-    cd->del_count++;
+    ++ cd->del_count;
     /* we do not support deletions from the digest */
 }
 
@@ -208,16 +208,16 @@ cacheDigestStats(const CacheDigest * cd, CacheDigestStats * stats)
         const int is_on = 0 != CBIT_TEST(cd->mask, pos);
 
         if (is_on)
-            on_count++;
+            ++on_count;
 
         if (is_on != cur_seq_type || !pos) {
             seq_len_sum += cur_seq_len;
-            seq_count++;
+            ++seq_count;
             cur_seq_type = is_on;
             cur_seq_len = 0;
         }
 
-        cur_seq_len++;
+        ++cur_seq_len;
     }
 
     stats->bit_count = cd->mask_size * 8;
index 46368704086b916ed3a945028da4e3da903bf264..101add43f7f9419d10916d3d96d94365ee19ca8a 100644 (file)
@@ -225,7 +225,7 @@ update_maxobjsize(void)
     int i;
     int64_t ms = -1;
 
-    for (i = 0; i < Config.cacheSwap.n_configured; i++) {
+    for (i = 0; i < Config.cacheSwap.n_configured; ++i) {
         assert (Config.cacheSwap.swapDirs[i].getRaw());
 
         if (dynamic_cast<SwapDir *>(Config.cacheSwap.swapDirs[i].getRaw())->
@@ -273,7 +273,7 @@ parseManyConfigFiles(char* files, int depth)
                    path, xstrerror());
         }
     }
-    for (i = 0; i < (int)globbuf.gl_pathc; i++) {
+    for (i = 0; i < (int)globbuf.gl_pathc; ++i) {
         error_count += parseOneConfigFile(globbuf.gl_pathv[i], depth);
     }
     globfree(&globbuf);
@@ -431,7 +431,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
 
     Vector<bool> if_states;
     while (fgets(config_input_line, BUFSIZ, fp)) {
-        config_lineno++;
+        ++config_lineno;
 
         if ((token = strchr(config_input_line, '\n')))
             *token = '\0';
@@ -455,7 +455,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
                 continue;      /* Not a valid #line directive, may be a comment */
 
             while (*file && xisspace((unsigned char) *file))
-                file++;
+                ++file;
 
             if (*file) {
                 if (*file != '"')
@@ -516,7 +516,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
                 err_count += parseManyConfigFiles(tmp_line + 8, depth + 1);
             } else if (!parse_line(tmp_line)) {
                 debugs(3, 0, HERE << cfg_filename << ":" << config_lineno << " unrecognized: '" << tmp_line << "'");
-                err_count++;
+                ++err_count;
             }
         }
 
@@ -1176,7 +1176,7 @@ static void parseBytesOptionValue(size_t * bptr, const char *units, char const *
     char const * number_end = value;
 
     while ((*number_end >= '0' && *number_end <= '9')) {
-        number_end++;
+        ++number_end;
     }
 
     String number;
@@ -1679,7 +1679,7 @@ dump_http_header_access(StoreEntry * entry, const char *name, header_mangler hea
 {
     int i;
 
-    for (i = 0; i < HDR_ENUM_END; i++) {
+    for (i = 0; i < HDR_ENUM_END; ++i) {
         if (header[i].access_list != NULL) {
             storeAppendPrintf(entry, "%s ", name);
             dump_acl_access(entry, httpHeaderNameById(i),
@@ -1720,7 +1720,7 @@ parse_http_header_access(header_mangler header[])
         *next_string = 'A';
         *(next_string + 1) = ' ';
 
-        for (i = 0; i < HDR_ENUM_END; i++) {
+        for (i = 0; i < HDR_ENUM_END; ++i) {
             char *new_string = xstrdup(next_string);
             strtok(new_string, w_space);
             parse_acl_access(&header[i].access_list);
@@ -1734,7 +1734,7 @@ free_http_header_access(header_mangler header[])
 {
     int i;
 
-    for (i = 0; i < HDR_ENUM_END; i++) {
+    for (i = 0; i < HDR_ENUM_END; ++i) {
         free_acl_access(&header[i].access_list);
     }
 }
@@ -1745,7 +1745,7 @@ dump_http_header_replace(StoreEntry * entry, const char *name, header_mangler
 {
     int i;
 
-    for (i = 0; i < HDR_ENUM_END; i++) {
+    for (i = 0; i < HDR_ENUM_END; ++i) {
         if (NULL == header[i].replacement)
             continue;
 
@@ -1786,7 +1786,7 @@ parse_http_header_replace(header_mangler header[])
 
         header[id].replacement = xstrdup(t + strlen(t) + 1);
     } else {
-        for (i = 0; i < HDR_ENUM_END; i++) {
+        for (i = 0; i < HDR_ENUM_END; ++i) {
             if (header[i].replacement != NULL)
                 safe_free(header[i].replacement);
 
@@ -1800,7 +1800,7 @@ free_http_header_replace(header_mangler header[])
 {
     int i;
 
-    for (i = 0; i < HDR_ENUM_END; i++) {
+    for (i = 0; i < HDR_ENUM_END; ++i) {
         if (header[i].replacement != NULL)
             safe_free(header[i].replacement);
     }
@@ -1815,7 +1815,7 @@ dump_cachedir(StoreEntry * entry, const char *name, SquidConfig::_cacheSwap swap
     int i;
     assert (entry);
 
-    for (i = 0; i < swap.n_configured; i++) {
+    for (i = 0; i < swap.n_configured; ++i) {
         s = dynamic_cast<SwapDir *>(swap.swapDirs[i].getRaw());
         if (!s) continue;
         storeAppendPrintf(entry, "%s %s %s", name, s->type(), s->path);
@@ -1924,7 +1924,7 @@ parse_cachedir(SquidConfig::_cacheSwap * swap)
 
     /* reconfigure existing dir */
 
-    for (i = 0; i < swap->n_configured; i++) {
+    for (i = 0; i < swap->n_configured; ++i) {
         assert (swap->swapDirs[i].getRaw());
 
         if ((strcasecmp(path_str, dynamic_cast<SwapDir *>(swap->swapDirs[i].getRaw())->path)) == 0) {
@@ -2555,7 +2555,7 @@ parse_hostdomain(void)
 
         if (*domain == '!') {  /* check for !.edu */
             l->do_ping = 0;
-            domain++;
+            ++domain;
         }
 
         l->domain = xstrdup(domain);
@@ -2997,7 +2997,7 @@ parse_eol(char *volatile *var)
     }
 
     while (*token && xisspace(*token))
-        token++;
+        ++token;
 
     if (!*token) {
         self_destruct();
@@ -3695,12 +3695,12 @@ parse_port_option(AnyP::PortCfg * s, char *token)
         s->tcp_keepalive.idle = atoi(t);
         t = strchr(t, ',');
         if (t) {
-            t++;
+            ++t;
             s->tcp_keepalive.interval = atoi(t);
             t = strchr(t, ',');
         }
         if (t) {
-            t++;
+            ++t;
             s->tcp_keepalive.timeout = atoi(t);
             t = strchr(t, ',');
         }
index 7cebc1fa67b8f692d8914a6017d4b8eff043cb6f..8e2636d989afd0a85b5cf0dc20bfc64449fa6411 100644 (file)
@@ -177,8 +177,8 @@ cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file)
     fprintf(stderr, "%s scanning\n", fname);
 
     while (fread(&s, sizeof(s), 1, file) == 1) {
-        count++;
-        idx->scanned_count++;
+        ++count;
+        ++ idx->scanned_count;
         /* if (!s.sane())
          * continue; */
 
@@ -186,17 +186,17 @@ cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file)
             CacheEntry *olde = (CacheEntry *) hash_lookup(idx->hash, s.key);
 
             if (olde) {
-                idx->bad_add_count++;
+                ++ idx->bad_add_count;
             } else {
                 CacheEntry *e = cacheEntryCreate(&s);
                 hash_join(idx->hash, &e->hash);
-                idx->count++;
+                ++ idx->count;
             }
         } else if (s.op == SWAP_LOG_DEL) {
             CacheEntry *olde = (CacheEntry *) hash_lookup(idx->hash, s.key);
 
             if (!olde)
-                idx->bad_del_count++;
+                ++ idx->bad_del_count;
             else {
                 assert(idx->count);
                 hash_remove_link(idx->hash, (hash_link *) olde);
@@ -249,10 +249,10 @@ cacheIndexCmp(CacheIndex * idx1, CacheIndex * idx2)
     hash_first(small_idx->hash);
 
     for (hashr = hash_next(small_idx->hash)) {
-        hashed_count++;
+        ++hashed_count;
 
         if (hash_lookup(large_idx->hash, hashr->key))
-            shared_count++;
+            ++shared_count;
     }
 
     assert(hashed_count == small_idx->count);
@@ -288,7 +288,7 @@ main(int argc, char *argv[])
             return usage(argv[0]);
 
         if (argv[i][len - 1] == ':') {
-            idxCount++;
+            ++idxCount;
 
             if (len < 2 || idxCount > 2)
                 return usage(argv[0]);
index 7918a48e874081c3adbc69711b5d01b1d1513ba3..d0554b56130b0eaafc43911f7252d6c775779dcd 100644 (file)
@@ -72,7 +72,7 @@ carpInit(void)
     char *t;
     /* Clean up */
 
-    for (k = 0; k < n_carp_peers; k++) {
+    for (k = 0; k < n_carp_peers; ++k) {
         cbdataReferenceDone(carp_peers[k]);
     }
 
@@ -93,7 +93,7 @@ carpInit(void)
         if (p->weight == 0)
             continue;
 
-        n_carp_peers++;
+        ++n_carp_peers;
 
         W += p->weight;
     }
@@ -114,7 +114,7 @@ carpInit(void)
         /* calculate this peers hash */
         p->carp.hash = 0;
 
-        for (t = p->name; *t != 0; t++)
+        for (t = p->name; *t != 0; ++t)
             p->carp.hash += ROTATE_LEFT(p->carp.hash, 19) + (unsigned int) *t;
 
         p->carp.hash += p->carp.hash * 0x62531965;
@@ -150,7 +150,7 @@ carpInit(void)
 
     X_last = 0.0;              /* Empty X_0, nullifies the first pow statement */
 
-    for (k = 1; k <= K; k++) {
+    for (k = 1; k <= K; ++k) {
         double Kk1 = (double) (K - k + 1);
         p = carp_peers[k - 1];
         p->carp.load_multiplier = (Kk1 * (p->carp.load_factor - P_last)) / Xn;
@@ -180,7 +180,7 @@ carpSelectParent(HttpRequest * request)
     debugs(39, 2, "carpSelectParent: Calculating hash for " << urlCanonical(request));
 
     /* select peer */
-    for (k = 0; k < n_carp_peers; k++) {
+    for (k = 0; k < n_carp_peers; ++k) {
         String key;
         tp = carp_peers[k];
         if (tp->options.carp_key.set) {
@@ -221,7 +221,7 @@ carpSelectParent(HttpRequest * request)
         if (key.size()==0)
             key=urlCanonical(request);
 
-        for (const char *c = key.rawBuf(), *e=key.rawBuf()+key.size(); c < e; c++)
+        for (const char *c = key.rawBuf(), *e=key.rawBuf()+key.size(); c < e; ++c)
             user_hash += ROTATE_LEFT(user_hash, 19) + *c;
         combined_hash = (user_hash ^ tp->carp.hash);
         combined_hash += combined_hash * 0x62531965;
index 54ee8e616159cc89cb09af0b08c2e3a1c14ca669..cf119901557cd4927ac7ee64ba562949ab5523f8 100644 (file)
@@ -310,7 +310,7 @@ cbdataInternalAlloc(cbdata_type type)
     c->valid = 1;
     c->locks = 0;
     c->cookie = (long) c ^ cbdata::Cookie;
-    cbdataCount++;
+    ++cbdataCount;
 #if USE_CBDATA_DEBUG
 
     c->file = file;
@@ -421,7 +421,7 @@ cbdataInternalLock(const void *p)
 
     assert(c->locks < INT_MAX);
 
-    c->locks++;
+    ++ c->locks;
 }
 
 void
@@ -583,7 +583,7 @@ cbdataDump(StoreEntry * sentry)
     storeAppendPrintf(sentry, "\n");
     storeAppendPrintf(sentry, "types\tsize\tallocated\ttotal\n");
 
-    for (int i = 1; i < cbdata_types; i++) {
+    for (int i = 1; i < cbdata_types; ++i) {
         MemAllocator *pool = cbdata_index[i].pool;
 
         if (pool) {
index a5152a0bb1320aba8c3bf313312442aab2e55afc..1efdeffc4b64491615fbae56993835e32ab9544e 100644 (file)
@@ -82,7 +82,7 @@ Ip::Address::GetCIDR() const
         shift = 12;
     }
 
-    for (; shift<sizeof(m_SocketAddr.sin6_addr) ; shift++) {
+    for (; shift<sizeof(m_SocketAddr.sin6_addr) ; ++shift) {
         byte= *(ptr+shift);
 
         if (byte == 0xFF) {
@@ -94,7 +94,7 @@ Ip::Address::GetCIDR() const
             caught = ((byte & 0x80) == 0x00);  /* Found a '0' at 'bit' ? */
 
             if (!caught)
-                len++;
+                ++len;
 
             byte <<= 1;
         }
@@ -114,9 +114,9 @@ Ip::Address::ApplyMask(Ip::Address const &mask_addr)
     unsigned int blen = sizeof(m_SocketAddr.sin6_addr)/sizeof(uint32_t);
     unsigned int changes = 0;
 
-    for (unsigned int i = 0; i < blen; i++) {
+    for (unsigned int i = 0; i < blen; ++i) {
         if ((p1[i] & p2[i]) != p1[i])
-            changes++;
+            ++changes;
 
         p1[i] &= p2[i];
     }
@@ -729,7 +729,7 @@ Ip::Address::matchIPAddr(const Ip::Address &rhs) const
     // loop a byte-wise compare
     // NP: match MUST be R-to-L : L-to-R produces inconsistent gt/lt results at varying CIDR
     //     expected difference on CIDR is gt/eq or lt/eq ONLY.
-    for (unsigned int i = 0 ; i < sizeof(m_SocketAddr.sin6_addr) ; i++) {
+    for (unsigned int i = 0 ; i < sizeof(m_SocketAddr.sin6_addr) ; ++i) {
 
         if (l[i] < r[i])
             return -1;
@@ -876,7 +876,7 @@ Ip::Address::ToHostname(char *buf, const unsigned int blen) const
 
     if (IsIPv6() && blen > 0) {
         *p = '[';
-        p++;
+        ++p;
     }
 
     /* 8 being space for [ ] : and port digits */
@@ -887,11 +887,11 @@ Ip::Address::ToHostname(char *buf, const unsigned int blen) const
 
     // find the end of the new string
     while (*p != '\0' && p < buf+blen)
-        p++;
+        ++p;
 
     if (IsIPv6() && p < (buf+blen-1) ) {
         *p = ']';
-        p++;
+        ++p;
     }
 
     /* terminate just in case. */
index 5f436037a0fa0ee978e945fcbec5c4eadc486c41..0155ebd9bdadf133f02a045e51deaad791763baf 100644 (file)
@@ -54,7 +54,7 @@ void Kid::stop(status_type exitStatus)
     time_t stop_time;
     time(&stop_time);
     if ((stop_time - startTime) < fastFailureTimeLimit)
-        badFailures++;
+        ++badFailures;
     else
         badFailures = 0; // the failures are not "frequent" [any more]
 
index dfd05cdaf3d416abfb5e11ad38f04a82d1040bab..602334efab8a6f31748e6426207e3eb91517ff5a 100644 (file)
@@ -151,7 +151,7 @@ void
 logfileLineEnd(Logfile * lf)
 {
     lf->f_lineend(lf);
-    lf->sequence_number++;
+    ++ lf->sequence_number;
 }
 
 void
index 3e7979200f3e2bbb4fc403f0b211eed0093e6371..7c0321d87c52c7b2a0170428b7461d42a0d7791a 100644 (file)
@@ -89,7 +89,7 @@ logfileNewBuffer(Logfile * lf)
     b->written_len = 0;
     b->len = 0;
     dlinkAddTail(b, &b->node, &ll->bufs);
-    ll->nbufs++;
+    ++ ll->nbufs;
 }
 
 static void
index 88265626fad243bc8cabe24c0d1d160d7754d70a..6033226fe9cff7aa87f4641aa05e90b769834777 100644 (file)
@@ -411,7 +411,7 @@ fvdbCount(hash_table * hash, const char *key)
         hash_join(hash, &fv->hash);
     }
 
-    fv->n++;
+    ++ fv->n;
 }
 
 void
index f276b65296270859e748c8f8346955efda01fa16..fc70225324c42700721abc75f6d5d8ae3ca74889 100644 (file)
@@ -244,7 +244,7 @@ try_again:
 
     if (entry->locked()) {
         /* Shit, it is locked. we can't return this one */
-        walker->locked++;
+        ++ walker->locked;
         dlinkAddTail(entry, &lru_node->node, &lru->list);
         goto try_again;
     }
index 73fbe4bf47d18af80555d14bb2316930a6a85afd..b0b37fc33e0e6a6c4f2bf4c2c95d04b73724445a 100644 (file)
@@ -53,7 +53,7 @@ void
 Snmp::Pdu::aggregate(const Pdu& pdu)
 {
     Must(varCount() == pdu.varCount());
-    aggrCount++;
+    ++aggrCount;
     for (variable_list* p_aggr = variables, *p_var = pdu.variables; p_var != NULL;
             p_aggr = p_aggr->next_variable, p_var = p_var->next_variable) {
         Must(p_aggr != NULL);
index 4029abffd1d1c6a9c37de8812e5e9b02dd360ec6..8bf515f75b0485d9f74c362c7a60f5003208c077 100644 (file)
@@ -98,7 +98,8 @@ static void loadSslErrorMap()
 
 Ssl::ssl_error_t Ssl::GetErrorCode(const char *name)
 {
-    for (int i = 0; TheSslErrorArray[i].name != NULL; i++) {
+    //TODO: use a std::map?
+    for (int i = 0; TheSslErrorArray[i].name != NULL; ++i) {
         if (strcmp(name, TheSslErrorArray[i].name) == 0)
             return TheSslErrorArray[i].value;
     }
@@ -294,7 +295,7 @@ const char *Ssl::ErrorDetail::err_lib_error() const
 int Ssl::ErrorDetail::convert(const char *code, const char **value) const
 {
     *value = "-";
-    for (int i=0; ErrorFormatingCodes[i].code!=NULL; i++) {
+    for (int i=0; ErrorFormatingCodes[i].code!=NULL; ++i) {
         const int len = strlen(ErrorFormatingCodes[i].code);
         if (strncmp(code,ErrorFormatingCodes[i].code, len)==0) {
             ErrorDetail::fmt_action_t action  = ErrorFormatingCodes[i].fmt_action;
index 40dd926fbd004b333e024394a4c03d520cfadb90..8d24bcc2d29e616d616b48253f31db157e74b957 100644 (file)
@@ -196,9 +196,10 @@ Ssl::ErrorDetailFile::parse(const char *buffer, int len, bool eof)
 
         //ignore spaces, new lines and comment lines (starting with #) at the beggining
         const char *s;
-        for (s = buf.content(); (*s == '\n' || *s == ' '  || *s == '\t' || *s == '#')  && s < e; s++) {
+        for (s = buf.content(); (*s == '\n' || *s == ' '  || *s == '\t' || *s == '#')  && s < e; ++s) {
             if (*s == '#')
-                while (s<e &&  *s != '\n') s++; // skip untill the end of line
+                while (s<e &&  *s != '\n')
+                    ++s; // skip untill the end of line
         }
 
         if ( s != e) {
index 93712248e83771ef53377c10d00035e44dcc4e3f..0456aa79a86716bc5ed437e05b907c51676241bc 100644 (file)
@@ -109,14 +109,14 @@ Ssl::CertificateDb::Row::Row()
         :   width(cnlNumber)
 {
     row = new char *[width + 1];
-    for (size_t i = 0; i < width + 1; i++)
+    for (size_t i = 0; i < width + 1; ++i)
         row[i] = NULL;
 }
 
 Ssl::CertificateDb::Row::~Row()
 {
     if (row) {
-        for (size_t i = 0; i < width + 1; i++) {
+        for (size_t i = 0; i < width + 1; ++i) {
             delete[](row[i]);
         }
         delete[](row);
@@ -149,15 +149,16 @@ char ** Ssl::CertificateDb::Row::getRow()
 unsigned long Ssl::CertificateDb::index_serial_hash(const char **a)
 {
     const char *n = a[Ssl::CertificateDb::cnlSerial];
-    while (*n == '0') n++;
+    while (*n == '0')
+        ++n;
     return lh_strhash(n);
 }
 
 int Ssl::CertificateDb::index_serial_cmp(const char **a, const char **b)
 {
     const char *aa, *bb;
-    for (aa = a[Ssl::CertificateDb::cnlSerial]; *aa == '0'; aa++);
-    for (bb = b[Ssl::CertificateDb::cnlSerial]; *bb == '0'; bb++);
+    for (aa = a[Ssl::CertificateDb::cnlSerial]; *aa == '0'; ++aa);
+    for (bb = b[Ssl::CertificateDb::cnlSerial]; *bb == '0'; ++bb);
     return strcmp(aa, bb);
 }
 
@@ -495,7 +496,7 @@ void Ssl::CertificateDb::deleteRow(const char **row, int rowIndex)
 #endif
 
     const Columns db_indexes[]={cnlSerial, cnlName};
-    for (unsigned int i = 0; i < countof(db_indexes); i++) {
+    for (unsigned int i = 0; i < countof(db_indexes); ++i) {
 #if OPENSSL_VERSION_NUMBER >= 0x1000004fL
         if (LHASH_OF(OPENSSL_STRING) *fieldIndex =  db.get()->index[db_indexes[i]])
             lh_OPENSSL_STRING_delete(fieldIndex, (char **)row);
@@ -518,10 +519,10 @@ bool Ssl::CertificateDb::deleteInvalidCertificate()
 
     bool removed_one = false;
 #if OPENSSL_VERSION_NUMBER >= 0x1000004fL
-    for (int i = 0; i < sk_OPENSSL_PSTRING_num(db.get()->data); i++) {
+    for (int i = 0; i < sk_OPENSSL_PSTRING_num(db.get()->data); ++i) {
         const char ** current_row = ((const char **)sk_OPENSSL_PSTRING_value(db.get()->data, i));
 #else
-    for (int i = 0; i < sk_num(db.get()->data); i++) {
+    for (int i = 0; i < sk_num(db.get()->data); ++i) {
         const char ** current_row = ((const char **)sk_value(db.get()->data, i));
 #endif
 
@@ -566,10 +567,10 @@ bool Ssl::CertificateDb::deleteByHostname(std::string const & host)
         return false;
 
 #if OPENSSL_VERSION_NUMBER >= 0x1000004fL
-    for (int i = 0; i < sk_OPENSSL_PSTRING_num(db.get()->data); i++) {
+    for (int i = 0; i < sk_OPENSSL_PSTRING_num(db.get()->data); ++i) {
         const char ** current_row = ((const char **)sk_OPENSSL_PSTRING_value(db.get()->data, i));
 #else
-    for (int i = 0; i < sk_num(db.get()->data); i++) {
+    for (int i = 0; i < sk_num(db.get()->data); ++i) {
         const char ** current_row = ((const char **)sk_value(db.get()->data, i));
 #endif
         if (host == current_row[cnlName]) {
index d5ec656af784266b659ab07dc01b03a2546d9fe6..353a4536c2298453dd15354e209fabf223fcf849 100644 (file)
@@ -31,7 +31,7 @@ void Ssl::CertificateStorageAction::dump (StoreEntry *sentry)
     stream << "Port" << delimiter << "Max mem(KB)" << delimiter << "Cert number" << delimiter << "KB/cert" << delimiter << "Mem used(KB)" << delimiter << "Mem free(KB)" << endString;
 
     // Add info for each port.
-    for (std::map<Ip::Address, LocalContextStorage *>::iterator i = TheGlobalContextStorage.storage.begin(); i != TheGlobalContextStorage.storage.end(); i++) {
+    for (std::map<Ip::Address, LocalContextStorage *>::iterator i = TheGlobalContextStorage.storage.begin(); i != TheGlobalContextStorage.storage.end(); ++i) {
         stream << i->first << delimiter;
         LocalContextStorage & ssl_store_policy(*(i->second));
         stream << ssl_store_policy.max_memory / 1024 << delimiter;
@@ -50,7 +50,7 @@ Ssl::LocalContextStorage::LocalContextStorage(size_t aMax_memory)
 
 Ssl::LocalContextStorage::~LocalContextStorage()
 {
-    for (QueueIterator i = lru_queue.begin(); i != lru_queue.end(); i++) {
+    for (QueueIterator i = lru_queue.begin(); i != lru_queue.end(); ++i) {
         delete *i;
     }
 }
@@ -131,7 +131,7 @@ Ssl::GlobalContextStorage::GlobalContextStorage()
 
 Ssl::GlobalContextStorage::~GlobalContextStorage()
 {
-    for (std::map<Ip::Address, LocalContextStorage *>::iterator i = storage.begin(); i != storage.end(); i++) {
+    for (std::map<Ip::Address, LocalContextStorage *>::iterator i = storage.begin(); i != storage.end(); ++i) {
         delete i->second;
     }
 }
@@ -161,7 +161,7 @@ void Ssl::GlobalContextStorage::reconfigureFinish()
         reconfiguring = false;
 
         // remove or change old local storages.
-        for (std::map<Ip::Address, LocalContextStorage *>::iterator i = storage.begin(); i != storage.end(); i++) {
+        for (std::map<Ip::Address, LocalContextStorage *>::iterator i = storage.begin(); i != storage.end(); ++i) {
             std::map<Ip::Address, size_t>::iterator conf_i = configureStorage.find(i->first);
             if (conf_i == configureStorage.end()) {
                 storage.erase(i);
index de4f70df15d28b84cba0a0cb654610293837ca53..bccdb8912508304d4ccb6e3072fee4d087279bfc 100644 (file)
@@ -22,7 +22,7 @@ Ssl::CrtdMessage::ParseResult Ssl::CrtdMessage::parse(const char * buffer, size_
         switch (state) {
         case BEFORE_CODE: {
             if (xisspace(*current_pos)) {
-                current_pos++;
+                ++current_pos;
                 break;
             }
             if (xisalpha(*current_pos)) {
@@ -35,7 +35,7 @@ Ssl::CrtdMessage::ParseResult Ssl::CrtdMessage::parse(const char * buffer, size_
         case CODE: {
             if (xisalnum(*current_pos) || *current_pos == '_') {
                 current_block += *current_pos;
-                current_pos++;
+                ++current_pos;
                 break;
             }
             if (xisspace(*current_pos)) {
@@ -49,7 +49,7 @@ Ssl::CrtdMessage::ParseResult Ssl::CrtdMessage::parse(const char * buffer, size_
         }
         case BEFORE_LENGTH: {
             if (xisspace(*current_pos)) {
-                current_pos++;
+                ++current_pos;
                 break;
             }
             if (xisdigit(*current_pos)) {
@@ -62,7 +62,7 @@ Ssl::CrtdMessage::ParseResult Ssl::CrtdMessage::parse(const char * buffer, size_
         case LENGTH: {
             if (xisdigit(*current_pos)) {
                 current_block += *current_pos;
-                current_pos++;
+                ++current_pos;
                 break;
             }
             if (xisspace(*current_pos)) {
@@ -80,7 +80,7 @@ Ssl::CrtdMessage::ParseResult Ssl::CrtdMessage::parse(const char * buffer, size_
                 break;
             }
             if (xisspace(*current_pos)) {
-                current_pos++;
+                ++current_pos;
                 break;
             } else {
                 state = BODY;
@@ -164,7 +164,7 @@ void Ssl::CrtdMessage::parseBody(CrtdMessage::BodyParams & map, std::string & ot
 void Ssl::CrtdMessage::composeBody(CrtdMessage::BodyParams const & map, std::string const & other_part)
 {
     body.clear();
-    for (BodyParams::const_iterator i = map.begin(); i != map.end(); i++) {
+    for (BodyParams::const_iterator i = map.begin(); i != map.end(); ++i) {
         if (i != map.begin())
             body += "\n";
         body += i->first + "=" + i->second;
index b39d34c74bec8aeb1ff8719f0c890d4f41b27424..5ec4d0c1f2d3a7b92925cd1b0494b6ffbaa15478 100644 (file)
@@ -139,7 +139,7 @@ static bool parseBytesOptionValue(size_t * bptr, char const * value)
     char const * number_end = value;
 
     while ((*number_end >= '0' && *number_end <= '9')) {
-        number_end++;
+        ++number_end;
     }
 
     std::string number(number_begin, number_end - number_begin);
index 2b59465c76026fb28c53f8132870c0e604903d69..f804f00eb0b253511f1b050eac32889005a08bbe 100644 (file)
@@ -171,7 +171,7 @@ int Ssl::matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_fun
 
     if (altnames) {
         int numalts = sk_GENERAL_NAME_num(altnames);
-        for (int i = 0; i < numalts; i++) {
+        for (int i = 0; i < numalts; ++i) {
             const GENERAL_NAME *check = sk_GENERAL_NAME_value(altnames, i);
             if (check->type != GEN_DNS) {
                 continue;
@@ -438,12 +438,12 @@ ssl_parse_options(const char *options)
 
         case '-':
             mode = MODE_REMOVE;
-            option++;
+            ++option;
             break;
 
         case '+':
             mode = MODE_ADD;
-            option++;
+            ++option;
             break;
 
         default:
@@ -451,7 +451,7 @@ ssl_parse_options(const char *options)
             break;
         }
 
-        for (opttmp = ssl_options; opttmp->name; opttmp++) {
+        for (opttmp = ssl_options; opttmp->name; ++opttmp) {
             if (strcmp(opttmp->name, option) == 0) {
                 opt = opttmp;
                 break;
@@ -636,7 +636,7 @@ ssl_load_crl(SSL_CTX *sslContext, const char *CRLfile)
         if (!X509_STORE_add_crl(st, crl))
             debugs(83, 2, "WARNING: Failed to add CRL from file '" << CRLfile << "'");
         else
-            count++;
+            ++count;
 
         X509_CRL_free(crl);
     }
@@ -1218,7 +1218,7 @@ sslGetUserCertificateChainPEM(SSL *ssl)
 
     mem = BIO_new(BIO_s_mem());
 
-    for (i = 0; i < sk_X509_num(chain); i++) {
+    for (i = 0; i < sk_X509_num(chain); ++i) {
         X509 *cert = sk_X509_value(chain, i);
         PEM_write_bio_X509(mem, cert);
     }
@@ -1312,7 +1312,7 @@ void Ssl::addChainToSslContext(SSL_CTX *sslContext, STACK_OF(X509) *chain)
     if (!chain)
         return;
 
-    for (int i = 0; i < sk_X509_num(chain); i++) {
+    for (int i = 0; i < sk_X509_num(chain); ++i) {
         X509 *cert = sk_X509_value(chain, i);
         if (SSL_CTX_add_extra_chain_cert(sslContext, cert)) {
             // increase the certificate lock
index 69b092fa9da3ebd10b2e16b1902f41963005fef1..d68cabc749d2305d559e31ecc0e983e157058699 100644 (file)
@@ -52,7 +52,7 @@ void parse_eol(char *volatile *var) STUB
         self_destruct();
 
     while (*token && xisspace(*token))
-        token++;
+        ++token;
 
     if (!*token)
         self_destruct();
index 239cadf44934a5012185ebca6e5747a704f4f3fa..a4de101b3c1573822f0d9341008bcba9e8581743 100644 (file)
@@ -50,7 +50,7 @@ find_proxy_auth(char const *type)
         {"negotiate", "Negotiate "}
     };
 
-    for (unsigned count = 0; count < 4 ; count++) {
+    for (unsigned count = 0; count < 4 ; ++count) {
         if (strcasecmp(type, proxy_auths[count][0]) == 0)
             return proxy_auths[count][1];
     }
@@ -89,7 +89,7 @@ setup_scheme(Auth::Config *scheme, char const **params, unsigned param_count)
 {
     Auth::ConfigVector &config = Auth::TheConfig;
 
-    for (unsigned position=0; position < param_count; position++) {
+    for (unsigned position=0; position < param_count; ++position) {
         char *param_str=xstrdup(params[position]);
         strtok(param_str, w_space);
         scheme->parse(scheme, config.size(), param_str);
@@ -133,7 +133,7 @@ fake_auth_setup()
         {"negotiate", negotiate_parms, 1}
     };
 
-    for (unsigned scheme=0; scheme < 4; scheme++) {
+    for (unsigned scheme=0; scheme < 4; ++scheme) {
         Auth::Config *schemeConfig;
         schemeConfig = getConfig(params[scheme].name);
         if (schemeConfig != NULL)
index 7741e61f39f2496bd9bc0f4495bd137cfd5c774e..6d525cb0413fe5ea0bf358e3a193a468d03daa1d 100644 (file)
@@ -87,7 +87,7 @@ testEvent::testDump()
     /* loop over the strings, showing exactly where they differ (if at all) */
     printf("Actual Text:\n");
     /* TODO: these should really be just [] lookups, but String doesn't have those here yet. */
-    for ( unsigned int i = 0; i < anEntry->_appended_text.size(); i++) {
+    for ( unsigned int i = 0; i < anEntry->_appended_text.size(); ++i) {
         CPPUNIT_ASSERT( expect[i] );
         CPPUNIT_ASSERT( anEntry->_appended_text[i] );
 
index 70a892ca59503fdfe0ccc4616a6423a7808d2420..688ab6bce7c56c04f4b41c24af9f3711f0ffee06 100644 (file)
@@ -93,7 +93,7 @@ addedEntry(StorePointer hashStore,
     e->swap_filen = 0; /* garh - lower level*/
     e->swap_dirn = -1;
 
-    for (int i=0; i < Config.cacheSwap.n_configured; i++) {
+    for (int i=0; i < Config.cacheSwap.n_configured; ++i) {
         if (INDEXSD (i) == aStore.getRaw())
             e->swap_dirn = i;
     }
index ede33dcb4508691122e88af66199697479b5b778..b6e0b28ebf749d4919bb374b6a02015469964e67 100644 (file)
@@ -74,7 +74,7 @@ addedEntry(StorePointer hashStore,
     e->swap_filen = 0; /* garh - lower level*/
     e->swap_dirn = -1;
 
-    for (int i=0; i < Config.cacheSwap.n_configured; i++) {
+    for (int i=0; i < Config.cacheSwap.n_configured; ++i) {
         if (INDEXSD (i) == aStore.getRaw())
             e->swap_dirn = i;
     }