Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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

mitchblank
Copy link
Contributor

  • 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

* 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
@@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be integer constants?

@mitchblank
Copy link
Contributor Author

good point, I'll fix that

As per monaka's comment here...
  mruby#175
...changing these initializations of mrb_int values to use integer
constants
@matz
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants