summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-01-06 12:08:30 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-01-06 12:08:30 +0000
commitec4d14fc823c037a84a955dc1e87b061f425ee7c (patch)
treea27109adde0364a367eaae704f959b9e2d04290a
parentdf4b87a52642f82fbbd05febedf0ba83a30a43f9 (diff)
downloadlibapr-ec4d14fc823c037a84a955dc1e87b061f425ee7c.tar.gz
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
-rw-r--r--include/apr_ring.h12
1 files 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)
/**