summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-27 12:32:39 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-27 12:32:39 +0900
commitb0cb54a378f2c588a050dafe6db69cb4cdd2637e (patch)
tree7d37f9f69fb0f40c8f699a62195275ed8c4a0f89 /include
parentdd406c5a911d2f4a16ce97016666760713540185 (diff)
downloadruby-b0cb54a378f2c588a050dafe6db69cb4cdd2637e.tar.gz
Constify `type` and `typed_flag` in `RTypedData`
These must not be changed once initialized.
Diffstat (limited to 'include')
-rw-r--r--include/ruby/internal/core/rtypeddata.h6
1 files changed, 2 insertions, 4 deletions
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;