From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Packard Subject: [PATCH 12/18] dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACK Date: Fri, 13 Dec 2013 17:25:24 -0800 Message-ID: <1386984330-26074-13-git-send-email-keithp@keithp.com> References: <1386984330-26074-1-git-send-email-keithp@keithp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386984330-26074-1-git-send-email-keithp@keithp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: mesa-dev@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org It is the maximum number of back buffers, but the name is confusing and is easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make the intended usage a bit clearer. Signed-off-by: Keith Packard --- src/glx/dri3_glx.c | 4 ++-- src/glx/dri3_priv.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index ea20138..c26d6e5 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -1065,7 +1065,7 @@ dri3_find_back(xcb_connection_t *c, struct dri3_drawable *priv) for (;;) { - for (b = 0; b < DRI3_MAX_BACK; b++) { + for (b = 0; b < DRI3_NUM_BACK; b++) { int id = DRI3_BACK_ID(b); struct dri3_buffer *buffer = priv->buffers[id]; @@ -1181,7 +1181,7 @@ dri3_free_buffers(__DRIdrawable *driDrawable, switch (buffer_type) { case dri3_buffer_back: first_id = DRI3_BACK_ID(0); - n_id = DRI3_MAX_BACK; + n_id = DRI3_NUM_BACK; break; case dri3_buffer_front: first_id = DRI3_FRONT_ID; diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index 4c5579e..49a13ba 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -143,14 +143,14 @@ struct dri3_context __DRIcontext *driContext; }; -#define DRI3_MAX_BACK 2 +#define DRI3_NUM_BACK 2 #define DRI3_BACK_ID(i) (i) -#define DRI3_FRONT_ID (DRI3_MAX_BACK) +#define DRI3_FRONT_ID (DRI3_NUM_BACK) static inline int dri3_buf_id_next(int buf_id) { - if (buf_id == DRI3_MAX_BACK - 1) + if (buf_id == DRI3_NUM_BACK - 1) return 0; return buf_id + 1; } @@ -159,7 +159,7 @@ static inline int dri3_buf_id_prev(int buf_id) { if (buf_id == 0) - return DRI3_MAX_BACK - 1; + return DRI3_NUM_BACK - 1; return buf_id - 1; } @@ -172,7 +172,7 @@ dri3_pixmap_buf_id(enum dri3_buffer_type buffer_type) return DRI3_FRONT_ID; } -#define DRI3_NUM_BUFFERS (1 + DRI3_MAX_BACK) +#define DRI3_NUM_BUFFERS (1 + DRI3_NUM_BACK) struct dri3_drawable { __GLXDRIdrawable base; -- 1.8.4.4