From 2f2f92b73ed49d5de6884945d14beaee45965739 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 29 Sep 2014 12:17:47 +0000 Subject: digest: no check for hidden objects * ext/digest/digest.c (get_digest_base_metadata): metadata objects are hidden from ruby level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/digest/digest.c | 2 ++ ext/digest/rmd160/rmd160init.c | 2 ++ ext/digest/sha1/sha1init.c | 2 ++ ext/digest/sha2/sha2init.c | 2 ++ 4 files changed, 8 insertions(+) (limited to 'ext/digest') diff --git a/ext/digest/digest.c b/ext/digest/digest.c index c5e1ca5da6..b177881cd0 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -518,6 +518,8 @@ get_digest_base_metadata(VALUE klass) if (NIL_P(p)) rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby"); +#undef RUBY_UNTYPED_DATA_WARNING +#define RUBY_UNTYPED_DATA_WARNING 0 Data_Get_Struct(obj, rb_digest_metadata_t, algo); switch (algo->api_version) { diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c index c214ca9f33..d88a3d3e69 100644 --- a/ext/digest/rmd160/rmd160init.c +++ b/ext/digest/rmd160/rmd160init.c @@ -38,6 +38,8 @@ Init_rmd160() cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base); +#undef RUBY_UNTYPED_DATA_WARNING +#define RUBY_UNTYPED_DATA_WARNING 0 rb_ivar_set(cDigest_RMD160, rb_intern("metadata"), Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&rmd160)); } diff --git a/ext/digest/sha1/sha1init.c b/ext/digest/sha1/sha1init.c index d52eef58b3..d3dbab4b50 100644 --- a/ext/digest/sha1/sha1init.c +++ b/ext/digest/sha1/sha1init.c @@ -38,6 +38,8 @@ Init_sha1() cDigest_SHA1 = rb_define_class_under(mDigest, "SHA1", cDigest_Base); +#undef RUBY_UNTYPED_DATA_WARNING +#define RUBY_UNTYPED_DATA_WARNING 0 rb_ivar_set(cDigest_SHA1, rb_intern("metadata"), Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha1)); } diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c index 13df4bcb78..d627beba6e 100644 --- a/ext/digest/sha2/sha2init.c +++ b/ext/digest/sha2/sha2init.c @@ -52,5 +52,7 @@ Init_sha2() rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \ Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha##bitlen)); +#undef RUBY_UNTYPED_DATA_WARNING +#define RUBY_UNTYPED_DATA_WARNING 0 FOREACH_BITLEN(DEFINE_ALGO_CLASS) } -- cgit v1.2.1