1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-11-27 09:08:29 +00:00
parent 0ebec8cf72
commit 2451d735a7
3 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sat Nov 27 18:08:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]
Sat Nov 27 17:57:08 2010 Tanaka Akira <akr@fsij.org>
* resolv.rb (Resolv::DNS): use the same DNS server when retry using

View file

@ -19,6 +19,10 @@ class TestTime < Test::Unit::TestCase
assert_equal(Time.utc(2000,2,10), Time.new(2000,2,9, 13,0,0, -3600*11))
assert_equal(Time.utc(2000,2,10), Time.new(2000,2,10, 11,0,0, "+11:00"))
assert_equal(Rational(1,2), Time.new(2000,2,10, 11,0,5.5, "+11:00").subsec)
bug4090 = '[ruby-dev:42631]'
tm = [2001,2,28,23,59,30]
t = Time.new(*tm, "-12:00")
assert_equal([2001,2,28,23,59,30,-43200], [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.gmt_offset], bug4090)
end
def test_time_add()

2
time.c
View file

@ -853,7 +853,7 @@ static const char *find_time_t(struct tm *tptr, int utc_p, time_t *tp);
static struct vtm *localtimew(wideval_t timew, struct vtm *result);
static int leap_year_p(long y);
#define leap_year_v_p(y) leap_year_p(NUM2LONG(mod(v, INT2FIX(400))))
#define leap_year_v_p(y) leap_year_p(NUM2LONG(mod((y), INT2FIX(400))))
#ifdef HAVE_GMTIME_R
#define rb_gmtime_r(t, tm) gmtime_r(t, tm)