Skip to content

Cleanup time_unix.c#389

Merged
clalancette merged 1 commit intorollingfrom
clalancette/cleanup-time-unix
Oct 1, 2022
Merged

Cleanup time_unix.c#389
clalancette merged 1 commit intorollingfrom
clalancette/cleanup-time-unix

Conversation

@clalancette
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants