diff options
| author | 卜部昌平 <shyouhei@ruby-lang.org> | 2026-01-13 11:50:01 +0900 |
|---|---|---|
| committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2026-01-13 11:53:43 +0900 |
| commit | 60cf8598b2f0e9548fd30761276f655569d3daf9 (patch) | |
| tree | a7ffe6e6ec86e67ba7d9961c685193a23c362425 | |
| parent | 9fb9bfab605a6d1edb453f64f4f3d23926e191d0 (diff) | |
[nit] refactor rename inline functions
Pretty sure commit 0f64da9672d88921439f6fdb306d16fece9b9c90 didn't
intend to welcome extension libraries to use these functions.
| -rw-r--r-- | error.c | 4 | ||||
| -rw-r--r-- | include/ruby/internal/core/rtypeddata.h | 8 |
2 files changed, 6 insertions, 6 deletions
@@ -1383,14 +1383,14 @@ rb_unexpected_type(VALUE x, int t) int rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent) { - return rb_typeddata_inherited_p_inline(child, parent); + return rbimpl_typeddata_inherited_p_inline(child, parent); } #undef rb_typeddata_is_kind_of int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type) { - return rb_typeddata_is_kind_of_inline(obj, data_type); + return rbimpl_typeddata_is_kind_of_inline(obj, data_type); } #undef rb_typeddata_is_instance_of diff --git a/include/ruby/internal/core/rtypeddata.h b/include/ruby/internal/core/rtypeddata.h index bf6423f8d2..8c0397d80b 100644 --- a/include/ruby/internal/core/rtypeddata.h +++ b/include/ruby/internal/core/rtypeddata.h @@ -673,24 +673,24 @@ RTYPEDDATA_TYPE(VALUE obj) RBIMPL_ATTR_ARTIFICIAL() RBIMPL_ATTR_NONNULL(()) static inline bool -rb_typeddata_inherited_p_inline(const rb_data_type_t *child, const rb_data_type_t *parent) +rbimpl_typeddata_inherited_p_inline(const rb_data_type_t *child, const rb_data_type_t *parent) { do { if (RB_LIKELY(child == parent)) return true; } while ((child = child->parent) != NULL); return false; } -#define rb_typeddata_inherited_p rb_typeddata_inherited_p_inline +#define rb_typeddata_inherited_p rbimpl_typeddata_inherited_p_inline RBIMPL_ATTR_ARTIFICIAL() RBIMPL_ATTR_NONNULL((2)) static inline bool -rb_typeddata_is_kind_of_inline(VALUE obj, const rb_data_type_t *data_type) +rbimpl_typeddata_is_kind_of_inline(VALUE obj, const rb_data_type_t *data_type) { if (RB_UNLIKELY(!rbimpl_obj_typeddata_p(obj))) return false; return rb_typeddata_inherited_p(RTYPEDDATA_TYPE(obj), data_type); } -#define rb_typeddata_is_kind_of rb_typeddata_is_kind_of_inline +#define rb_typeddata_is_kind_of rbimpl_typeddata_is_kind_of_inline RBIMPL_ATTR_ARTIFICIAL() RBIMPL_ATTR_NONNULL((2)) |
