Skip to content

Commit

Permalink
* ext/date/date_core.c (valid_jd_sub): need to convert from VALUE to
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
unak committed Jun 6, 2011
1 parent 2527886 commit dcb105b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/date/date_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
}

Expand Down

0 comments on commit dcb105b

Please sign in to comment.