diff --git a/ChangeLog b/ChangeLog index fe1281b1b2..f97e535551 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Jun 6 14:11:11 2011 NAKAMURA Usaku + + * 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 * include/ruby/defines.h (rb_inifinity, rb_nan): export for Windows. diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 5de537a939..5613088f89 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -2241,7 +2241,7 @@ offset_to_sec(VALUE vof, int *rof) 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 @@ offset_to_sec(VALUE vof, int *rof) 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]; }