summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 02:46:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-27 02:46:54 +0000
commitece87af00c6e31181b7092980a351929c5421a43 (patch)
tree69f926f26570f7cbe08fe38dca0c011e8051e945 /object.c
parent5615f7636e54d7010a1974bfa79ef2e31a44ffbd (diff)
* string.c (RESIZE_CAPA): check string attribute before modifying
capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] * ext/zlib/zlib.c (zstream_append_input): clear klass for z->input to avoid potential vulnerability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/object.c b/object.c
index eda0114f68..5fd722b338 100644
--- a/object.c
+++ b/object.c
@@ -1118,7 +1118,6 @@ rb_obj_pattern_match(obj1, obj2)
/*
* call-seq:
* sym.to_i => fixnum
- * sym.to_int => fixnum
*
* Returns an integer that is unique for each symbol within a
* particular execution of a program.
@@ -1137,6 +1136,17 @@ sym_to_i(sym)
}
+/* :nodoc: */
+
+static VALUE
+sym_to_int(sym)
+ VALUE sym;
+{
+ rb_warning("treating Symbol as an integer");
+ return sym_to_i(sym);
+}
+
+
/*
* call-seq:
* sym.inspect => string
@@ -2604,7 +2614,7 @@ Init_Object()
rb_undef_method(CLASS_OF(rb_cSymbol), "new");
rb_define_method(rb_cSymbol, "to_i", sym_to_i, 0);
- rb_define_method(rb_cSymbol, "to_int", sym_to_i, 0);
+ rb_define_method(rb_cSymbol, "to_int", sym_to_int, 0);
rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0);
rb_define_method(rb_cSymbol, "to_s", sym_to_s, 0);
rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0);