Fix wrong format string in alarm_pool_dump_key (#437)

Fixes the following warning when building for host

```
[...]/pico-sdk/src/common/pico_time/time.c: In function 'alarm_pool_dump_key':
[...]/pico-sdk/src/common/pico_time/time.c:282:15: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
     printf("%ld", to_us_since_boot(get_entry(pool, id)->target));
             ~~^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             %I64d
```
This commit is contained in:
Jonathan Reichelt Gjertsen 2021-05-24 23:32:31 +02:00 committed by GitHub
parent 060123dc8d
commit b2832b3acb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
*/ */
#include <limits.h> #include <limits.h>
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "pico.h" #include "pico.h"
@ -278,7 +279,7 @@ static void alarm_pool_dump_key(pheap_node_id_t id, void *user_data) {
#if PICO_ON_DEVICE #if PICO_ON_DEVICE
printf("%lld (hi %02x)", to_us_since_boot(get_entry(pool, id)->target), *get_entry_id_high(pool, id)); printf("%lld (hi %02x)", to_us_since_boot(get_entry(pool, id)->target), *get_entry_id_high(pool, id));
#else #else
printf("%ld", to_us_since_boot(get_entry(pool, id)->target)); printf(PRIu64, to_us_since_boot(get_entry(pool, id)->target));
#endif #endif
} }