From 63ca1f755ee45bca6b89c81d8cce59199968ac91 Mon Sep 17 00:00:00 2001 From: "Dr.-Ing. Amilcar Do Carmo Lucas" Date: Tue, 24 Oct 2017 10:36:26 +0200 Subject: [PATCH] Tools: Replay: fix compiler warning for printf string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit format ‘%ld’ expects argument of type ‘long int’, but argument has type ‘uint64_t {aka long long unsigned int}’ --- Tools/Replay/DataFlashFileReader.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tools/Replay/DataFlashFileReader.cpp b/Tools/Replay/DataFlashFileReader.cpp index 7941c20913..697157dc35 100644 --- a/Tools/Replay/DataFlashFileReader.cpp +++ b/Tools/Replay/DataFlashFileReader.cpp @@ -6,6 +6,11 @@ #include #include #include +#include + +#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)