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

Cleanup time_unix.c #389

Merged
merged 1 commit into from Oct 1, 2022
Merged

Cleanup time_unix.c #389

merged 1 commit into from Oct 1, 2022

Conversation

clalancette
Copy link
Contributor

The file was pretty messy. Cleanups:

  1. Remove totally unnecessary #ifdef __cplusplus; that is only necessary in headers.
  2. Remove unnecessary include to ./common.h.
  3. Change WOULD_BE_NEGATIVE to an inline function, which will at least give us some type checking.
  4. Get rid of unnecessary duplicated code for macOS. Most of the time the code was exactly the same.
  5. Make sure to check the return value from clock_gettime.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

The diff is pretty hard to read, but it makes a lot more sense if you just look at the resulting file.

The file was pretty messy.  Cleanups:

1.  Remove totally unnecessary #ifdef __cplusplus; that is
    only necessary in headers.
2.  Remove unnecessary include to ./common.h.
3.  Change WOULD_BE_NEGATIVE to an inline function, which will
    at least give us some type checking.
4.  Get rid of unnecessary duplicated code for macOS.  Most of
    the time the code was exactly the same.
5.  Make sure to check the return value from clock_gettime.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit 2d0c9e2 into rolling Oct 1, 2022
@delete-merged-branch delete-merged-branch bot deleted the clalancette/cleanup-time-unix branch October 1, 2022 12:21
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.

None yet

2 participants