From b5d30947382b4e7e7b6a6f6fd1021a9231bf5239 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 3 May 2016 21:46:28 -0300 Subject: [PATCH] AP_ADC: fix warning on printf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp: In function ‘void show_timing()’: ../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=] hal.console->printf("timing: mint=%lu maxt=%lu avg=%lu\n", mint, maxt, totalt/count); ^ ../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t {aka unsigned int}’ [-Wformat=] ../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t {aka unsigned int}’ [-Wformat=] --- libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp b/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp index d97c2c8fd3..0fbbb9a7ac 100644 --- a/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp +++ b/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp @@ -58,7 +58,7 @@ static void show_timing() count++; } while ((AP_HAL::millis() - start_time) < 5000); - hal.console->printf("timing: mint=%lu maxt=%lu avg=%lu\n", mint, maxt, totalt/count); + hal.console->printf("timing: mint=%u maxt=%u avg=%u\n", mint, maxt, totalt/count); } static void show_data()