diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-17 09:24:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-17 09:24:13 +0000 |
commit | e77ddaf0d1d421da2f655832a45f237558e23115 (patch) | |
tree | b20cb859d6ca1886f525e4b7477601bb1a5fbe31 /ext/digest/digest.c | |
parent | 7b66963f61609fe8edea2380cba43289381a43d7 (diff) | |
download | ruby-e77ddaf0d1d421da2f655832a45f237558e23115.tar.gz |
* array.c (rb_ary_delete): element comparison might change array
size. [ruby-dev:24273]
* parse.y: make ruby parser reentrant. merge ripper parser to the
real one. this change makes ruby require bison.
* file.c (rb_file_truncate): clear stdio buffer before truncating
the file. [ruby-dev:24191]
* ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
which might return singleton class. [ruby-dev:24202]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/digest.c')
-rw-r--r-- | ext/digest/digest.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c index c570055322..70f986327a 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -149,8 +149,8 @@ rb_digest_base_copy(copy, obj) if (copy == obj) return copy; rb_check_frozen(copy); - algo = get_digest_base_metadata(CLASS_OF(copy)); - if (algo != get_digest_base_metadata(CLASS_OF(obj))) { + algo = get_digest_base_metadata(rb_obj_class(copy)); + if (algo != get_digest_base_metadata(rb_obj_class(obj))) { rb_raise(rb_eTypeError, "wrong argument class"); } Data_Get_Struct(obj, void, pctx1); @@ -168,7 +168,7 @@ rb_digest_base_update(self, str) void *pctx; StringValue(str); - algo = get_digest_base_metadata(CLASS_OF(self)); + algo = get_digest_base_metadata(rb_obj_class(self)); Data_Get_Struct(self, void, pctx); algo->update_func(pctx, RSTRING(str)->ptr, RSTRING(str)->len); @@ -201,7 +201,7 @@ rb_digest_base_digest(self) size_t len; VALUE str; - algo = get_digest_base_metadata(CLASS_OF(self)); + algo = get_digest_base_metadata(rb_obj_class(self)); Data_Get_Struct(self, void, pctx1); len = algo->ctx_size; @@ -232,7 +232,7 @@ rb_digest_base_hexdigest(self) size_t len; VALUE str; - algo = get_digest_base_metadata(CLASS_OF(self)); + algo = get_digest_base_metadata(rb_obj_class(self)); Data_Get_Struct(self, void, pctx1); len = algo->ctx_size; @@ -261,10 +261,10 @@ rb_digest_base_equal(self, other) VALUE klass; VALUE str1, str2; - klass = CLASS_OF(self); + klass = rb_obj_class(self); algo = get_digest_base_metadata(klass); - if (CLASS_OF(other) == klass) { + if (rb_obj_class(other) == klass) { void *pctx1, *pctx2; Data_Get_Struct(self, void, pctx1); |