Linux: in printf cast uint64_t to unsigned long long

When printing a uint64_t type using %llu, this works on a 32bit
system, but on a 64bit machine uint64_t is an unsigned long.

The compiler complains about unmatching types.

The time times in PX4 should likely have been unsigned long long
and not uint64_t as that type changes per architecture.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-03-19 10:13:44 -07:00
parent 83df879f90
commit 1b4b8bb856
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1657,7 +1657,7 @@ Mavlink::display_status()
{
if (_rstatus.heartbeat_time > 0) {
printf("\tGCS heartbeat:\t%llu us ago\n", hrt_elapsed_time(&_rstatus.heartbeat_time));
printf("\tGCS heartbeat:\t%llu us ago\n", (unsigned long long)hrt_elapsed_time(&_rstatus.heartbeat_time));
}
printf("\tmavlink chan: #%u\n", _channel);