mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
f0bd1c2174
commit
3c9e6c7abb
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Mon Jun 6 14:11:11 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Mon Jun 6 14:09:08 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* include/ruby/defines.h (rb_inifinity, rb_nan): export for Windows.
|
* include/ruby/defines.h (rb_inifinity, rb_nan): export for Windows.
|
||||||
|
|
|
@ -2241,7 +2241,7 @@ offset_to_sec(VALUE vof, int *rof)
|
||||||
n = NUM2DBL(vof) * DAY_IN_SECONDS;
|
n = NUM2DBL(vof) * DAY_IN_SECONDS;
|
||||||
if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
|
if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
|
||||||
return 0;
|
return 0;
|
||||||
*rof = round(n);
|
*rof = (int)round(n);
|
||||||
if (*rof != n)
|
if (*rof != n)
|
||||||
rb_warning("fraction of offset is ignored");
|
rb_warning("fraction of offset is ignored");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2303,7 +2303,8 @@ offset_to_sec(VALUE vof, int *rof)
|
||||||
static VALUE
|
static VALUE
|
||||||
valid_jd_sub(int argc, VALUE *argv, VALUE klass, int need_jd)
|
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];
|
return argv[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue