Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

make mrb_time_local() use the same types as other methods in time.c #175

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

mitchblank commented May 21, 2012

  • mrb_time_gm() uses mrb_int
  • Same for mrb_time_initialize()
  • The parameters to time_mktime() are mrb_int, and that's what these values are passed to

So I don't see why mrb_time_local() works on mrb_float instead. Lets make
it consistent with the other methods defined in time.c

make mrb_time_local() arguments consistent
* mrb_time_gm() uses mrb_int
* Same for mrb_time_initialize()
* The parameters to time_mktime() are mrb_int, and that's what these values are passed to

So I don't see why mrb_time_local() works on mrb_float instead.  Lets make
it consistent with the other methods defined in time.c

@monaka monaka commented on an outdated diff May 21, 2012

@@ -281,10 +281,10 @@ struct mrb_time*
static mrb_value
mrb_time_local(mrb_state *mrb, mrb_value self)
{
- mrb_float ayear = 0.0, amonth = 1.0, aday = 1.0, ahour = 0.0,
+ mrb_int ayear = 0.0, amonth = 1.0, aday = 1.0, ahour = 0.0,
@monaka

monaka May 21, 2012

Contributor

should be integer constants?

Contributor

mitchblank commented May 21, 2012

good point, I'll fix that

Use integer constants to initialize mrb_int
As per monaka's comment here...
  #175
...changing these initializations of mrb_int values to use integer
constants
Owner

matz commented May 21, 2012

fixed in 826386a.

@matz matz closed this May 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment