analyze: use more logical variable names

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-07-08 17:03:12 +02:00
parent 1e82461875
commit 12271887db

View file

@ -86,17 +86,16 @@ int prepare_data(void)
int do_counting(void) int do_counting(void)
{ {
struct range_t *range_p; struct range_t *range_p;
unsigned int i, j, k, m, block_size; unsigned int i, j, k, l, block_size;
i = j = m = 0;
range_p = ranges; range_p = ranges;
/* Walk through ranges */ /* Walk through ranges */
for (k = 0; k < num_ranges; k++) { for (i = j = k = l = 0; i < num_ranges; i++) {
/* Count IPs in use */ /* Count IPs in use */
for (; leases[i] < range_p->last_ip for (j = j; leases[j] < range_p->last_ip
&& (unsigned long) i < num_leases; i++) { && (unsigned long) j < num_leases; j++) {
if (leases[i] < range_p->first_ip) { if (leases[j] < range_p->first_ip) {
continue; continue;
} }
/* IP with in range */ /* IP with in range */
@ -107,9 +106,9 @@ int do_counting(void)
} }
/* Count touched IPs */ /* Count touched IPs */
for (; touches[j] < range_p->last_ip for (k = k; touches[k] < range_p->last_ip
&& (unsigned long) j < num_touches; j++) { && (unsigned long) k < num_touches; k++) {
if (touches[j] < range_p->first_ip) { if (touches[k] < range_p->first_ip) {
continue; continue;
} }
/* IP with in range */ /* IP with in range */
@ -121,9 +120,9 @@ int do_counting(void)
/* Count backup IPs */ /* Count backup IPs */
if (0 < num_backups) { if (0 < num_backups) {
for (; backups[m] < range_p->last_ip for (; backups[l] < range_p->last_ip
&& (unsigned long) m < num_touches; m++) { && (unsigned long) l < num_touches; l++) {
if (touches[m] < range_p->first_ip) { if (touches[l] < range_p->first_ip) {
continue; continue;
} }
/* IP with in range */ /* IP with in range */
@ -144,12 +143,12 @@ int do_counting(void)
/* Go backwards one step so that not even a one IP will be /* Go backwards one step so that not even a one IP will be
* missed. This is possibly always unnecessary. */ * missed. This is possibly always unnecessary. */
if (i) {
i--;
}
if (j) { if (j) {
j--; j--;
} }
if (k) {
k--;
}
range_p++; range_p++;
} }