CPUInfo: example fix travis warning

missing function declaration
implicit cast
some style fix
This commit is contained in:
Pierre Kancir 2017-04-13 13:34:26 +02:00 committed by Francisco Ferreira
parent eb4298ca3e
commit c73584c9b8

View File

@ -8,6 +8,9 @@
#include <AP_HAL/AP_HAL.h>
#include <AP_Common/AP_Common.h>
void setup();
void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
void setup() {
@ -24,9 +27,9 @@ static void show_sizes(void)
hal.console->printf("bool : %lu\n", (unsigned long)sizeof(bool));
hal.console->printf("void* : %lu\n", (unsigned long)sizeof(void *));
hal.console->printf("printing NaN: %f\n", sqrt(-1.0f));
hal.console->printf("printing +Inf: %f\n", 1.0f/0.0f);
hal.console->printf("printing -Inf: %f\n", -1.0f/0.0f);
hal.console->printf("printing NaN: %f\n", (double)sqrtf(-1.0f));
hal.console->printf("printing +Inf: %f\n", (double)(1.0f/0.0f));
hal.console->printf("printing -Inf: %f\n", (double)(-1.0f/0.0f));
}
#define TENTIMES(x) do { x; x; x; x; x; x; x; x; x; x; } while (0)