From b0cb54a378f2c588a050dafe6db69cb4cdd2637e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 27 Apr 2023 12:32:39 +0900 Subject: Constify `type` and `typed_flag` in `RTypedData` These must not be changed once initialized. --- include/ruby/internal/core/rtypeddata.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/ruby/internal/core/rtypeddata.h b/include/ruby/internal/core/rtypeddata.h index 9d91a3e3f1..1abf965305 100644 --- a/include/ruby/internal/core/rtypeddata.h +++ b/include/ruby/internal/core/rtypeddata.h @@ -354,16 +354,14 @@ struct RTypedData { * data. This roughly resembles a Ruby level class (apart from method * definition etc.) */ - const rb_data_type_t *type; + const rb_data_type_t *const type; /** * This has to be always 1. * * @internal - * - * Why, then, this is not a const ::VALUE? */ - VALUE typed_flag; + const VALUE typed_flag; /** Pointer to the actual C level struct that you want to wrap. */ void *data; -- cgit v1.2.1