Skip to content

Move php_phongo_new_datetime_from_utcdatetime() into UTCDateTime.c #339

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

Merged
merged 1 commit into from
Jun 27, 2016

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jun 21, 2016

This function was only used by UTCDateTime::toDateTime(), so it does not need to be in php_phongo.c. Additionally, this commit removes the platform-specific spprintf patterns in favor of the portable PRId64 pattern.

This PR depends on #338.

@derickr
Copy link
Contributor

derickr commented Jun 27, 2016

I don't mind the function being moved, but I do not agree to the inlining of its contents. And, from what I understood, PRId64, is C99 only. I am not sure if that's what PHP's base line is.

@jmikola
Copy link
Member Author

jmikola commented Jun 27, 2016

I don't mind the function being moved, but I do not agree to the inlining of its contents.

I didn't see the point for just a few lines of code that is only used in one method.

And, from what I understood, PRId64, is C99 only. I am not sure if that's what PHP's base line is.

We already use PRId64 elsewhere in the extension. AFAIK, libmongoc is C99.

EDIT: libmongoc is C89. They do define these macros if needed, though.

@derickr
Copy link
Contributor

derickr commented Jun 27, 2016

LGTM

This function was only used by UTCDateTime::toDateTime(), so it does not need to be in php_phongo.c. Additionally, this commit removes the platform-specific spprintf patterns in favor of the portable PRId64 pattern.
@jmikola jmikola force-pushed the 1.1-UTCDateTime-toDateTime-refactor branch from a9a2291 to 0d0b14b Compare June 27, 2016 15:53
@jmikola jmikola merged commit 0d0b14b into mongodb:v1.1 Jun 27, 2016
jmikola added a commit that referenced this pull request Jun 27, 2016
@jmikola jmikola deleted the 1.1-UTCDateTime-toDateTime-refactor branch June 27, 2016 16:08
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.

2 participants