aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-04 16:25:01 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-04 16:25:01 +0000
commit1cf97f54981f1bef0371ee15d6972f98ee3ff994 (patch)
tree3b8cdc92251f10fede07a7e70746ebf181655672 /internal.h
parent815c00f74197ff82e92d09b74673fb642a4a5032 (diff)
downloadruby-1cf97f54981f1bef0371ee15d6972f98ee3ff994.tar.gz
* internal.h (ST2FIX): new macro to convert st_index_t to Fixnum.
a hash value of Object might be Bignum, but it causes many troubles expecially the Object is used as a key of a hash. so I've gave up to do so. * array.c (rb_ary_hash): use above macro. * bignum.c (rb_big_hash): ditto. * hash.c (rb_obj_hash, rb_hash_hash): ditto. * numeric.c (rb_dbl_hash): ditto. * proc.c (proc_hash): ditto. * re.c (rb_reg_hash, match_hash): ditto. * string.c (rb_str_hash_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 54e5d3bc78..de435ac16b 100644
--- a/internal.h
+++ b/internal.h
@@ -323,6 +323,9 @@ ntz_intptr(uintptr_t x) {
VALUE rb_int128t2big(int128_t n);
#endif
+#define ST2FIX(h) LONG2FIX((long)(h))
+
+
/* arguments must be Fixnum */
static inline VALUE
rb_fix_mul_fix(VALUE x, VALUE y)