From 1feda1c2b091b950efcaa481a11fd660efa9e717 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Mon, 22 Jul 2019 17:44:58 +0900 Subject: constify again. Same as last commit, make some fields `const`. include/ruby/ruby.h: * Rasic::klass * RArray::heap::aux::shared_root * RRegexp::src internal.h: * rb_classext_struct::origin_, redefined_class * vm_svar::cref_or_me, lastline, backref, others * vm_throw_data::throw_obj * vm_ifunc::data * MEMO::v1, v2, u3::value While modifying this patch, I found write-barrier miss on rb_classext_struct::redefined_class. Also vm_throw_data::throw_state is only `int` so change the type. --- vm_insnhelper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_insnhelper.h') diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 98aee9d46c..920ea6ac17 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -203,7 +203,7 @@ static inline int THROW_DATA_STATE(const struct vm_throw_data *obj) { VM_ASSERT(THROW_DATA_P(obj)); - return (int)obj->throw_state; + return obj->throw_state; } static inline int @@ -224,7 +224,7 @@ static inline void THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st) { VM_ASSERT(THROW_DATA_P(obj)); - obj->throw_state = (VALUE)st; + obj->throw_state = st; } static inline void -- cgit v1.2.1