From bf0d793b562c409c3aa940e6ffeeabd655dd49e5 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 25 Jan 2023 09:15:26 +0100 Subject: regcomp.c - Use RXp_OFFSp() to access offset data This insulates access to the regexp match offset data so we can fix the define later and move the offset structure into a new struct. The RXp_OFFSp() was introduced in a recent commit to deliberately break anything using RXp_OFFS() directly. It is hard to type deliberately, nothing but the internals should use it. Everything else should use one of the wrappers around it. --- regexp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'regexp.h') diff --git a/regexp.h b/regexp.h index 86b11e94f0..47780e40d2 100644 --- a/regexp.h +++ b/regexp.h @@ -188,13 +188,13 @@ typedef struct regexp { #define RXp_PAREN_NAMES(rx) ((rx)->paren_names) #define RXp_OFFS_START(rx,n) \ - (rx)->offs[(n)].start + RXp_OFFSp(rx)[(n)].start #define RXp_OFFS_END(rx,n) \ - (rx)->offs[(n)].end + RXp_OFFSp(rx)[(n)].end #define RXp_OFFS_VALID(rx,n) \ - ((rx)->offs[(n)].end >= 0 && (rx)->offs[(n)].start >= 0 ) + (RXp_OFFSp(rx)[(n)].end != -1 && RXp_OFFSp(rx)[(n)].start != -1 ) #define RX_OFFS_START(rx_sv,n) RXp_OFFS_START(ReANY(rx_sv),n) #define RX_OFFS_END(rx_sv,n) RXp_OFFS_END(ReANY(rx_sv),n) -- cgit v1.2.1