* object.c (rb_check_to_integer): backported for range_step.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-04-05 01:05:03 +00:00
parent 5e50b5099f
commit a6eded88af
4 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Sat Apr 5 10:05:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* object.c (rb_check_to_integer): backported for range_step.
Fri Apr 4 05:57:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Apr 4 05:57:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/net/pop.rb (Net::POP3::do_finish): clear @n_mails and * lib/net/pop.rb (Net::POP3::do_finish): clear @n_mails and

View file

@ -319,6 +319,7 @@ VALUE rb_class_real _((VALUE));
VALUE rb_class_inherited_p _((VALUE, VALUE)); VALUE rb_class_inherited_p _((VALUE, VALUE));
VALUE rb_convert_type _((VALUE,int,const char*,const char*)); VALUE rb_convert_type _((VALUE,int,const char*,const char*));
VALUE rb_check_convert_type _((VALUE,int,const char*,const char*)); VALUE rb_check_convert_type _((VALUE,int,const char*,const char*));
VALUE rb_check_to_integer _((VALUE, const char *));
VALUE rb_to_int _((VALUE)); VALUE rb_to_int _((VALUE));
VALUE rb_Integer _((VALUE)); VALUE rb_Integer _((VALUE));
VALUE rb_Float _((VALUE)); VALUE rb_Float _((VALUE));

View file

@ -2199,6 +2199,19 @@ rb_to_integer(val, method)
return v; return v;
} }
VALUE
rb_check_to_integer(VALUE val, const char *method)
{
VALUE v;
if (FIXNUM_P(val)) return val;
v = convert_type(val, "Integer", method, Qfalse);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
return Qnil;
}
return v;
}
VALUE VALUE
rb_to_int(val) rb_to_int(val)
VALUE val; VALUE val;

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6" #define RUBY_VERSION "1.8.6"
#define RUBY_RELEASE_DATE "2008-04-03" #define RUBY_RELEASE_DATE "2008-04-05"
#define RUBY_VERSION_CODE 186 #define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080403 #define RUBY_RELEASE_CODE 20080405
#define RUBY_PATCHLEVEL 5000 #define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6 #define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4 #define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 3 #define RUBY_RELEASE_DAY 5
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];