return dst;
if (src)
- while (--n != 0 && *src != '\0')
- *dst++ = *src++;
+ while (--n != 0 && *src != '\0') {
+ *dst++ = *src;
+ ++src;
+ }
*dst = '\0';
return r;
n += 3;
size -= 3;
if (size > 0) {
- *escaped++ = '\\';
- snprintf(escaped, 3, "%02x", (unsigned char) *src++);
+ *escaped = '\\';
+ ++escaped;
+ snprintf(escaped, 3, "%02x", (unsigned char) *src);
+ ++src;
escaped += 2;
}
break;
default:
- *escaped++ = *src++;
+ *escaped = *src;
+ ++escaped;
+ ++src;
++n;
--size;
}
while (*src && size > 1) {
if (*src == '%' && src[1] != '\0' && src[2] != '\0') {
++src;
- tmp[0] = *src++;
- tmp[1] = *src++;
+ tmp[0] = *src;
+ ++src;
+ tmp[1] = *src;
+ ++src;
*dst++ = strtol(tmp, NULL, 16);
} else {
- *dst++ = *src++;
+ *dst = *src;
+ ++dst;
+ ++src;
}
--size;
}
if (!isdigit(*ip_str)) {
return((uint32_t)0);
}
- *ptr++ = *ip_str++;
+ *ptr = *ip_str;
+ ++ptr;
+ ++ip_str;
++count;
}
if (count >= 4 || count == 0) {
size -= 3;
if (size > 0) {
*escaped++ = '\\';
- snprintf(escaped, 3, "%02x", (int) *src++);
+ snprintf(escaped, 3, "%02x", (int) *src);
+ ++src;
escaped += 2;
}
break;
default:
- *escaped++ = *src++;
+ *escaped = *src;
+ ++escaped;
+ ++src;
++n;
--size;
}
size -= 3;
if (size > 0) {
*escaped++ = '\\';
- snprintf(escaped, 3, "%02x", (int) *src++);
+ snprintf(escaped, 3, "%02x", (int) *src);
+ ++src;
escaped += 2;
}
break;
default:
- *escaped++ = *src++;
+ *escaped = *src;
+ ++escaped;
+ ++src;
++n;
--size;
}
size -= 3;
if (size > 0) {
*escaped++ = '\\';
- snprintf(escaped, 3, "%02x", (unsigned char) *src++);
+ snprintf(escaped, 3, "%02x", (unsigned char) *src);
+ ++src;
escaped += 2;
}
break;
default:
- *escaped++ = *src++;
+ *escaped = *src;
+ ++escaped;
+ ++src;
++n;
--size;
}
}
hKey = hKeyNext;
- index++;
+ ++index;
}
if (keys[index] == NULL) {
/* Ignore spaces */
if (xisspace(*cmd)) {
- cmd++;
+ ++cmd;
continue;
}
word = cmd;
while (*cmd) {
- cmd++; /* Skip over this character */
+ ++cmd; /* Skip over this character */
if (xisspace(*cmd)) /* End of argument if space */
break;
WIN32_svcstatusupdate(DWORD svcstate, DWORD WaitHint)
{
if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) {
- svcStatus.dwCheckPoint++;
+ ++svcStatus.dwCheckPoint;
svcStatus.dwWaitHint = WaitHint;
svcStatus.dwCurrentState = svcstate;
SetServiceStatus(svcHandle, &svcStatus);
int optlen = sizeof(opt);
if (s_iInitCount > 0) {
- s_iInitCount++;
+ ++s_iInitCount;
return (0);
} else if (s_iInitCount < 0)
return (s_iInitCount);
}
WIN32_Socks_initialized = 1;
- s_iInitCount++;
+ ++s_iInitCount;
return (s_iInitCount);
}
debugs(52, 3, "urnFindMinRtt");
assert(urls != NULL);
- for (i = 0; NULL != urls[i].url; i++)
- urlcnt++;
+ for (i = 0; NULL != urls[i].url; ++i)
+ ++urlcnt;
debugs(53, 3, "urnFindMinRtt: Counted " << i << " URLs");
return urls;
}
- for (i = 0; i < urlcnt; i++) {
+ for (i = 0; i < urlcnt; ++i) {
u = &urls[i];
debugs(52, 3, "urnFindMinRtt: " << u->host << " rtt=" << u->rtt);
delete rep;
while (xisspace(*s))
- s++;
+ ++s;
urls = urnParseReply(s, urnState->request->method);
- for (i = 0; NULL != urls[i].url; i++)
- urlcnt++;
+ for (i = 0; NULL != urls[i].url; ++i)
+ ++urlcnt;
debugs(53, 3, "urnFindMinRtt: Counted " << i << " URLs");
"<H2>Select URL for %s</H2>\n"
"<TABLE BORDER=\"0\" WIDTH=\"100%%\">\n", e->url(), e->url());
- for (i = 0; i < urlcnt; i++) {
+ for (i = 0; i < urlcnt; ++i) {
u = &urls[i];
debugs(52, 3, "URL {" << u->url << "}");
mb->Printf(
e->replaceHttpReply(rep);
e->complete();
- for (i = 0; i < urlcnt; i++) {
+ for (i = 0; i < urlcnt; ++i) {
safe_free(urls[i].url);
safe_free(urls[i].host);
}
// TODO: Use storeHas() or lock/unlock entry to avoid creating unlocked
// ones.
list[i].flags.cached = storeGetPublic(url, m) ? 1 : 0;
- i++;
+ ++i;
}
debugs(52, 3, "urnParseReply: Found " << i << " URLs");
* We sanity checked wccp_i_see_you.number back in wccpHandleUdp()
*/
- for (loop = 0; loop < (unsigned) ntohl(wccp_i_see_you.number); loop++) {
+ for (loop = 0; loop < (unsigned) ntohl(wccp_i_see_you.number); ++loop) {
assert(loop < WCCP_ACTIVE_CACHES);
if (local_ip > wccp_i_see_you.wccp_cache_entry[loop].ip_addr)
buckets_per_cache = WCCP_BUCKETS / number_caches;
- for (loop = 0; loop < number_caches; loop++) {
+ for (loop = 0; loop < number_caches; ++loop) {
int i;
memcpy(&caches[loop],
&wccp_i_see_you.wccp_cache_entry[loop].ip_addr,
sizeof(*caches));
- for (i = 0; i < buckets_per_cache; i++) {
+ for (i = 0; i < buckets_per_cache; ++i) {
assert(bucket < WCCP_BUCKETS);
- buckets[bucket++] = loop;
+ buckets[bucket] = loop;
+ ++bucket;
}
}
while (bucket < WCCP_BUCKETS) {
- buckets[bucket++] = number_caches - 1;
+ buckets[bucket] = number_caches - 1;
+ ++bucket;
}
wccp_assign_bucket->type = htonl(WCCP_ASSIGN_BUCKET);
for (s = Config.Wccp2.router; s; s = s->next) {
if (!s->s.IsAnyAddr()) {
/* Increment the counter */
- wccp2_numrouters++;
+ ++wccp2_numrouters;
}
}
if (ntohl(tmp) != 0) {
/* search through the list of received-from ip addresses */
- for (num_caches = 0; num_caches < (int) ntohl(tmp); num_caches++) {
+ for (num_caches = 0; num_caches < (int) ntohl(tmp); ++num_caches) {
/* Get a copy of the ip */
memset(&cache_address, 0, sizeof(cache_address)); // Make GCC happy
if (num_caches) {
int cache;
- for (cache = 0, cache_list_ptr = &router_list_ptr->cache_list_head; cache_list_ptr->next; cache_list_ptr = cache_list_ptr->next, cache++) {
+ for (cache = 0, cache_list_ptr = &router_list_ptr->cache_list_head; cache_list_ptr->next; cache_list_ptr = cache_list_ptr->next, ++cache) {
/* add caches */
cache_address = (struct in_addr *) &wccp_packet[offset];
if (num_caches != 0) {
if (total_weight == 0) {
- for (bucket_counter = 0; bucket_counter < WCCP_BUCKETS; bucket_counter++) {
+ for (bucket_counter = 0; bucket_counter < WCCP_BUCKETS; ++bucket_counter) {
buckets[bucket_counter] = (char) (bucket_counter % num_caches);
}
} else {
int cache = -1;
unsigned long per_bucket = total_weight / WCCP_BUCKETS;
- for (bucket_counter = 0; bucket_counter < WCCP_BUCKETS; bucket_counter++) {
+ for (bucket_counter = 0; bucket_counter < WCCP_BUCKETS; ++bucket_counter) {
int n;
unsigned long step;
for (n = num_caches; n; n--) {
- cache++;
+ ++cache;
if (cache >= num_caches)
cache = 0;
if (!weight[cache]) {
- n++;
+ ++n;
continue;
}
cache_list_ptr = &router_list_ptr->cache_list_head;
value = 0;
- for (valuecounter = 0; valuecounter < 64; valuecounter++) {
+ for (valuecounter = 0; valuecounter < 64; ++valuecounter) {
value_element = (struct wccp2_value_element_t *) &wccp_packet[offset];
/* Update the value according the the "correct" formula */
- for (; (value & 0x1741) != value; value++) {
+ for (; (value & 0x1741) != value; ++value) {
assert(value <= 0x1741);
}
value_element->cache_ip = cache_list_ptr->cache_ip;
offset += sizeof(struct wccp2_value_element_t);
- value++;
+ ++value;
/* Assign the next value to the next cache */
}
portlist[i] = p;
- i++;
+ ++i;
port = strsep(&tmp2, ",");
}
handles[0] = handles[1] = -1;
- statCounter.syscalls.sock.sockets++;
+ ++statCounter.syscalls.sock.sockets;
handle0 = localhost;
handle0.SetPort(0);
splayNode *top = NULL;
squid_srandom(time(NULL));
- for (i = 0; i < 100; i++) {
+ for (i = 0; i < 100; ++i) {
I = (intnode *)xcalloc(sizeof(intnode), 1);
I->i = squid_random();
top = top->insert(I, compareintvoid);
/* intnode* */
SplayNode<intnode *> *safeTop = NULL;
- for ( int i = 0; i < 100; i++) {
+ for ( int i = 0; i < 100; ++i) {
intnode *I;
I = new intnode;
I->i = squid_random();
/* intnode */
SplayNode<intnode> *safeTop = NULL;
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; ++i) {
intnode I;
I.i = squid_random();
safeTop = safeTop->insert(I, compareintref);
if (safeTop->finish() != NULL)
exit (1);
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; ++i) {
intnode I;
I.i = squid_random();
int err;
if (s_iInitCount > 0) {
- s_iInitCount++;
+ ++s_iInitCount;
return (0);
} else if (s_iInitCount < 0)
return (s_iInitCount);
return (s_iInitCount);
}
- s_iInitCount++;
+ ++s_iInitCount;
return (s_iInitCount);
}
tok[--len] = '\0';
while (xisspace(*tok))
- tok++;
+ ++tok;
return tok;
} else
if (comment)
while (*comment == ' ' || *comment == '\t')
- comment++;
+ ++comment;
if (!comment || !*comment)
comment = server;
printf("<TR><TH ALIGN=\"left\">Cache Server:</TH><TD><SELECT id=\"server\" NAME=\"server\">\n");
printf("<OPTION VALUE=\"%s\"%s>%s</OPTION>\n", server, (servers || *host) ? "" : " SELECTED", comment);
- servers++;
+ ++servers;
}
if (servers) {
const char *cell = xstrtok(&x, '\t');
while (x && *x == '\t') {
- column_span++;
- x++;
+ ++column_span;
+ ++x;
}
l += snprintf(html + l, sizeof(html) - l, "<%s colspan=\"%d\" align=\"%s\">%s</%s>",
/* record ends */
snprintf(html + l, sizeof(html) - l, "</tr>\n");
next_is_header = is_header && strstr(buf, "\t\t");
- table_line_num++;
+ ++table_line_num;
return html;
}
value = args[1] + 2;
} else if (argc > 2) {
value = args[2];
- args++;
+ ++args;
argc--;
} else
value = "";
#endif
break;
}
- args++;
+ ++args;
argc--;
}
if ((q = strchr(t, '=')) == NULL)
continue;
- *q++ = '\0';
+ *q = '\0';
+ ++q;
rfc1738_unescape(t);
cd.type = CacheDir::CDT_DISKD;
else
cd.type = CacheDir::CDT_OTHER;
- offset++;
+ ++offset;
}
// extract base directory
(int)subs[offset].rm_eo,
line+subs[offset].rm_so );
cd.base = strdup( line+subs[offset].rm_so );
- offset++;
+ ++offset;
// extract size information
line[ subs[offset].rm_eo ] = '\0';
(int)subs[offset].rm_eo,
line+subs[offset].rm_so );
cd.size = strtoul( line+subs[offset].rm_so, 0, 10 );
- offset++;
+ ++offset;
// extract 1st level directories
line[ subs[offset].rm_eo ] = '\0';
(int)subs[offset].rm_eo,
line+subs[offset].rm_so );
cd.level[0] = strtoul( line+subs[offset].rm_so, 0, 10 );
- offset++;
+ ++offset;
// extract 2nd level directories
line[ subs[offset].rm_eo ] = '\0';
(int)subs[offset].rm_eo,
line+subs[offset].rm_so );
cd.level[1] = strtoul( line+subs[offset].rm_so, 0, 10 );
- offset++;
+ ++offset;
cachedir.push_back( cd );
}
} else if ( debug & 0x02 ) {
fprintf( stderr, "# creating %s\n", filename );
}
- *t++ = '/';
+ *t = '/';
+ ++t;
}
// create file
if ( strlen(s) != testlen ) return false;
size_t i=0;
- while ( i<testlen && isxdigit(s[i]) ) i++;
+ while ( i<testlen && isxdigit(s[i]) )
+ ++i;
return (i==testlen);
}
FILE* rfile;
// program basename
- if ( (ptr = strrchr(argv[0],'/')) == NULL ) ptr=argv[0];
- else ptr++;
+ if ( (ptr = strrchr(argv[0],'/')) == NULL )
+ ptr=argv[0];
+ else
+ ++ptr;
::programname = ptr;
// extract commandline parameters
#define LINESIZE 512
char line[LINESIZE];
while ( fgets( line, LINESIZE, rfile ) != NULL ) {
- lineno++;
+ ++lineno;
int len = strlen(line)-1;
if ( len+2 >= LINESIZE ) {
fprintf( stderr, "%s:%lu: line too long, sorry.\n",
}
} else {
// colon used, port is extra
- *colon++ = 0;
+ *colon = 0;
+ ++colon;
if ( convertHostname(optarg,serverHost) == -1 ) {
fprintf( stderr, "unable to resolve host %s!\n", optarg );
exit(1);
unsigned count(0);
for ( tail = head; tail != NULL; tail = tail->next ) {
- if ( count++ ) printf( "#%22u", count );
+ if ( count++ )
+ printf( "#%22u", count );
#if defined(LINUX) && putc==_IO_putc
// I HATE BROKEN LINUX HEADERS!
// purge.o(.text+0x1040): undefined reference to `_IO_putc'