fix warnings for log_info/printf

This commit is contained in:
Matthias Ringwald 2020-11-30 11:59:26 +01:00
parent c15d10d569
commit e883851f1d
5 changed files with 8 additions and 8 deletions

View File

@ -242,7 +242,7 @@ int fs_open_custom(struct fs_file *file, const char *name){
if (*name != '/') return 0; if (*name != '/') return 0;
uint32_t file_size = btstack_atoi(&name[1]); uint32_t file_size = btstack_atoi(&name[1]);
if (file_size > 0) { if (file_size > 0) {
printf("Serving '%s' with %u bytes\n", name, file_size); printf("Serving '%s' with %"PRIu32" bytes\n", name, file_size);
/* initialize fs_file correctly */ /* initialize fs_file correctly */
memset(file, 0, sizeof(struct fs_file)); memset(file, 0, sizeof(struct fs_file));
file->len = file_size; file->len = file_size;

View File

@ -69,7 +69,7 @@
#define REMOTE_SERVICE 0x1111 #define REMOTE_SERVICE 0x1111
// Fixed passkey - used with sm_pairing_peripheral. Passkey is random in general // Fixed passkey - used with sm_pairing_peripheral. Passkey is random in general
#define FIXED_PASSKEY 123456 #define FIXED_PASSKEY 123456U
static btstack_packet_callback_registration_t hci_event_callback_registration; static btstack_packet_callback_registration_t hci_event_callback_registration;
@ -237,7 +237,7 @@ static void sm_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
break; break;
case SM_EVENT_PASSKEY_INPUT_NUMBER: case SM_EVENT_PASSKEY_INPUT_NUMBER:
printf("Passkey Input requested\n"); printf("Passkey Input requested\n");
printf("Sending fixed passkey %"PRIu32"\n", FIXED_PASSKEY); printf("Sending fixed passkey %"PRIu32"\n", (uint32_t) FIXED_PASSKEY);
sm_passkey_input(sm_event_passkey_input_number_get_handle(packet), FIXED_PASSKEY); sm_passkey_input(sm_event_passkey_input_number_get_handle(packet), FIXED_PASSKEY);
break; break;
case SM_EVENT_PAIRING_COMPLETE: case SM_EVENT_PAIRING_COMPLETE:

View File

@ -741,7 +741,7 @@ uint8_t a2dp_source_reconfigure_stream_sampling_frequency(uint16_t avdtp_cid, ui
config |= (AVDTP_SBC_16000 << 4); config |= (AVDTP_SBC_16000 << 4);
break; break;
default: default:
log_error("Unsupported sampling frequency %u", sampling_frequency); log_error("Unsupported sampling frequency %u", (int) sampling_frequency);
return ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE; return ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
} }
sc.local_stream_endpoint->media_codec_sbc_info[0] = config; sc.local_stream_endpoint->media_codec_sbc_info[0] = config;

View File

@ -1861,17 +1861,17 @@ static void hfp_ag_handle_rfcomm_data(uint8_t packet_type, uint16_t channel, uin
hfp_connection->send_error = 1; hfp_connection->send_error = 1;
return; return;
} }
log_info("HF Indicator 'enhanced security' set to %u", hfp_connection->parser_indicator_value); log_info("HF Indicator 'enhanced security' set to %u", (unsigned int) hfp_connection->parser_indicator_value);
break; break;
case 2: // battery level case 2: // battery level
if (hfp_connection->parser_indicator_value > 100){ if (hfp_connection->parser_indicator_value > 100){
hfp_connection->send_error = 1; hfp_connection->send_error = 1;
return; return;
} }
log_info("HF Indicator 'battery' set to %u", hfp_connection->parser_indicator_value); log_info("HF Indicator 'battery' set to %u", (unsigned int) hfp_connection->parser_indicator_value);
break; break;
default: default:
log_info("HF Indicator unknown set to %u", hfp_connection->parser_indicator_value); log_info("HF Indicator unknown set to %u", (unsigned int) hfp_connection->parser_indicator_value);
break; break;
} }
hfp_connection->ok_pending = 1; hfp_connection->ok_pending = 1;

View File

@ -4005,7 +4005,7 @@ static void l2cap_sm_packet_handler(uint8_t packet_type, uint16_t channel_nr, ui
UNUSED(channel_nr); UNUSED(channel_nr);
UNUSED(size); UNUSED(size);
UNUSED(packet_type); UNUSED(packet_type);
btstack_assert(packet_type = HCI_EVENT_PACKET); btstack_assert(packet_type == HCI_EVENT_PACKET);
if (hci_event_packet_get_type(packet) != SM_EVENT_PAIRING_COMPLETE) return; if (hci_event_packet_get_type(packet) != SM_EVENT_PAIRING_COMPLETE) return;
hci_con_handle_t con_handle = sm_event_pairing_complete_get_handle(packet); hci_con_handle_t con_handle = sm_event_pairing_complete_get_handle(packet);
btstack_linked_list_iterator_t it; btstack_linked_list_iterator_t it;