From: Willy Tarreau Date: Fri, 15 Jun 2018 13:18:17 +0000 (+0200) Subject: MINOR: buffer: use c_head() instead of buffer_wrap_sub(c->buf, p-o) X-Git-Tag: v1.9-dev1~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50227f9b88b0aafacffbded499b87e32ab2e4127;p=thirdparty%2Fhaproxy.git MINOR: buffer: use c_head() instead of buffer_wrap_sub(c->buf, p-o) This way we don't need o anymore. --- diff --git a/include/common/buffer.h b/include/common/buffer.h index dde0fcc63f..6f3ab26a19 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -61,14 +61,6 @@ void buffer_dump(FILE *o, struct buffer *b, int from, int to); /***** FIXME: OLD API BELOW *****/ -/* Normalizes a pointer after a subtract */ -static inline char *buffer_wrap_sub(const struct buffer *buf, char *ptr) -{ - if (ptr < buf->data) - ptr += buf->size; - return ptr; -} - /* Normalizes a pointer after an addition */ static inline char *buffer_wrap_add(const struct buffer *buf, char *ptr) { diff --git a/include/proto/channel.h b/include/proto/channel.h index 2cbbf96863..b84ccc9e83 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -823,7 +823,7 @@ static inline int co_getchr(struct channel *chn) return -2; return -1; } - return *buffer_wrap_sub(chn->buf, chn->buf->p - chn->buf->o); + return *co_head(chn); }