CPUInfo: cast result of sizeof to unsigned long

That fix works when size_t is 32 or 64 bits.
This commit is contained in:
Gustavo Jose de Sousa 2016-05-18 10:33:37 -03:00 committed by Lucas De Marchi
parent 2410575d6c
commit de96ca95a6
1 changed files with 7 additions and 7 deletions

View File

@ -18,13 +18,13 @@ void setup() {
static void show_sizes(void)
{
hal.console->println("Type sizes:");
hal.console->printf("char : %lu\n", sizeof(char));
hal.console->printf("short : %lu\n", sizeof(short));
hal.console->printf("int : %lu\n", sizeof(int));
hal.console->printf("long : %lu\n", sizeof(long));
hal.console->printf("long long : %lu\n", sizeof(long long));
hal.console->printf("bool : %lu\n", sizeof(bool));
hal.console->printf("void* : %lu\n", sizeof(void *));
hal.console->printf("char : %lu\n", (unsigned long)sizeof(char));
hal.console->printf("short : %lu\n", (unsigned long)sizeof(short));
hal.console->printf("int : %lu\n", (unsigned long)sizeof(int));
hal.console->printf("long : %lu\n", (unsigned long)sizeof(long));
hal.console->printf("long long : %lu\n", (unsigned long)sizeof(long long));
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);