Skip to content

Commit

Permalink
* ext/digest/sha1/sha1ossl.h: libssl 0.9.8c-3 defines no
Browse files Browse the repository at this point in the history
  SHA_BLOCK_LENGTH.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Oct 11, 2006
1 parent cd58f33 commit fedfa6e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Wed Oct 11 14:56:10 2006 Yukihiro Matsumoto <[email protected]>

* ext/digest/sha1/sha1ossl.h: libssl 0.9.8c-3 defines no
SHA_BLOCK_LENGTH.

Wed Oct 11 14:03:31 2006 Akinori MUSHA <[email protected]>

* ext/digest/digest.c (rb_digest_base_reset, Init_digest): Add
Expand Down
34 changes: 21 additions & 13 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,24 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
return ary;
}

VALUE
each_internal(VALUE ary)
{
long i;

for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
return ary;
}

static VALUE
iter_unlock(VALUE ary)
{
FL_UNSET(ary, ARY_TMPLOCK);
return ary;
}

/*
* call-seq:
* array.each {|item| block } -> array
Expand All @@ -1245,12 +1263,9 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
VALUE
rb_ary_each(VALUE ary)
{
long i;

RETURN_ENUMERATOR(ary, 0, 0);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during each */
rb_ensure(each_internal, ary, iter_unlock, ary);
return ary;
}

Expand Down Expand Up @@ -1623,13 +1638,6 @@ sort_internal(VALUE ary)
return ary;
}

static VALUE
sort_unlock(VALUE ary)
{
FL_UNSET(ary, ARY_TMPLOCK);
return ary;
}

/*
* call-seq:
* array.sort! -> array
Expand All @@ -1652,7 +1660,7 @@ rb_ary_sort_bang(VALUE ary)
rb_ary_modify(ary);
if (RARRAY_LEN(ary) > 1) {
FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
rb_ensure(sort_internal, ary, sort_unlock, ary);
rb_ensure(sort_internal, ary, iter_unlock, ary);
}
return ary;
}
Expand Down
4 changes: 4 additions & 0 deletions ext/digest/sha1/sha1ossl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

#define SHA1_CTX SHA_CTX

#ifdef SHA_BLOCK_LENGTH
#define SHA1_BLOCK_LENGTH SHA_BLOCK_LENGTH
#else
#define SHA1_BLOCK_LENGTH SHA_CBLOCK
#endif
#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH

void SHA1_Finish(SHA1_CTX *ctx, char *buf);
Expand Down

0 comments on commit fedfa6e

Please sign in to comment.