Skip to content

Commit

Permalink
plugin: sys_time: Set right suffixes to uint64_t constants.
Browse files Browse the repository at this point in the history
Issue #156.
  • Loading branch information
vooon committed Oct 9, 2014
1 parent 3f4b765 commit 19bb0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mavros/src/plugins/sys_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ class SystemTimePlugin : public MavRosPlugin {
uint64_t now_ms = ros::Time::now().toNSec() / 1000000;

// date -d @1234567890: Sat Feb 14 02:31:30 MSK 2009
const bool fcu_time_valid = mtime.time_unix_usec > 1234567890L * 1000000;
const bool ros_time_valid = now_ms > 1234567890L * 1000;
const bool fcu_time_valid = mtime.time_unix_usec > 1234567890ULL * 1000000;
const bool ros_time_valid = now_ms > 1234567890ULL * 1000;

int64_t offset_us = (now_ms - mtime.time_boot_ms) * 1000;
int64_t dt = offset_us - time_offset_us;
Expand Down

2 comments on commit 19bb0a3

@mhkabir
Copy link
Member

@mhkabir mhkabir commented on 19bb0a3 Oct 9, 2014

Choose a reason for hiding this comment

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

What's the difference between LLU and ULL?

@vooon
Copy link
Member Author

@vooon vooon commented on 19bb0a3 Oct 9, 2014

Choose a reason for hiding this comment

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

ULL: unsigned long long i.e. uint64_t. And fast googling shows that LLU not work on some compilers.

Please sign in to comment.