summaryrefslogtreecommitdiff
path: root/ext/digest
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest')
-rw-r--r--ext/digest/digest.c4
-rw-r--r--ext/digest/md5/md5init.c4
-rw-r--r--ext/digest/rmd160/rmd160init.c4
-rw-r--r--ext/digest/sha1/sha1init.c4
-rw-r--r--ext/digest/sha2/sha2init.c4
5 files changed, 10 insertions, 10 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index dd78739b80..b8144f3706 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -28,11 +28,11 @@ get_digest_base_metadata(VALUE klass)
VALUE obj;
algo_t *algo;
- if (rb_cvar_defined(klass, id_metadata) == Qfalse) {
+ if (rb_ivar_defined(klass, id_metadata) == Qfalse) {
return NULL;
}
- obj = rb_cvar_get(klass, id_metadata);
+ obj = rb_ivar_get(klass, id_metadata);
Data_Get_Struct(obj, algo_t, algo);
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c
index 781e8ea4c9..6fdf6e0a26 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -31,6 +31,6 @@ Init_md5()
rb_define_const(cDigest_MD5, "DIGEST_LENGTH", INT2NUM(MD5_DIGEST_LENGTH));
rb_define_const(cDigest_MD5, "BLOCK_LENGTH", INT2NUM(MD5_BLOCK_LENGTH));
- rb_cvar_set(cDigest_MD5, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, &md5), Qtrue);
+ rb_ivar_set(cDigest_MD5, rb_intern("metadata"),
+ Data_Wrap_Struct(rb_cObject, 0, 0, &md5));
}
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index 896756723b..585ba05c33 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -34,6 +34,6 @@ Init_rmd160()
id_metadata = rb_intern("metadata");
- rb_cvar_set(cDigest_RMD160, id_metadata,
- Data_Wrap_Struct(rb_cObject, 0, 0, &rmd160), Qtrue);
+ rb_ivar_set(cDigest_RMD160, id_metadata,
+ Data_Wrap_Struct(rb_cObject, 0, 0, &rmd160));
}
diff --git a/ext/digest/sha1/sha1init.c b/ext/digest/sha1/sha1init.c
index bd92c59406..e56f18bf63 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -31,6 +31,6 @@ Init_sha1()
rb_define_const(cDigest_SHA1, "DIGEST_LENGTH", INT2NUM(SHA1_DIGEST_LENGTH));
rb_define_const(cDigest_SHA1, "BLOCK_LENGTH", INT2NUM(SHA1_BLOCK_LENGTH));
- rb_cvar_set(cDigest_SHA1, rb_intern("metadata"),
- Data_Wrap_Struct(rb_cObject, 0, 0, &sha1), Qtrue);
+ rb_ivar_set(cDigest_SHA1, rb_intern("metadata"),
+ Data_Wrap_Struct(rb_cObject, 0, 0, &sha1));
}
diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c
index cc815e7f14..c5a16ab4df 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -41,8 +41,8 @@ Init_sha2()
rb_define_const(cDigest_SHA##bitlen, "DIGEST_LENGTH", INT2NUM(SHA##bitlen##_DIGEST_LENGTH)); \
rb_define_const(cDigest_SHA##bitlen, "BLOCK_LENGTH", INT2NUM(SHA##bitlen##_BLOCK_LENGTH)); \
\
- rb_cvar_set(cDigest_SHA##bitlen, id_metadata, \
- Data_Wrap_Struct(rb_cObject, 0, 0, &sha##bitlen), Qtrue);
+ rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
+ Data_Wrap_Struct(rb_cObject, 0, 0, &sha##bitlen));
FOREACH_BITLEN(DEFINE_ALGO_CLASS)
}