зеркало из https://github.com/github/ruby.git
Hoisted out rb_digest_namespace
This commit is contained in:
Родитель
c030cec7ca
Коммит
74c6662af5
|
@ -49,3 +49,10 @@ rb_digest_##name##_finish(void *ctx, unsigned char *ptr) \
|
|||
{ \
|
||||
return name##_Final(ptr, ctx); \
|
||||
}
|
||||
|
||||
static inline VALUE
|
||||
rb_digest_namespace(void)
|
||||
{
|
||||
rb_require("digest");
|
||||
return rb_path2class("Digest");
|
||||
}
|
||||
|
|
|
@ -51,12 +51,10 @@ Init_md5(void)
|
|||
{
|
||||
VALUE mDigest, cDigest_Base, cDigest_MD5;
|
||||
|
||||
rb_require("digest");
|
||||
|
||||
#if 0
|
||||
mDigest = rb_define_module("Digest"); /* let rdoc know */
|
||||
#endif
|
||||
mDigest = rb_path2class("Digest");
|
||||
mDigest = rb_digest_namespace();
|
||||
cDigest_Base = rb_path2class("Digest::Base");
|
||||
|
||||
cDigest_MD5 = rb_define_class_under(mDigest, "MD5", cDigest_Base);
|
||||
|
|
|
@ -49,12 +49,10 @@ Init_rmd160(void)
|
|||
{
|
||||
VALUE mDigest, cDigest_Base, cDigest_RMD160;
|
||||
|
||||
rb_require("digest");
|
||||
|
||||
#if 0
|
||||
mDigest = rb_define_module("Digest"); /* let rdoc know */
|
||||
#endif
|
||||
mDigest = rb_path2class("Digest");
|
||||
mDigest = rb_digest_namespace();
|
||||
cDigest_Base = rb_path2class("Digest::Base");
|
||||
|
||||
cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base);
|
||||
|
|
|
@ -53,12 +53,10 @@ Init_sha1(void)
|
|||
{
|
||||
VALUE mDigest, cDigest_Base, cDigest_SHA1;
|
||||
|
||||
rb_require("digest");
|
||||
|
||||
#if 0
|
||||
mDigest = rb_define_module("Digest"); /* let rdoc know */
|
||||
#endif
|
||||
mDigest = rb_path2class("Digest");
|
||||
mDigest = rb_digest_namespace();
|
||||
cDigest_Base = rb_path2class("Digest::Base");
|
||||
|
||||
cDigest_SHA1 = rb_define_class_under(mDigest, "SHA1", cDigest_Base);
|
||||
|
|
|
@ -42,11 +42,9 @@ Init_sha2(void)
|
|||
|
||||
FOREACH_BITLEN(DECLARE_ALGO_CLASS)
|
||||
|
||||
rb_require("digest");
|
||||
|
||||
id_metadata = rb_intern_const("metadata");
|
||||
|
||||
mDigest = rb_path2class("Digest");
|
||||
mDigest = rb_digest_namespace();
|
||||
cDigest_Base = rb_path2class("Digest::Base");
|
||||
|
||||
#define DEFINE_ALGO_CLASS(bitlen) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче