From: Ted Lemon Date: Tue, 19 Oct 1999 15:33:17 +0000 (+0000) Subject: Get rid of broken BUFFER_BYTES_AVAIL macro, replace it with new macros. X-Git-Tag: BCTEL_SPECIAL_19991124~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88be0390f19b6ad4e9aad65211029a5fe2cf5b99;p=thirdparty%2Fdhcp.git Get rid of broken BUFFER_BYTES_AVAIL macro, replace it with new macros. --- diff --git a/includes/omapip/buffer.h b/includes/omapip/buffer.h index 5b844519c..20149ee90 100644 --- a/includes/omapip/buffer.h +++ b/includes/omapip/buffer.h @@ -48,10 +48,15 @@ typedef struct _omapi_buffer { the buffer data structure. */ } omapi_buffer_t; -#define BUFFER_BYTES_AVAIL(x) \ - (((x) -> head < (x) -> tail \ - ? (x) -> tail - (x) -> head \ - : sizeof ((x) -> buf) - ((x) -> head - (x) -> tail)) - 1) +#define BUFFER_BYTES_FREE(x) \ + ((x) -> tail > (x) -> head \ + ? sizeof ((x) -> buf) - ((x) -> tail - (x) -> head) \ + : (x) -> head - (x) -> tail) + +#define BYTES_IN_BUFFER(x) \ + ((x) -> tail > (x) -> head \ + ? (x) -> tail - (x) -> head - 1 \ + : sizeof ((x) -> buf) - ((x) -> head - (x) -> tail) - 1) isc_result_t omapi_connection_require (omapi_object_t *, unsigned); isc_result_t omapi_connection_copyout (unsigned char *,