Constify type and typed_flag in RTypedData

These must not be changed once initialized.
This commit is contained in:
Nobuyoshi Nakada 2023-04-27 12:32:39 +09:00
parent dd406c5a91
commit b0cb54a378
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -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;