diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-12-04 10:35:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-12-04 10:35:44 +0900 |
commit | d118e7c025adf0221fe16ad3a0d57ba9605fd2a7 (patch) | |
tree | 2208d59c000d855e0ae446cd4449d10f55691347 /node.h | |
parent | f41b4d44f95978dfa97af04af00055dc3fbf7978 (diff) |
Turn nd_type_p into an inline function
Diffstat (limited to 'node.h')
-rw-r--r-- | node.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -193,7 +193,6 @@ typedef struct RNode { #define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT) #define nd_type(n) ((int) (((n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) -#define nd_type_p(n, t) (nd_type((n)) == (t)) #define nd_set_type(n,t) \ rb_node_set_type(n, t) #define nd_init_type(n,t) \ @@ -498,6 +497,11 @@ rb_node_set_type(NODE *n, enum node_type t) return nd_init_type(n, t); } +static inline bool +nd_type_p(const NODE *n, enum node_type t) +{ + return (enum node_type)nd_type(n) == t; +} #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ |