mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 22:45:39 +00:00
Make a few helper macros which will return lengths of regions rather than
requiring an isc_region_t to fill in. Use these macros in a few places.
This commit is contained in:
@@ -34,7 +34,7 @@ isc_bufferlist_usedcount(isc_bufferlist_t *bl)
|
||||
buffer = ISC_LIST_HEAD(*bl);
|
||||
while (buffer != NULL) {
|
||||
REQUIRE(ISC_BUFFER_VALID(buffer));
|
||||
length += buffer->used;
|
||||
length += ISC_BUFFER_USEDCOUNT(buffer);
|
||||
buffer = ISC_LIST_NEXT(buffer, link);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ isc_bufferlist_availablecount(isc_bufferlist_t *bl)
|
||||
buffer = ISC_LIST_HEAD(*bl);
|
||||
while (buffer != NULL) {
|
||||
REQUIRE(ISC_BUFFER_VALID(buffer));
|
||||
length += (buffer->length - buffer->used);
|
||||
length += ISC_BUFFER_AVAILABLECOUNT(buffer);
|
||||
buffer = ISC_LIST_NEXT(buffer, link);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user