diff options
author | Tomek Mrugalski <tomek@isc.org> | 2022-01-19 20:14:16 +0100 |
---|---|---|
committer | Tomek Mrugalski <tomek@isc.org> | 2022-01-20 12:04:28 +0100 |
commit | f6b8f48d1665c4487dedbcfa4dca435a0d67ddeb (patch) | |
tree | 19926f31f56890bc8c7f5d3bc5b2e2c16b96794e /server/leasechain.c | |
parent | 429a56d73c0f9f2edf400fd6313850a3ce4fd809 (diff) | |
download | isc-dhcp-f6b8f48d1665c4487dedbcfa4dca435a0d67ddeb.tar.gz |
[#189] Whitespace fixes in opened files
Diffstat (limited to 'server/leasechain.c')
-rw-r--r-- | server/leasechain.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/server/leasechain.c b/server/leasechain.c index 12f88597..7ccc30be 100644 --- a/server/leasechain.c +++ b/server/leasechain.c @@ -30,7 +30,7 @@ * \page leasechain structures overview * * A brief description of the leasechain structures - * + * * This file provides additional data structures for a leasecain to * provide faster access to leases on the queues associated with a pool * than a linear walk. Each pool has a set of queues: active, free, backup, @@ -55,11 +55,11 @@ * | next |->| next |->NULL * NULL<- | prev |<-| prev | * +-------+ +-------+ - * + * * The linked list is maintained in an ordered state. Inserting an entry is * accomplished by doing a binary search on the array to find the proper place * in the list and then updating the pointers in the linked list to include the - * new entry. The entry is added into the array by copying the remainder of + * new entry. The entry is added into the array by copying the remainder of * the array to provide space for the new entry. * Removing an entry is the reverse. * The arrays for the queues will be pre-allocated but not all of them will be @@ -142,7 +142,7 @@ lc_get_next(struct leasechain *lc, struct lease *lp) { * Given a potential range of the array to insert the lease into this routine * will recursively examine the range to find the proper place in which to * insert the lease. - * + * * \param lc The leasechain to add the lease to * \param lp The lease to insert * \param min The minium index of the potential range for insertion @@ -150,7 +150,7 @@ lc_get_next(struct leasechain *lc, struct lease *lp) { * * \return The index of the array entry to insert the lease */ -size_t +size_t lc_binary_search_insert_point(struct leasechain *lc, struct lease *lp, size_t min, size_t max) @@ -168,7 +168,7 @@ lc_binary_search_insert_point(struct leasechain *lc, return (lc_binary_search_insert_point(lc, lp, min, mid_index - 1)); } else if ((lc->list[mid_index]->sort_time < lp->sort_time) || - ((lc->list[mid_index]->sort_time == lp->sort_time) && + ((lc->list[mid_index]->sort_time == lp->sort_time) && (lc->list[mid_index]->sort_tiebreaker < lp->sort_tiebreaker))) { if (mid_index == max) { /* insert in mid_index + 1 as sort_time is smaller */ @@ -189,7 +189,7 @@ lc_binary_search_insert_point(struct leasechain *lc, * * Given a potential range of the array to search this routine * will recursively examine the range to find the proper lease - * + * * \param lc The leasechain to check * \param lp The lease to find * \param min The minium index of the search range @@ -220,13 +220,13 @@ lc_binary_search_lease(struct leasechain *lc, if (mid_index == min) { /* lease not found */ return (SIZE_MAX); - } + } /* try the lower half of the list */ return (lc_binary_search_lease(lc, lp, min, mid_index - 1)); } else if ((lc->list[mid_index]->sort_time < lp->sort_time) || ((lc->list[mid_index]->sort_time == lp->sort_time) && (lc->list[mid_index]->sort_tiebreaker < lp->sort_tiebreaker))) { - /* try the upper half of the list */ + /* try the upper half of the list */ return (lc_binary_search_lease(lc, lp, mid_index + 1, max)); } @@ -253,7 +253,7 @@ lc_binary_search_lease(struct leasechain *lc, /* Are we done with this range? */ if ((i == min) || - ((lc->list[i]->sort_time != lp->sort_time) || + ((lc->list[i]->sort_time != lp->sort_time) || ((lc->list[i]->sort_time == lp->sort_time) && (lc->list[i]->sort_tiebreaker != lp->sort_tiebreaker)))) { break; @@ -263,7 +263,7 @@ lc_binary_search_lease(struct leasechain *lc, /* Check out entries above the mid_index */ if (mid_index < max) { - /* We will break out of the loop if we either go past the + /* We will break out of the loop if we either go past the * canddiates or hit the end of the range when i == max. */ for (i = mid_index + 1; i <= max; i++) { @@ -304,7 +304,7 @@ lc_grow_chain(struct leasechain *lc) { void *p; size_t temp_size; - if (lc->growth == 0) + if (lc->growth == 0) temp_size = lc->total + LC_GROWTH_DELTA; else temp_size = lc->total + lc->growth; @@ -366,7 +366,7 @@ lc_link_lcp(struct leasechain *lc, struct lease *lp, size_t n) { sizeof(struct lease *) * (lc->nelem-n)); } - /* clean any stale pointer info from this position before calling + /* clean any stale pointer info from this position before calling * lease_reference as it won't work if pointer is not NULL */ lc->list[n] = NULL; @@ -380,7 +380,7 @@ lc_link_lcp(struct leasechain *lc, struct lease *lp, size_t n) { } /*! - * + * * \brief Insert the lease at the specified position in both the lease chain * and the linked list * @@ -452,7 +452,7 @@ lc_check_lc_sort_order(struct leasechain *lc) { log_debug("LC check sort %s:%d", MDL); for (i = 0; i < lc->nelem; i++ ) { if ((lc->list[i]->sort_time < t) || - ((lc->list[i]->sort_time == t) && + ((lc->list[i]->sort_time == t) && (lc->list[i]->tiebreaker < tiebreaker))) { if (i > 0) { print_lease(lc->list[i-1]); @@ -476,7 +476,7 @@ lc_check_lc_sort_order(struct leasechain *lc) { * The sort_time is set by the caller while the sort_tiebreaker is set here * The value doesn't much matter as long as it prvoides a way to have different * values in most of the leases. - * + * * When choosing a value for tiebreak we choose: * 0 for the first lease in the queue * 0 if the lease is going to the end of the queue with a sort_time greater @@ -488,7 +488,7 @@ lc_check_lc_sort_order(struct leasechain *lc) { * During startup when we can take advantage of the fact that leases may already * be sorted and so check the end of the list to see if we can simply add the * lease to the end. - * + * * \param lc The leasechain in which to insert the lease * \param lp The lease to insert * |