ruby-changes:35654
From: nobu <ko1@a...>
Date: Mon, 29 Sep 2014 21:18:02 +0900 (JST)
Subject: [ruby-changes:35654] nobu:r47736 (trunk): digest: no check for hidden objects
nobu 2014-09-29 21:17:47 +0900 (Mon, 29 Sep 2014) New Revision: 47736 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47736 Log: digest: no check for hidden objects * ext/digest/digest.c (get_digest_base_metadata): metadata objects are hidden from ruby level. Modified files: trunk/ext/digest/digest.c trunk/ext/digest/rmd160/rmd160init.c trunk/ext/digest/sha1/sha1init.c trunk/ext/digest/sha2/sha2init.c Index: ext/digest/digest.c =================================================================== --- ext/digest/digest.c (revision 47735) +++ ext/digest/digest.c (revision 47736) @@ -518,6 +518,8 @@ get_digest_base_metadata(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/digest/digest.c#L518 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) { Index: ext/digest/rmd160/rmd160init.c =================================================================== --- ext/digest/rmd160/rmd160init.c (revision 47735) +++ ext/digest/rmd160/rmd160init.c (revision 47736) @@ -38,6 +38,8 @@ Init_rmd160() https://github.com/ruby/ruby/blob/trunk/ext/digest/rmd160/rmd160init.c#L38 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)); } Index: ext/digest/sha1/sha1init.c =================================================================== --- ext/digest/sha1/sha1init.c (revision 47735) +++ ext/digest/sha1/sha1init.c (revision 47736) @@ -38,6 +38,8 @@ Init_sha1() https://github.com/ruby/ruby/blob/trunk/ext/digest/sha1/sha1init.c#L38 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)); } Index: ext/digest/sha2/sha2init.c =================================================================== --- ext/digest/sha2/sha2init.c (revision 47735) +++ ext/digest/sha2/sha2init.c (revision 47736) @@ -52,5 +52,7 @@ Init_sha2() https://github.com/ruby/ruby/blob/trunk/ext/digest/sha2/sha2init.c#L52 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) } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/