You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/01/06 12:08:31 UTC
svn commit: r1896747 - /apr/apr/trunk/include/apr_ring.h
Author: ylavic
Date: Thu Jan 6 12:08:30 2022
New Revision: 1896747
URL: http://svn.apache.org/viewvc?rev=1896747&view=rev
Log:
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.
Modified:
apr/apr/trunk/include/apr_ring.h
Modified: apr/apr/trunk/include/apr_ring.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_ring.h?rev=1896747&r1=1896746&r2=1896747&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_ring.h (original)
+++ apr/apr/trunk/include/apr_ring.h Thu Jan 6 12:08:30 2022
@@ -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)
/**