summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-03 12:01:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-03 12:01:13 +0000
commitb80d5f14df01ac626a42668f40ede3724e4425ef (patch)
tree67b9d3d515a70d0f5c739511c53157568f7f3377
parent292c39098da3d6c9036eabcb9f8a5f7b07c86ab0 (diff)
* hash.c (rb_check_hash_type): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--hash.c8
-rw-r--r--include/ruby/intern.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a3322ff1d..e1588da10d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Aug 3 21:01:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_check_hash_type): added.
+
Tue Aug 3 20:30:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* bignum.c (rb_big_eq): never equal to infinity.
diff --git a/hash.c b/hash.c
index 84d9eb3aec..8bba586dfb 100644
--- a/hash.c
+++ b/hash.c
@@ -418,6 +418,12 @@ to_hash(VALUE hash)
return rb_convert_type(hash, T_HASH, "Hash", "to_hash");
}
+VALUE
+rb_check_hash_type(VALUE hash)
+{
+ return rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");
+}
+
/*
* call-seq:
* Hash.try_convert(obj) -> hash or nil
@@ -432,7 +438,7 @@ to_hash(VALUE hash)
static VALUE
rb_hash_s_try_convert(VALUE dummy, VALUE hash)
{
- return rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");
+ return rb_check_hash_type(hash);
}
static int
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index c977a4bfd5..748df322b7 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -406,6 +406,7 @@ VALUE rb_gc_start(void);
#define Init_stack(addr) ruby_init_stack(addr)
/* hash.c */
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
+VALUE rb_check_hash_type(VALUE);
void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
VALUE rb_hash(VALUE);
VALUE rb_hash_new(void);