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

Concerns about seconds_between_years(), and one minor warning #15

Open
rdiez opened this issue May 19, 2017 · 0 comments
Open

Concerns about seconds_between_years(), and one minor warning #15

rdiez opened this issue May 19, 2017 · 0 comments

Comments

@rdiez
Copy link
Contributor

rdiez commented May 19, 2017

First of all, thanks for pulling in my changes indirectly in the recent pull request.

I am a little worried about seconds_between_years(). It only does the "> 2400" check etc. on 'left_year', and not on the 'right_year'. Variable 'increment' is assigned before the left year is adjusted in that way. It may all be OK, but then I would add a comment about why it is so.

Variable 'increment' is not really necessary in that routine. I would split the 2 conditions below into 3 conditions:

  1. if left_year == right_year, then there is apparently nothing to do.
  2. if left_year > right_year
  3. if left_year < right_year (actually the final 'else')

I would then clean up the trailing whitespace all over the file. It shows
in read when checking in with Git.

I am getting a warning about static function check_tm() not being used in release builds. Maybe you could surround its declaration with "#ifndef NDEBUG".

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

No branches or pull requests

1 participant