nocfbot-0016-Normalize-flag-macros-to-bool.txt

text/plain

Filename: nocfbot-0016-Normalize-flag-macros-to-bool.txt
Type: text/plain
Part: 15
Message: Re: Row pattern recognition
From 747b855b0bb586e0d0b6164065376079dc5473c5 Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Tue, 7 Apr 2026 11:32:56 +0900
Subject: [PATCH 16/40] Normalize RPR element flag macros to return bool

---
 src/include/optimizer/rpr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/include/optimizer/rpr.h b/src/include/optimizer/rpr.h
index e78092678bb..360e1bb777f 100644
--- a/src/include/optimizer/rpr.h
+++ b/src/include/optimizer/rpr.h
@@ -44,10 +44,10 @@
 #define RPR_ELEM_ABSORBABLE			0x08	/* absorption judgment point */
 
 /* Accessor macros for RPRPatternElement */
-#define RPRElemIsReluctant(e)			((e)->flags & RPR_ELEM_RELUCTANT)
-#define RPRElemCanEmptyLoop(e)			((e)->flags & RPR_ELEM_EMPTY_LOOP)
-#define RPRElemIsAbsorbableBranch(e)	((e)->flags & RPR_ELEM_ABSORBABLE_BRANCH)
-#define RPRElemIsAbsorbable(e)			((e)->flags & RPR_ELEM_ABSORBABLE)
+#define RPRElemIsReluctant(e)			(((e)->flags & RPR_ELEM_RELUCTANT) != 0)
+#define RPRElemCanEmptyLoop(e)			(((e)->flags & RPR_ELEM_EMPTY_LOOP) != 0)
+#define RPRElemIsAbsorbableBranch(e)	(((e)->flags & RPR_ELEM_ABSORBABLE_BRANCH) != 0)
+#define RPRElemIsAbsorbable(e)			(((e)->flags & RPR_ELEM_ABSORBABLE) != 0)
 #define RPRElemIsVar(e)			((e)->varId <= RPR_VARID_MAX)
 #define RPRElemIsBegin(e)		((e)->varId == RPR_VARID_BEGIN)
 #define RPRElemIsEnd(e)			((e)->varId == RPR_VARID_END)
-- 
2.50.1 (Apple Git-155)