diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-06 05:12:17 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-06 05:12:17 +0000 |
commit | 3c9e6c7abb6c4029f9e610321f49f1b4ddcd80b9 (patch) | |
tree | e011222e045107bb8195ccedfbbc6ecf749d1ac3 /ext | |
parent | f0bd1c21740c062a94a8cd734646a922717cdc89 (diff) | |
download | ruby-3c9e6c7abb6c4029f9e610321f49f1b4ddcd80b9.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/date/date_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
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]; } |