From bace42effc5c76e7dcfa3189abae51fe2b9ebfe2 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 2 May 2017 16:17:33 +0200 Subject: [PATCH] fix format warnings for uint32_t values --- example/sm_pairing_central.c | 4 ++-- example/sm_pairing_peripheral.c | 5 +++-- src/classic/hfp.c | 2 +- src/hci_transport_h4.c | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/example/sm_pairing_central.c b/example/sm_pairing_central.c index 34f5c51b9..4b1d138db 100644 --- a/example/sm_pairing_central.c +++ b/example/sm_pairing_central.c @@ -166,11 +166,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe sm_just_works_confirm(sm_event_just_works_request_get_handle(packet)); break; case SM_EVENT_NUMERIC_COMPARISON_REQUEST: - printf("Confirming numeric comparison: %u\n", sm_event_numeric_comparison_request_get_passkey(packet)); + printf("Confirming numeric comparison: %"PRIu32"\n", sm_event_numeric_comparison_request_get_passkey(packet)); sm_numeric_comparison_confirm(sm_event_passkey_display_number_get_handle(packet)); break; case SM_EVENT_PASSKEY_DISPLAY_NUMBER: - printf("Display Passkey: %u\n", sm_event_passkey_display_number_get_passkey(packet)); + printf("Display Passkey: %"PRIu32"\n", sm_event_passkey_display_number_get_passkey(packet)); break; case HCI_EVENT_LE_META: diff --git a/example/sm_pairing_peripheral.c b/example/sm_pairing_peripheral.c index 96e577223..aa833ef5e 100644 --- a/example/sm_pairing_peripheral.c +++ b/example/sm_pairing_peripheral.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "sm_pairing_peripheral.h" #include "btstack.h" @@ -161,11 +162,11 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack sm_just_works_confirm(sm_event_just_works_request_get_handle(packet)); break; case SM_EVENT_NUMERIC_COMPARISON_REQUEST: - printf("Confirming numeric comparison: %u\n", sm_event_numeric_comparison_request_get_passkey(packet)); + printf("Confirming numeric comparison: %"PRIu32"\n", sm_event_numeric_comparison_request_get_passkey(packet)); sm_numeric_comparison_confirm(sm_event_passkey_display_number_get_handle(packet)); break; case SM_EVENT_PASSKEY_DISPLAY_NUMBER: - printf("Display Passkey: %u\n", sm_event_passkey_display_number_get_passkey(packet)); + printf("Display Passkey: %"PRIu32"\n", sm_event_passkey_display_number_get_passkey(packet)); break; case SM_EVENT_IDENTITY_CREATED: sm_event_identity_created_get_identity_address(packet, addr); diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 34f84624e..6db9aa08a 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -1253,7 +1253,7 @@ static void parse_sequence(hfp_connection_t * hfp_connection){ break; case HFP_CMD_SUPPORTED_FEATURES: hfp_connection->remote_supported_features = btstack_atoi((char*)hfp_connection->line_buffer); - log_info("Parsed supported feature %d\n", hfp_connection->remote_supported_features); + log_info("Parsed supported feature %d\n", (int) hfp_connection->remote_supported_features); break; case HFP_CMD_AVAILABLE_CODECS: log_info("Parsed codec %s\n", hfp_connection->line_buffer); diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 5977bfcae..afb295684 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -45,6 +45,8 @@ * Created by Matthias Ringwald on 4/29/09. */ +#include + #include "btstack_config.h" #include "btstack_debug.h" @@ -155,7 +157,7 @@ static enum { #endif static int hci_transport_h4_set_baudrate(uint32_t baudrate){ - log_info("hci_transport_h4_set_baudrate %u", baudrate); + log_info("hci_transport_h4_set_baudrate %"PRIu32, baudrate); return btstack_uart->set_baudrate(baudrate); }