From: Francesco Chemolli Date: Fri, 13 Jul 2012 10:48:12 +0000 (+0200) Subject: Changed increment operators from postfix to prefix form. X-Git-Tag: sourceformat-review-1~164^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7ae35341a1d5067af5e5b416561c197748fa4d1;p=thirdparty%2Fsquid.git Changed increment operators from postfix to prefix form. --- diff --git a/src/CacheDigest.cc b/src/CacheDigest.cc index b2f2cdb971..9c7ed7e99c 100644 --- a/src/CacheDigest.cc +++ b/src/CacheDigest.cc @@ -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; diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 4636870408..101add43f7 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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(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 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(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(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, ','); } diff --git a/src/cache_diff.cc b/src/cache_diff.cc index 7cebc1fa67..8e2636d989 100644 --- a/src/cache_diff.cc +++ b/src/cache_diff.cc @@ -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]); diff --git a/src/carp.cc b/src/carp.cc index 7918a48e87..d0554b5613 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -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; diff --git a/src/cbdata.cc b/src/cbdata.cc index 54ee8e6161..cf11990155 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -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) { diff --git a/src/ip/Address.cc b/src/ip/Address.cc index a5152a0bb1..1efdeffc4b 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -82,7 +82,7 @@ Ip::Address::GetCIDR() const shift = 12; } - for (; shift 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. */ diff --git a/src/ipc/Kid.cc b/src/ipc/Kid.cc index 5f436037a0..0155ebd9bd 100644 --- a/src/ipc/Kid.cc +++ b/src/ipc/Kid.cc @@ -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] diff --git a/src/log/File.cc b/src/log/File.cc index dfd05cdaf3..602334efab 100644 --- a/src/log/File.cc +++ b/src/log/File.cc @@ -151,7 +151,7 @@ void logfileLineEnd(Logfile * lf) { lf->f_lineend(lf); - lf->sequence_number++; + ++ lf->sequence_number; } void diff --git a/src/log/ModDaemon.cc b/src/log/ModDaemon.cc index 3e7979200f..7c0321d87c 100644 --- a/src/log/ModDaemon.cc +++ b/src/log/ModDaemon.cc @@ -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 diff --git a/src/log/access_log.cc b/src/log/access_log.cc index 88265626fa..6033226fe9 100644 --- a/src/log/access_log.cc +++ b/src/log/access_log.cc @@ -411,7 +411,7 @@ fvdbCount(hash_table * hash, const char *key) hash_join(hash, &fv->hash); } - fv->n++; + ++ fv->n; } void diff --git a/src/repl/lru/store_repl_lru.cc b/src/repl/lru/store_repl_lru.cc index f276b65296..fc70225324 100644 --- a/src/repl/lru/store_repl_lru.cc +++ b/src/repl/lru/store_repl_lru.cc @@ -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; } diff --git a/src/snmp/Pdu.cc b/src/snmp/Pdu.cc index 73fbe4bf47..b0b37fc33e 100644 --- a/src/snmp/Pdu.cc +++ b/src/snmp/Pdu.cc @@ -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); diff --git a/src/ssl/ErrorDetail.cc b/src/ssl/ErrorDetail.cc index 4029abffd1..8bf515f75b 100644 --- a/src/ssl/ErrorDetail.cc +++ b/src/ssl/ErrorDetail.cc @@ -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; diff --git a/src/ssl/ErrorDetailManager.cc b/src/ssl/ErrorDetailManager.cc index 40dd926fbd..8d24bcc2d2 100644 --- a/src/ssl/ErrorDetailManager.cc +++ b/src/ssl/ErrorDetailManager.cc @@ -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= 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]) { diff --git a/src/ssl/context_storage.cc b/src/ssl/context_storage.cc index d5ec656af7..353a4536c2 100644 --- a/src/ssl/context_storage.cc +++ b/src/ssl/context_storage.cc @@ -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::iterator i = TheGlobalContextStorage.storage.begin(); i != TheGlobalContextStorage.storage.end(); i++) { + for (std::map::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::iterator i = storage.begin(); i != storage.end(); i++) { + for (std::map::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::iterator i = storage.begin(); i != storage.end(); i++) { + for (std::map::iterator i = storage.begin(); i != storage.end(); ++i) { std::map::iterator conf_i = configureStorage.find(i->first); if (conf_i == configureStorage.end()) { storage.erase(i); diff --git a/src/ssl/crtd_message.cc b/src/ssl/crtd_message.cc index de4f70df15..bccdb89125 100644 --- a/src/ssl/crtd_message.cc +++ b/src/ssl/crtd_message.cc @@ -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; diff --git a/src/ssl/ssl_crtd.cc b/src/ssl/ssl_crtd.cc index b39d34c74b..5ec4d0c1f2 100644 --- a/src/ssl/ssl_crtd.cc +++ b/src/ssl/ssl_crtd.cc @@ -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); diff --git a/src/ssl/support.cc b/src/ssl/support.cc index 2b59465c76..f804f00eb0 100644 --- a/src/ssl/support.cc +++ b/src/ssl/support.cc @@ -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 diff --git a/src/tests/stub_cache_cf.cc b/src/tests/stub_cache_cf.cc index 69b092fa9d..d68cabc749 100644 --- a/src/tests/stub_cache_cf.cc +++ b/src/tests/stub_cache_cf.cc @@ -52,7 +52,7 @@ void parse_eol(char *volatile *var) STUB self_destruct(); while (*token && xisspace(*token)) - token++; + ++token; if (!*token) self_destruct(); diff --git a/src/tests/testAuth.cc b/src/tests/testAuth.cc index 239cadf449..a4de101b3c 100644 --- a/src/tests/testAuth.cc +++ b/src/tests/testAuth.cc @@ -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) diff --git a/src/tests/testEvent.cc b/src/tests/testEvent.cc index 7741e61f39..6d525cb041 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -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] ); diff --git a/src/tests/testStoreController.cc b/src/tests/testStoreController.cc index 70a892ca59..688ab6bce7 100644 --- a/src/tests/testStoreController.cc +++ b/src/tests/testStoreController.cc @@ -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; } diff --git a/src/tests/testStoreHashIndex.cc b/src/tests/testStoreHashIndex.cc index ede33dcb45..b6e0b28ebf 100644 --- a/src/tests/testStoreHashIndex.cc +++ b/src/tests/testStoreHashIndex.cc @@ -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; }