unsigned long l;
if (*salt == '$') {
- magic = salt++;
+ magic = salt;
+ ++salt;
while (*salt && *salt != '$')
++salt;
if (*salt == '$') {
*/
if (nStatus == NERR_Success) {
if ((pTmpBuf = pBuf) != NULL) {
- for (i = 0; i < dwEntriesRead; i++) {
+ for (i = 0; i < dwEntriesRead; ++i) {
assert(pTmpBuf != NULL);
if (pTmpBuf == NULL) {
result = 0;
strncpy(NTDomain, UserName, sizeof(NTDomain));
- for (j = 0; j < strlen(NTV_VALID_DOMAIN_SEPARATOR); j++) {
+ for (j = 0; j < strlen(NTV_VALID_DOMAIN_SEPARATOR); ++j) {
if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[j])) != NULL)
break;
}
*/
if (nStatus == NERR_Success) {
if ((pTmpBuf = pUsrBuf) != NULL) {
- for (i = 0; i < dwEntriesRead; i++) {
+ for (i = 0; i < dwEntriesRead; ++i) {
assert(pTmpBuf != NULL);
if (pTmpBuf == NULL) {
result = 0;
continue;
}
username = strtok(buf, " ");
- for (n = 0; (group = strtok(NULL, " ")) != NULL; n++) {
+ for (n = 0; (group = strtok(NULL, " ")) != NULL; ++n) {
rfc1738_unescape(group);
groups[n] = group;
}
src = margs->glist;
if (!src)
return NULL;
- for (n = 0; n < strlen(src); n++)
+ for (n = 0; n < strlen(src); ++n)
if ((unsigned char) src[n] > 127)
++c;
if (c != 0) {
p = (unsigned char *) xmalloc(strlen(src) + c);
dupp = p;
- for (n = 0; n < strlen(src); n++) {
+ for (n = 0; n < strlen(src); ++n) {
s = (unsigned char) src[n];
if (s > 127 && s < 192) {
*p = 194;
creds = (krb5_creds *) xmalloc(sizeof(*creds));
memset(creds, 0, sizeof(*creds));
- for (i = 0; i < nprinc; i++) {
+ for (i = 0; i < nprinc; ++i) {
/*
* get credentials
*/
xfree(mem_cache);
if (principal)
krb5_free_principal(kparam.context, principal);
- for (i = 0; i < nprinc; i++) {
+ for (i = 0; i < nprinc; ++i) {
if (principal_list[i])
krb5_free_principal(kparam.context, principal_list[i]);
}
if (!domain)
return NULL;
- for (dp = domain; *dp; dp++) {
+ for (dp = domain; *dp; ++dp) {
if (*dp == '.')
++i;
}
bp = bindp;
strcpy(bp, "dc=");
bp += 3;
- for (dp = domain; *dp; dp++) {
+ for (dp = domain; *dp; ++dp) {
if (*dp == '.') {
strcpy(bp, ",dc=");
bp += 4;
char *ldap_filter_esc, *ldf;
i = 0;
- for (ldap_filter_esc = filter; *ldap_filter_esc; ldap_filter_esc++) {
+ for (ldap_filter_esc = filter; *ldap_filter_esc; ++ldap_filter_esc) {
if ((*ldap_filter_esc == '*') ||
(*ldap_filter_esc == '(') ||
(*ldap_filter_esc == ')') ||
ldap_filter_esc = (char *) xcalloc(strlen(filter) + i + 1, sizeof(char));
ldf = ldap_filter_esc;
- for (; *filter; filter++) {
+ for (; *filter; ++filter) {
if (*filter == '*') {
strcpy(ldf, "\\2a");
ldf = ldf + 3;
* Cleanup
*/
if (attr_value) {
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
xfree(attr_value[j]);
}
xfree(attr_value);
*/
retval = 0;
ldepth = depth + 1;
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
/* Compare first CN= value assuming it is the same as the group name itself */
av = attr_value[j];
if (debug_enabled) {
int n;
debug((char *) "%s| %s: DEBUG: Entry %d \"%s\" in hex UTF-8 is ", LogTime(), PROGRAM, j + 1, av);
- for (n = 0; av[n] != '\0'; n++)
+ for (n = 0; av[n] != '\0'; ++n)
fprintf(stderr, "%02x", (unsigned char) av[n]);
fprintf(stderr, "\n");
}
* Cleanup
*/
if (attr_value) {
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
xfree(attr_value[j]);
}
xfree(attr_value);
int il;
if ((values = ldap_get_values_len(ld, msg, attr)) != NULL) {
- for (il = 0; values[il] != NULL; il++) {
+ for (il = 0; values[il] != NULL; ++il) {
attr_value = (char **) xrealloc(attr_value, (il + 1) * sizeof(char *));
if (!attr_value)
* Loop over list of ldap servers of users domain
*/
nhosts = get_ldap_hostname_list(margs, &hlist, 0, domain);
- for (i = 0; i < nhosts; i++) {
+ for (i = 0; i < nhosts; ++i) {
port = 389;
if (hlist[i].port != -1)
port = hlist[i].port;
if (host)
xfree(host);
host = NULL;
- for (i = 0; i < nhosts; i++) {
+ for (i = 0; i < nhosts; ++i) {
ld = tool_ldap_open(margs, hlist[i].host, port, ssl);
if (!ld)
* Compare group names
*/
retval = 0;
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
/* Compare first CN= value assuming it is the same as the group name itself */
av = attr_value[j];
if (debug_enabled) {
int n;
debug((char *) "%s| %s: DEBUG: Entry %d \"%s\" in hex UTF-8 is ", LogTime(), PROGRAM, j + 1, av);
- for (n = 0; av[n] != '\0'; n++)
+ for (n = 0; av[n] != '\0'; ++n)
fprintf(stderr, "%02x", (unsigned char) av[n]);
fprintf(stderr, "\n");
}
if (debug_enabled && max_attr > 0) {
debug((char *) "%s| %s: DEBUG: Perform recursive group search\n", LogTime(), PROGRAM);
}
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
av = attr_value[j];
if (search_group_tree(margs, ld, bindp, av, group, 1)) {
* Cleanup
*/
if (attr_value) {
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
xfree(attr_value[j]);
}
xfree(attr_value);
* Cleanup
*/
if (attr_value_2) {
- for (j = 0; j < max_attr_2; j++) {
+ for (j = 0; j < max_attr_2; ++j) {
xfree(attr_value_2[j]);
}
xfree(attr_value_2);
* Cleanup
*/
if (attr_value) {
- for (j = 0; j < max_attr; j++) {
+ for (j = 0; j < max_attr; ++j) {
xfree(attr_value[j]);
}
xfree(attr_value);
int i;
hp = *hlist;
- for (i = 0; i < nhosts; i++) {
+ for (i = 0; i < nhosts; ++i) {
if (hp[i].host)
xfree(hp[i].host);
hp[i].host = NULL;
}
/* check groups supplied on the command line */
- for (i = 0; i < ngroups; i++) {
+ for (i = 0; i < ngroups; ++i) {
if (check_pw == 1) {
j += validate_user_pw(user, grents[i]);
}
{
memMeterDel(pool->getMeter().alloc, pool->chunk_capacity);
memMeterDel(pool->getMeter().idle, pool->chunk_capacity);
- pool->chunkCount--;
+ -- pool->chunkCount;
pool->allChunks.remove(this, memCompChunks);
xfree(objCache);
}
/* then try perchunk freelist chain */
if (nextFreeChunk == NULL) {
/* no chunk with frees, so create new one */
- saved_calls--; // compensate for the ++ above
+ -- saved_calls; // compensate for the ++ above
createChunk();
}
/* now we have some in perchunk freelist chain */
chunk = const_cast<MemChunk *>(*allChunks.find(Free, memCompObjChunks));
assert(splayLastResult == 0);
assert(chunk->inuse_count > 0);
- chunk->inuse_count--;
+ -- chunk->inuse_count;
(void) VALGRIND_MAKE_MEM_DEFINED(Free, sizeof(void *));
freeCache = *(void **)Free; /* remove from global cache */
*(void **)Free = chunk->freeList; /* stuff into chunks freelist */
case 1:
HASH4;
}
- while (loop--) {
+ while (--loop) {
HASH4;
HASH4;
HASH4;
void Adaptation::Icap::ServiceRep::noteGoneWaiter()
{
- theAllWaiters--;
+ --theAllWaiters;
// in case the notified transaction did not take the connection slot
busyCheckpoint();
dlinkDelete(&new_ipdata->node, &(from->ip_list));
cbdataFree(new_ipdata);
/* catch incipient underflow */
- from->ipcount--;
+ -- from->ipcount;
} else {
/* add to our list. replace if already present. */
AuthUserIP *ipdata = static_cast<AuthUserIP *>(ip_list.head->data);
cbdataFree(ipdata);
/* catch incipient underflow */
assert(ipcount);
- ipcount--;
+ -- ipcount;
}
ipdata = tempnode;
cbdataFree(ipdata);
/* catch incipient underflow */
assert(ipcount);
- ipcount--;
+ -- ipcount;
ipdata = tempnode;
}
cbdataFree(ipdata);
/* catch incipient underflow */
assert(ipcount);
- ipcount--;
+ -- ipcount;
return;
}
cbdataFree(ipdata);
/* catch incipient underflow */
assert(ipcount);
- ipcount--;
+ -- ipcount;
}
ipdata = tempnode;
assert(nonce != NULL);
if (nonce->references > 0) {
- nonce->references--;
+ -- nonce->references;
} else {
debugs(29, 1, "authDigestNonceUnlink; Attempt to lower nonce " << nonce << " refcount below 0!");
}
blob = strchr(reply, ' ');
if (blob) {
- blob++;
+ ++blob;
arg = strchr(blob + 1, ' ');
} else {
arg = NULL;
if (callback_ == NULL || callback_->canceled())
return;
- totalTries_++;
+ ++ totalTries_;
switch (comm_connect_addr(temporaryFd_, conn_->remote) ) {
break;
default:
- failRetries_++;
+ ++failRetries_;
// check for timeout FIRST.
if (squid_curtime - connectStart_ > connectTimeout_) {
if (isOpen()) {
comm_close(fd);
fd = -1;
- if (getPeer())
- getPeer()->stats.conn_open--;
+ if (peer *p=getPeer())
+ -- p->stats.conn_open;
}
}
FD_ZERO(&write_mask);
incoming_sockets_accepted = 0;
- for (i = 0; i < nfds; i++) {
+ for (i = 0; i < nfds; ++i) {
fd = fds[i];
if (fd_table[fd].read_handler) {
getCurrentTime();
- statCounter.syscalls.selects++;
+ ++ statCounter.syscalls.selects;
if (select(maxfd, &read_mask, &write_mask, &errfds, &zero_tv) < 1)
return incoming_sockets_accepted;
- for (i = 0; i < nfds; i++) {
+ for (i = 0; i < nfds; ++i) {
fd = fds[i];
if (FD_ISSET(fd, &read_mask)) {
FD_ZERO(&pendingfds);
- for (j = 0; j < (int) readfds.fd_count; j++) {
+ for (j = 0; j < (int) readfds.fd_count; ++j) {
register int readfds_handle = readfds.fd_array[j];
no_bits = 1;
if (FD_ISSET(fd, &readfds) && fd_table[fd].flags.read_pending) {
FD_SET(fd, &pendingfds);
- pending++;
+ ++pending;
}
}
#if DEBUG_FDBITS
- for (i = 0; i < maxfd; i++) {
+ for (i = 0; i < maxfd; ++i) {
/* Check each open socket for a handler. */
if (fd_table[i].read_handler) {
assert(readfds.fd_count <= (unsigned int) Biggest_FD);
assert(pendingfds.fd_count <= (unsigned int) Biggest_FD);
- for (j = 0; j < (int) readfds.fd_count; j++) {
+ for (j = 0; j < (int) readfds.fd_count; ++j) {
register int readfds_handle = readfds.fd_array[j];
register int pendingfds_handle = pendingfds.fd_array[j];
register int osfhandle;
F->flags.read_pending = 0;
commUpdateReadBits(fd, NULL);
hdl(fd, F->read_data);
- statCounter.select_fds++;
+ ++ statCounter.select_fds;
if (commCheckUdpIncoming)
comm_select_udp_incoming();
assert(errfds.fd_count <= (unsigned int) Biggest_FD);
- for (j = 0; j < (int) errfds.fd_count; j++) {
+ for (j = 0; j < (int) errfds.fd_count; ++j) {
register int errfds_handle = errfds.fd_array[j];
for ( fd = Biggest_FD; fd; fd-- ) {
F->write_handler = NULL;
commUpdateWriteBits(fd, NULL);
hdl(fd, F->write_data);
- statCounter.select_fds++;
+ ++ statCounter.select_fds;
}
}
}
assert(writefds.fd_count <= (unsigned int) Biggest_FD);
- for (j = 0; j < (int) writefds.fd_count; j++) {
+ for (j = 0; j < (int) writefds.fd_count; ++j) {
register int writefds_handle = writefds.fd_array[j];
no_bits = 1;
F->write_handler = NULL;
commUpdateWriteBits(fd, NULL);
hdl(fd, F->write_data);
- statCounter.select_fds++;
+ ++ statCounter.select_fds;
if (commCheckUdpIncoming)
comm_select_udp_incoming();
struct stat sb;
debugs(5, 0, "examine_select: Examining open file descriptors...");
- for (fd = 0; fd < Squid_MaxFD; fd++) {
+ for (fd = 0; fd < Squid_MaxFD; ++fd) {
FD_ZERO(&read_x);
FD_ZERO(&write_x);
tv.tv_sec = tv.tv_usec = 0;
else
continue;
- statCounter.syscalls.selects++;
+ ++ statCounter.syscalls.selects;
errno = 0;
if (!fstat(fd, &sb)) {
{
if (handler && !FD_ISSET(fd, &global_readfds)) {
FD_SET(fd, &global_readfds);
- nreadfds++;
+ ++nreadfds;
} else if (!handler && FD_ISSET(fd, &global_readfds)) {
FD_CLR(fd, &global_readfds);
- nreadfds--;
+ --nreadfds;
}
}
{
if (handler && !FD_ISSET(fd, &global_writefds)) {
FD_SET(fd, &global_writefds);
- nwritefds++;
+ ++nwritefds;
} else if (!handler && FD_ISSET(fd, &global_writefds)) {
FD_CLR(fd, &global_writefds);
- nwritefds--;
+ --nwritefds;
}
}