------------------------------------------------------------ revno: 12192 revision-id: kinkie@squid-cache.org-20120702122810-6jhnwnxtfyx8sh3z parent: kinkie@squid-cache.org-20120702121407-2vu4h33k3b28v2dz committer: Francesco Chemolli branch nick: trunk timestamp: Mon 2012-07-02 14:28:10 +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-20120702122810-6jhnwnxtfyx8sh3z # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: a893936377c430898b929ba67e9dc58e299e1afc # timestamp: 2012-07-02 12:52:32 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: kinkie@squid-cache.org-20120702121407-\ # 2vu4h33k3b28v2dz # # Begin patch === modified file 'lib/MemPool.cc' --- lib/MemPool.cc 2012-01-20 18:55:04 +0000 +++ lib/MemPool.cc 2012-07-02 12:28:10 +0000 @@ -302,7 +302,7 @@ iter = memPoolIterate(); while ((pool = memPoolIterateNext(iter))) { if (pool->getStats(&pp_stats, 1) > 0) - pools_inuse++; + ++pools_inuse; } memPoolIterateDone(&iter); === modified file 'lib/MemPoolChunked.cc' --- lib/MemPoolChunked.cc 2012-01-20 18:55:04 +0000 +++ lib/MemPoolChunked.cc 2012-07-02 12:28:10 +0000 @@ -147,7 +147,7 @@ freeList = objCache; void **Free = (void **)freeList; - for (int i = 1; i < pool->chunk_capacity; i++) { + for (int i = 1; i < pool->chunk_capacity; ++i) { *Free = (void *) ((char *) Free + pool->obj_size); void **nextFree = (void **)*Free; (void) VALGRIND_MAKE_MEM_NOACCESS(Free, pool->obj_size); @@ -158,7 +158,7 @@ memMeterAdd(pool->getMeter().alloc, pool->chunk_capacity); memMeterAdd(pool->getMeter().idle, pool->chunk_capacity); - pool->chunkCount++; + ++pool->chunkCount; lastref = squid_curtime; pool->allChunks.insert(this, memCompChunks); } @@ -217,7 +217,7 @@ { void **Free; - saved_calls++; + ++saved_calls; /* first, try cache */ if (freeCache) { @@ -239,7 +239,7 @@ Free = (void **)chunk->freeList; chunk->freeList = *Free; *Free = NULL; - chunk->inuse_count++; + ++chunk->inuse_count; chunk->lastref = squid_curtime; if (chunk->freeList == NULL) { @@ -480,9 +480,9 @@ chunk = Chunks; while (chunk) { if (chunk->inuse_count == 0) - chunks_free++; + ++chunks_free; else if (chunk->inuse_count < chunk_capacity) - chunks_partial++; + ++chunks_partial; chunk = chunk->next; } === modified file 'lib/MemPoolMalloc.cc' --- lib/MemPoolMalloc.cc 2012-01-20 18:55:04 +0000 +++ lib/MemPoolMalloc.cc 2012-07-02 12:28:10 +0000 @@ -57,7 +57,7 @@ void *obj = freelist.pop(); if (obj) { memMeterDec(meter.idle); - saved_calls++; + ++saved_calls; } else { obj = xcalloc(1, obj_size); memMeterInc(meter.alloc); === modified file 'lib/hash.cc' --- lib/hash.cc 2012-06-03 08:10:29 +0000 +++ lib/hash.cc 2012-07-02 12:28:10 +0000 @@ -71,7 +71,7 @@ unsigned int j = 0; unsigned int i = 0; while (*s) { - j++; + ++j; n ^= 271 * (*s++); } i = n ^ (j * 271); @@ -169,7 +169,7 @@ i = hid->hash(lnk->key, hid->size); lnk->next = hid->buckets[i]; hid->buckets[i] = lnk; - hid->count++; + ++hid->count; } /** @@ -268,7 +268,7 @@ if (NULL == hid->next) hash_next_bucket(hid); } - hid->count--; + --hid->count; return; } assert(0); @@ -295,9 +295,9 @@ hash_first(hid); while ((l = hash_next(hid)) && i < hid->count) { *(list + i) = l; - i++; + ++i; } - for (int j = 0; j < i; j++) + for (int j = 0; j < i; ++j) free_func(*(list + j)); xfree(list); } @@ -334,7 +334,7 @@ int best_prime = hash_primes[0]; double min = fabs(log((double) n) - log((double) hash_primes[0])); double d; - for (int i = 0; i < I; i++) { + for (int i = 0; i < I; ++i) { d = fabs(log((double) n) - log((double) hash_primes[i])); if (d > min) continue; === modified file 'lib/malloc_trace.cc' --- lib/malloc_trace.cc 2012-01-20 18:55:04 +0000 +++ lib/malloc_trace.cc 2012-07-02 12:28:10 +0000 @@ -124,8 +124,8 @@ /* calloc the ptrs so that we don't see them when hunting lost memory */ malloc_ptrs = calloc(DBG_ARRY_BKTS, sizeof(*malloc_ptrs)); - for (B = 0; B < DBG_ARRY_BKTS; B++) { - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (B = 0; B < DBG_ARRY_BKTS; ++B) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { malloc_ptrs[B][I] = NULL; malloc_size[B][I] = 0; #if XMALLOC_TRACE @@ -147,7 +147,7 @@ int B, I; B = DBG_HASH_BUCKET(s); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] != s) continue; @@ -189,7 +189,7 @@ B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (!(P = malloc_ptrs[B][I])) continue; @@ -206,7 +206,7 @@ } } - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I]) continue; @@ -244,7 +244,7 @@ int B, I; B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] == p) return malloc_size[B][I]; } @@ -261,7 +261,7 @@ int B, I; B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] == p) return malloc_file[B][I]; } @@ -275,7 +275,7 @@ int B, I; B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] == p) return malloc_line[B][I]; } @@ -289,7 +289,7 @@ int B, I; B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] == p) return malloc_count[B][I]; } @@ -350,7 +350,7 @@ if (p && p != start) { B = DBG_HASH_BUCKET(p); - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] == p) { if (!malloc_refs[B][I]++) { /* A new reference */ @@ -399,8 +399,8 @@ fprintf(stderr, "----- Memory map ----\n"); xmalloc_scan_region(&_etext, (void *) sbrk(0) - (void *) &_etext, 0); - for (B = 0; B < DBG_ARRY_BKTS; B++) { - for (I = 0; I < DBG_ARRY_SZ; I++) { + for (B = 0; B < DBG_ARRY_BKTS; ++B) { + for (I = 0; I < DBG_ARRY_SZ; ++I) { if (malloc_ptrs[B][I] && malloc_refs[B][I] == 0) { /* Found a leak... */ fprintf(stderr, "Leak found: %p", malloc_ptrs[B][I]); === modified file 'lib/ntlmauth/ntlmauth.cc' --- lib/ntlmauth/ntlmauth.cc 2012-03-23 07:14:21 +0000 +++ lib/ntlmauth/ntlmauth.cc 2012-07-02 12:28:10 +0000 @@ -137,25 +137,25 @@ unsigned short *s = (unsigned short *)rv.str; rv.str = d = buf; - for (l >>= 1; l; s++, l--) { + for (l >>= 1; l; ++s, --l) { unsigned short c = le16toh(*s); if (c > 254 || c == '\0') { fprintf(stderr, "ntlmssp: bad unicode: %04x\n", c); return rv; } *d++ = c; - rv.l++; + ++rv.l; } } else { /* ASCII/OEM string */ char *sc = rv.str; - for (; l>=0; sc++, l--) { + for (; l>=0; ++sc, --l) { if (*sc == '\0' || !xisprint(*sc)) { fprintf(stderr, "ntlmssp: bad ascii: %04x\n", *sc); return rv; } - rv.l++; + ++rv.l; } } @@ -209,7 +209,7 @@ int r = (int) rand(); r = (hash ^ r) + r; - for (i = 0; i < NTLM_NONCE_LEN; i++) { + for (i = 0; i < NTLM_NONCE_LEN; ++i) { nonce[i] = r; r = (r >> 2) ^ r; } === modified file 'lib/profiler/Profiler.cc' --- lib/profiler/Profiler.cc 2012-01-20 18:55:04 +0000 +++ lib/profiler/Profiler.cc 2012-07-02 12:28:10 +0000 @@ -161,7 +161,7 @@ if (head->worst < head->delta) head->worst = head->delta; head->summ += head->delta; - head->count++; + ++head->count; } static xprof_stats_data *xp_UNACCOUNTED; @@ -209,7 +209,7 @@ cstack[cstack_head].accum = 0; cstack[cstack_head].timer = type; cstack[cstack_head].name = timer; - cstack_head++; + ++cstack_head; assert(cstack_head < MAXSTACKDEPTH); } @@ -219,7 +219,7 @@ { hrtime_t tt = get_tick(); assert(cstack_head > 0); - cstack_head--; + --cstack_head; assert(cstack[cstack_head].timer == type); /* Record timer details */ === modified file 'src/acl/Asn.cc' --- src/acl/Asn.cc 2012-01-20 18:55:04 +0000 +++ src/acl/Asn.cc 2012-07-02 12:28:10 +0000 @@ -201,12 +201,14 @@ void asnInit(void) { - static int inited = 0; + static bool inited = false; squid_max_keylen = 40; CBDATA_INIT_TYPE(ASState); - if (0 == inited++) + if (!inited) { + inited = true; squid_rn_init(); + } squid_rn_inithead(&AS_tree_head, 8); @@ -310,9 +312,9 @@ while ((size_t)(s - buf) < result.length + asState->reqofs && *s != '\0') { while (*s && xisspace(*s)) - s++; + ++s; - for (t = s; *t; t++) { + for (t = s; *t; ++t) { if (xisspace(*t)) break; } @@ -635,7 +637,7 @@ const ipcache_addrs *ia = ipcache_gethostbyname(checklist->request->GetHost(), IP_LOOKUP_IF_MISS); if (ia) { - for (int k = 0; k < (int) ia->count; k++) { + for (int k = 0; k < (int) ia->count; ++k) { if (data->match(ia->in_addrs[k])) return 1; } === modified file 'src/acl/DestinationIp.cc' --- src/acl/DestinationIp.cc 2012-01-20 18:55:04 +0000 +++ src/acl/DestinationIp.cc 2012-07-02 12:28:10 +0000 @@ -67,7 +67,7 @@ if (ia) { /* Entry in cache found */ - for (int k = 0; k < (int) ia->count; k++) { + for (int k = 0; k < (int) ia->count; ++k) { if (ACLIP::match(ia->in_addrs[k])) return 1; } === modified file 'src/acl/Gadgets.cc' --- src/acl/Gadgets.cc 2012-01-20 18:55:04 +0000 +++ src/acl/Gadgets.cc 2012-07-02 12:28:10 +0000 @@ -214,7 +214,7 @@ if (*t == '!') { L->negated (true); - t++; + ++t; } debugs(28, 3, "aclParseAclList: looking for ACL name '" << t << "'"); === modified file 'src/acl/Ip.cc' --- src/acl/Ip.cc 2012-01-20 18:55:04 +0000 +++ src/acl/Ip.cc 2012-07-02 12:28:10 +0000 @@ -99,7 +99,7 @@ if (!addr2.IsAnyAddr()) { b2[0] = '-'; - rlen++; + ++rlen; addr2.NtoA(&(b2[1]), len - rlen ); rlen = strlen(buf); } else @@ -109,7 +109,7 @@ if (!mask.IsNoAddr()) { b3[0] = '/'; - rlen++; + ++rlen; int cidr = mask.GetCIDR() - (addr1.IsIPv4()?96:0); snprintf(&(b3[1]), (len-rlen), "%u", (unsigned int)(cidr<0?0:cidr) ); } else === modified file 'src/acl/RegexData.cc' --- src/acl/RegexData.cc 2012-01-20 18:55:04 +0000 +++ src/acl/RegexData.cc 2012-07-02 12:28:10 +0000 @@ -238,11 +238,11 @@ if (largeREindex > 0) largeRE[largeREindex++] = '|'; largeRE[largeREindex++] = '('; - for (char * t = wl->key; *t != '\0'; t++) + for (char * t = wl->key; *t != '\0'; ++t) largeRE[largeREindex++] = *t; largeRE[largeREindex++] = ')'; largeRE[largeREindex] = '\0'; - numREs++; + ++numREs; } else { debugs(28, 2, "compileOptimisedREs: buffer full, generating new optimised RE..." ); newlistp = compileRE( newlistp, largeRE, flags ); === modified file 'src/adaptation/Config.cc' --- src/adaptation/Config.cc 2012-01-20 18:55:04 +0000 +++ src/adaptation/Config.cc 2012-07-02 12:28:10 +0000 @@ -226,7 +226,7 @@ ServicePointer s = createService(cfg); if (s != NULL) { AllServices().push_back(s); - created++; + ++created; } } @@ -285,7 +285,7 @@ ConfigParser::ParseQuotedString(&value); // TODO: Find a way to move this check to ICAP - for (int i = 0; warnFor[i] != NULL; i++) { + for (int i = 0; warnFor[i] != NULL; ++i) { if (name.caseCmp(warnFor[i]) == 0) { fatalf("%s:%d: meta name \"%s\" is a reserved ICAP header name", cfg_filename, config_lineno, name.termedBuf()); === modified file 'src/adaptation/ServiceConfig.cc' --- src/adaptation/ServiceConfig.cc 2012-01-20 18:55:04 +0000 +++ src/adaptation/ServiceConfig.cc 2012-07-02 12:28:10 +0000 @@ -187,7 +187,7 @@ if ((t = strchr(s, ']')) == NULL) return false; - s++; + ++s; len = t - s; if ((e = strchr(t, ':')) != NULL) { have_port = true; @@ -212,7 +212,7 @@ port = -1; if (have_port) { - s++; + ++s; if ((e = strchr(s, '/')) != NULL) { char *t; @@ -235,7 +235,7 @@ // if no port, the caller may use service_configConfigs or supply the default if neeeded - s++; + ++s; e = strchr(s, '\0'); len = e - s; === modified file 'src/adaptation/icap/ServiceRep.cc' --- src/adaptation/icap/ServiceRep.cc 2012-01-20 18:55:04 +0000 +++ src/adaptation/icap/ServiceRep.cc 2012-07-02 12:28:10 +0000 @@ -479,7 +479,7 @@ method_list.append(ICAP::methodStr(*iter)); method_list.append(" ", 1); - iter++; + ++iter; } if (!method_found) { === modified file 'src/auth/User.cc' --- src/auth/User.cc 2012-01-20 18:55:04 +0000 +++ src/auth/User.cc 2012-07-02 12:28:10 +0000 @@ -140,10 +140,10 @@ if (!found) { /* This ip is not in the seen list. Add it. */ dlinkAddTail(&new_ipdata->node, &ipdata->node, &ip_list); - ipcount++; + ++ipcount; /* remove from the source list */ dlinkDelete(&new_ipdata->node, &(from->ip_list)); - from->ipcount--; + ++from->ipcount; } } } @@ -334,7 +334,7 @@ dlinkAddTail(ipdata, &ipdata->node, &ip_list); - ipcount++; + ++ipcount; debugs(29, 2, HERE << "user '" << username() << "' has been seen at a new IP address (" << ipaddr << ")"); } === modified file 'src/auth/basic/auth_basic.cc' --- src/auth/basic/auth_basic.cc 2012-01-20 18:55:04 +0000 +++ src/auth/basic/auth_basic.cc 2012-07-02 12:28:10 +0000 @@ -223,11 +223,11 @@ /* trim BASIC from string */ while (xisgraph(*proxy_auth)) - proxy_auth++; + ++proxy_auth; /* Trim leading whitespace before decoding */ while (xisspace(*proxy_auth)) - proxy_auth++; + ++proxy_auth; /* Trim trailing \n before decoding */ // XXX: really? is the \n actually still there? does the header parse not drop it? === modified file 'src/auth/digest/auth_digest.cc' --- src/auth/digest/auth_digest.cc 2012-06-07 10:27:46 +0000 +++ src/auth/digest/auth_digest.cc 2012-07-02 12:28:10 +0000 @@ -186,7 +186,7 @@ /* create a new nonce */ newnonce->noncedata.randomdata = squid_random(); /* Bug 3526 high performance fix: add 1 second to creationtime to avoid duplication */ - newnonce->noncedata.creationtime++; + ++newnonce->noncedata.creationtime; authDigestNonceEncode(newnonce); } @@ -298,7 +298,7 @@ authDigestNonceLink(digest_nonce_h * nonce) { assert(nonce != NULL); - nonce->references++; + ++nonce->references; debugs(29, 9, "authDigestNonceLink: nonce '" << nonce << "' now at '" << nonce->references << "'."); } @@ -379,7 +379,7 @@ /* is the nonce-count ok ? */ if (!static_cast(Auth::Config::Find("digest"))->CheckNonceCount) { - nonce->nc++; + ++nonce->nc; return -1; /* forced OK by configuration */ } @@ -796,11 +796,11 @@ /* trim DIGEST from string */ while (xisgraph(*proxy_auth)) - proxy_auth++; + ++proxy_auth; /* Trim leading whitespace before decoding */ while (xisspace(*proxy_auth)) - proxy_auth++; + ++proxy_auth; String temp(proxy_auth); === modified file 'src/auth/negotiate/UserRequest.cc' --- src/auth/negotiate/UserRequest.cc 2012-06-19 23:16:13 +0000 +++ src/auth/negotiate/UserRequest.cc 2012-07-02 12:28:10 +0000 @@ -179,13 +179,13 @@ if (blob) { while (xisspace(*blob) && *blob) - blob++; + ++blob; while (!xisspace(*blob) && *blob) - blob++; + ++blob; while (xisspace(*blob) && *blob) - blob++; + ++blob; } switch (user()->credentials()) { === modified file 'src/auth/ntlm/UserRequest.cc' --- src/auth/ntlm/UserRequest.cc 2012-06-19 23:16:13 +0000 +++ src/auth/ntlm/UserRequest.cc 2012-07-02 12:28:10 +0000 @@ -173,13 +173,13 @@ /* if proxy_auth is actually NULL, we'd better not manipulate it. */ if (blob) { while (xisspace(*blob) && *blob) - blob++; + ++blob; while (!xisspace(*blob) && *blob) - blob++; + ++blob; while (xisspace(*blob) && *blob) - blob++; + ++blob; } switch (user()->credentials()) { @@ -262,7 +262,7 @@ /* seperate out the useful data */ blob = strchr(reply, ' '); if (blob) - blob++; + ++blob; if (strncasecmp(reply, "TT ", 3) == 0) { /* we have been given a blob to send to the client */ === modified file 'src/base/TextException.cc' --- src/base/TextException.cc 2012-01-20 18:55:04 +0000 +++ src/base/TextException.cc 2012-07-02 12:28:10 +0000 @@ -51,12 +51,12 @@ s = strrchr(fname, '/'); if (s) - s++; + ++s; else s = fname; while (*s) { - j++; + ++j; n ^= 271 * (unsigned) *s++; } i = n ^ (j * 271); === modified file 'src/snmp_core.cc' --- src/snmp_core.cc 2012-04-25 05:29:20 +0000 +++ src/snmp_core.cc 2012-07-02 12:28:10 +0000 @@ -765,7 +765,7 @@ int no = name[current->len] ; int i; // Note: This works because the Config.peers keeps its index according to its position. - for ( i=0 ; peers && (i < no) ; peers = peers->next , i++ ) ; + for ( i=0 ; peers && (i < no) ; peers = peers->next , ++i ) ; if (peers) { debugs(49, 6, "snmp peer_Inst: Encode peer #" << i);