5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-01-05 15:38:29 -04:00

Tools: Replay: fix compiler warning for printf string

format ‘%ld’ expects argument of type ‘long int’, but argument has type ‘uint64_t {aka long long unsigned int}’
This commit is contained in:
Dr.-Ing. Amilcar Do Carmo Lucas 2017-10-24 10:36:26 +02:00 committed by Peter Barker
parent e3320ca953
commit 63ca1f755e

View File

@ -6,6 +6,11 @@
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <cinttypes>
#ifndef PRIu64
#define PRIu64 "llu"
#endif
// flogged from AP_Hal_Linux/system.cpp; we don't want to use stopped clock here
uint64_t now() {
@ -22,8 +27,8 @@ DataFlashFileReader::~DataFlashFileReader()
{
const uint64_t micros = now();
const uint64_t delta = micros - start_micros;
::printf("Replay counts: %ld bytes %u entries\n", bytes_read, message_count);
::printf("Replay rates: %ld bytes/second %ld messages/second\n", bytes_read*1000000/delta, message_count*1000000/delta);
::printf("Replay counts: %" PRIu64 " bytes %u entries\n", bytes_read, message_count);
::printf("Replay rates: %" PRIu64 " bytes/second %" PRIu64 " messages/second\n", bytes_read*1000000/delta, message_count*1000000/delta);
}
bool DataFlashFileReader::open_log(const char *logfile)