ruby-changes:19889
From: usa <ko1@a...>
Date: Mon, 6 Jun 2011 14:12:23 +0900 (JST)
Subject: [ruby-changes:19889] usa:r31936 (trunk): * ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to
usa 2011-06-06 14:12:17 +0900 (Mon, 06 Jun 2011) New Revision: 31936 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31936 Log: * ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to double. * ext/date/date_core.c (offset_to_sec): get rid of a compiler warning. Modified files: trunk/ChangeLog trunk/ext/date/date_core.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31935) +++ ChangeLog (revision 31936) @@ -1,3 +1,10 @@ +Mon Jun 6 14:11:11 2011 NAKAMURA Usaku <usa@r...> + + * ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to + double. + + * ext/date/date_core.c (offset_to_sec): get rid of a compiler warning. + Mon Jun 6 14:09:08 2011 NAKAMURA Usaku <usa@r...> * include/ruby/defines.h (rb_inifinity, rb_nan): export for Windows. Index: ext/date/date_core.c =================================================================== --- ext/date/date_core.c (revision 31935) +++ ext/date/date_core.c (revision 31936) @@ -2241,7 +2241,7 @@ n = NUM2DBL(vof) * DAY_IN_SECONDS; if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS) return 0; - *rof = round(n); + *rof = (int)round(n); if (*rof != n) rb_warning("fraction of offset is ignored"); return 1; @@ -2303,7 +2303,8 @@ static VALUE valid_jd_sub(int argc, VALUE *argv, VALUE klass, int need_jd) { - valid_sg(argv[1]); + double sg = NUM2DBL(argv[1]); + valid_sg(sg); return argv[0]; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/