From ec4d14fc823c037a84a955dc1e87b061f425ee7c Mon Sep 17 00:00:00 2001 From: ylavic Date: Thu, 6 Jan 2022 12:08:30 +0000 Subject: apr_ring: Follow up to r1896535: Use APR_RING_{FIRST,LAST} macros. hp->{next,prev} are APR_RING_{FIRST,LAST}(hp), so use them to make APR_RING_SPLICE_{HEAD,TAIL}() read better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896747 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index f09f2c02f..7280245e1 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -285,9 +285,9 @@ */ #define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) do { \ APR_RING_PREV((ep1), link) = APR_RING_SENTINEL((hp), elem, link);\ - APR_RING_NEXT((epN), link) = (hp)->next; \ - APR_RING_PREV((hp)->next, link) = (epN); \ - (hp)->next = (ep1); \ + APR_RING_NEXT((epN), link) = APR_RING_FIRST((hp)); \ + APR_RING_PREV(APR_RING_FIRST((hp)), link) = (epN); \ + APR_RING_FIRST((hp)) = (ep1); \ } while (0) /** @@ -301,9 +301,9 @@ */ #define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) do { \ APR_RING_NEXT((epN), link) = APR_RING_SENTINEL((hp), elem, link);\ - APR_RING_PREV((ep1), link) = (hp)->prev; \ - APR_RING_NEXT((hp)->prev, link) = (ep1); \ - (hp)->prev = (epN); \ + APR_RING_PREV((ep1), link) = APR_RING_LAST((hp)); \ + APR_RING_NEXT(APR_RING_LAST((hp)), link) = (ep1); \ + APR_RING_LAST((hp)) = (epN); \ } while (0) /** -- cgit v1.2.1